Open twellspring opened 4 years ago
I am able to reproduce the error and am working on a resolution. So far, looks like separate blocks are grouped together as a single block and then linted. Whereas a joined block that's already in that format isnt read correctly, and instead UNDEFINED
is returned. Looking into why now.
In this example, fail_best
has the working, separated block syntax and fail_alt
has the failing, joined as a list block syntax.
{
"ID": "fail_best",
"Type": "aws_redshift_parameter_group",
"Category": "resource",
"Properties": {
"__name__": "fail_best",
"__type__": "aws_redshift_parameter_group",
"family": "redshift-1.0",
"name": "fail_foo",
"parameter": [
{
"name": "tls",
"value": "disabled"
},
{
"name": "audit_logs",
"value": "enabled"
}
]
},
"Filename": "./testdata/resources/attr_block_syntax.tf",
"LineNumber": 33
},
{
"ID": "fail_alt",
"Type": "aws_redshift_parameter_group",
"Category": "resource",
"Properties": {
"__name__": "fail_alt",
"__type__": "aws_redshift_parameter_group",
"family": "redshift-1.0",
"name": "fail_bar",
"parameter": "UNDEFINED"
},
"Filename": "./testdata/resources/attr_block_syntax.tf",
"LineNumber": 48
}
For the tf12 parser the block syntax works as expected:
But the list of objects returns a warning/failure condition for the same rule
Per https://www.terraform.io/docs/configuration/attr-as-blocks.html this syntax is not recommended, but is still supported.
Assertion that works for blocks and fails for list of objects