Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Block causing Unexpected Block: Blocks of type "dynamic" are not expected here. #1930

Open
1 task
michaelrichards-cosmo opened this issue Dec 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@michaelrichards-cosmo
Copy link

Extension Version

v2.34.2

VS Code Version

Version: 1.96.2 (user setup)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Operating System

Windows 11 Enterprise version 23H2

Terraform Version

Terraform v1.10.3 on Windows_386

Steps to Reproduce

Main.TF

resource "azurerm_dev_center" "adc" {
name = lower("adc-${var.environment}-${var.solution_name}-${var.location}-${var.instance_number}")
resource_group_name = var.resource_group_name
location = var.location
}

#Dynamic creation of projects
dynamic "project" {
for_each = var.projects
content {
resource "azurerm_dev_center_project" "example" {
name = project.value.name
dev_center_id = azurerm_dev_center.example.id
description = project.value.description
}
}
}

Variables TF:

variable "projects" {
description = "List of projects"
type = list(object({
name = string
description = string
}))
}

Expected Behavior

This is valid syntax. I wouldn't expect the dynamic block to be throwing the error

Actual Behavior

In the Main.TF, IntelliSense indicating: Unexpected Block: Blocks of type "dynamic" are not expected here.

Terraform Configuration

No response

Project Structure

No response

Gist

No response

Anything Else?

No response

Workarounds

No response

References

Similar to 1594 and 1877

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
@michaelrichards-cosmo michaelrichards-cosmo added the bug Something isn't working label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant