Terraform HCL2: dynamic resource doesn't work properly
See original GitHub issuePrerequisites
- Ensure you have latest version of plugin installed
- Search for possible issue duplicates
Installation details
- IDE version (
Help->About->Copy to Clipboard
)
IntelliJ IDEA 2019.1.3 (Community Edition)
Build #IC-191.7479.19, built on May 28, 2019
JRE: 1.8.0_202-release-1483-b58 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5
- intellij-hcl plugin version (
Settings->Plugins
)
v0.7.3,v0.7.4
- Terraform version (
terraform -v
)
0.12.2
Terraform Configuration Files
resource "aws_codebuild_project" "default" {
name = local.project_name
description = local.project_description
dynamic "source" {
for_each = [local.source_code]
content {
buildspec = lookup(source.value, "buildspec", null)
git_clone_depth = lookup(source.value, "git_clone_depth", null)
insecure_ssl = lookup(source.value, "insecure_ssl", null)
location = lookup(source.value, "location", null)
report_build_status = lookup(source.value, "report_build_status", null)
type = source.value.type
dynamic "auth" {
for_each = lookup(source.value, "auth", [])
content {
resource = lookup(auth.value, "resource", null)
type = auth.value.type
}
}
}
}
...
}
Expected Behavior
It should show the resource normally, but it shows it highlighted (like when we add an external module). I’ve uploaded an image with an example.
When I run terraform apply
it works just fine.
Actual Behavior
Steps to Reproduce
- Add a resource.
- Inside the resource, add a
dynamic
block.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Announcing HashiCorp Nomad 1.0 Beta
Dynamic Application Sizing monitors Nomad jobs, tracks their resource usage, and right-sizes applications to their most efficient levels of ...
Read more >hashicorp-terraform/Lobby - Gitter
I have a data block that returns a list of data [foo1, foo2, foo3] and I need to loop this list and run...
Read more >lablabs/label/null - Terraform Registry
Terraform module designed to generate consistent names and tags for resources. Use terraform-null-label to implement a strict naming ...
Read more >Terraform v0.12 Multi-line String EOF shell-style "here doc ...
The correct syntax for a "flush heredoc" does not include a dash on the final marker: aws_key_path = <<-EOF #{martinTestPrivateKey} EOF.
Read more >SweetOps #terraform for December, 2020
Terraform currently does not have a lifecycle attribute for retaining such resources. We are curious as to whether or not retaining resources is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @VladRassokhin On my side it’s working fine now 👍
Its on the aws_launch_template in my case. But yes it’s nested under several sub blocks.
Thanks for fixing it so fast! Really useful plugin for me (and much more powerful than VSCode one).