HCL2 Syntax for Maps is falsely marked as invalid
See original GitHub issueThe new Map (introduced in Terraform 0.12) creation syntax is not accepted by the plugin.
More details: https://www.terraform.io/docs/configuration/functions/map.html
See deprecation warning of the map()
function and recommendation to use a shorter syntax.
Prerequisites
- Ensure you have latest version of plugin installed
- Search for possible issue duplicates
Installation details
- IDE version (
Help->About->Copy to Clipboard
)
Build #IU-192.5587.17, built on July 2, 2019
IntelliJ IDEA EAP User
Expiration date: August 1, 2019
Runtime version: 11.0.3+12-b304.10 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
Non-Bundled Plugins: Lombook Plugin, com.intellij.plugins.watcher, io.protostuff.protostuff-jetbrains-plugin, mobi.hsz.idea.gitignore, name.kropp.intellij.makefile, org.intellij.plugins.hcl, org.jetbrains.plugins.go-template, izhangzhihao.rainbow.brackets, org.jetbrains.plugins.go, com.intellij.kubernetes, org.toml.lang, org.rust.lang
- intellij-hcl plugin version (
Settings->Plugins
)
0.7.4
- Terraform version (
terraform -v
)
Terraform v0.12.3
+ provider.aws v2.18.0
Terraform Configuration Files
resource "aws_subnet" "public" {
vpc_id = "vpc-whatever"
availability_zone = "us-west-1a"
cidr_block = "10.0.0./24"
// This is where the problems is
tags = merge(
aws_vpc.main.tags,
{
"Public" = "true"
"kubernetes.io/role/elb" = "1"
"kubernetes.io/role/alb-ingress" = "1"
}
)
}
Exception
N/A
Expected Behavior
The syntax of TF 0.12 to define maps should be accepted by the plugin.
Actual Behavior
Plugin marks the keys of the map, such as “Public” as invalid syntax, and states that Argument names must not be quoted. However the syntax is 100% valid and TF commands go through as expected.
Steps to Reproduce
- Copy-paste the above snippet (possible to drop parameters that do not matter)
- Observe marking of keys in the map as “Arguments must not be quoted” (red underlines)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Expressions - Configuration Language | Nomad
HCL allows the use of expressions to access data exported by sources and to transform and combine that data to produce other values....
Read more >hcl
Note that in the native syntax the keywords "true", "false", and "null" are recognized as literal values during parsing and so these ...
Read more >SweetOps #terraform for July, 2021
12 and is no longer available; use tomap({ ... }) syntax to write a literal map. cloudposse/terraform-aws-eks-cluster attachment image.
Read more >I hate Terraform with a passion but it is probably the best ...
Moreover I can never, ever, remember the syntax for moving objects around the config. ... Thanks for the hint, now I'm not sure...
Read more >CHANGELOG.md - hashicorp/packer - Sourcegraph
core: Metadata for capturing template types such as JSON or HCL2 has been added to the ... packer build command: removed option to...
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
Thanks for reporting, fixed, will be available in next update (0.7.5)
Hopefully this week, after I fix one-two more issues.