vscode-terraform icon indicating copy to clipboard operation
vscode-terraform copied to clipboard

Recognise local references in dynamic blocks

Open anthonyma94 opened this issue 1 year ago • 1 comments

Extension Version

v2.33.0

VS Code Version

Version: 1.94.2 (system setup) Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427 Date: 2024-10-09T16:08:44.566Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Operating System

WSL Ubuntu 24.04

Terraform Version

Terraform 1.8.4

Steps to Reproduce

locals {
  user_attributes = {
    email = {
      name                = "email"
      attribute_data_type = "String"
    }
    "selected_tenant" = {
      name                     = "custom:selected_tenant"
      attribute_data_type      = "String"
      developer_only_attribute = false
      mutable                  = true
      string_attribute_constraints = {
        max_length = 2048
        min_length = 0
      }
    }
  }
}

resource "aws_cognito_user_pool" "name" {
 ...
  dynamic "schema" {
    for_each = { for k, s in local.user_attributes : k => s }
    # no syntax highlighting or intellisense for schema
    #####################################################################
    content {
      attribute_data_type      = schema.value.attribute_data_type
      name                     = replace(schema.value.name, "custom:", "")
      developer_only_attribute = lookup(schema.value, "developer_only_attribute", null)
      mutable                  = lookup(schema.value, "mutable", null)
    }
  }
}

Expected Behavior

Not sure if it's supported, but having syntax highlighting and intellisense would be nice.

Actual Behavior

No syntax hightlighting or intellisense.

Terraform Configuration

No response

Project Structure

No response

Gist

No response

Anything Else?

No response

Workarounds

No response

References

No response

Help Wanted

  • [ ] I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

anthonyma94 avatar Oct 25 '24 16:10 anthonyma94