terraform validate, terraform plan, terraform apply all succeed (terraform v1.3.6)
Terrascan throws variations of the following, depending on environment:
Terrascan Sandbox
failed to scan uploaded file. error: 'failed to load iac file '/tmp/terrascan-67659632.tf'. error:
/tmp/terrascan-67659632.tf:6,3-11: Unsupported argument; An argument named "nullable" is not expected here.
'
Alpine/edge (gitlab runner)
2023-03-10T08:21:51.247Z [31merror[0m cli/run.go:141 scan run failed{error 26 0 failed to load iac file '/path/redacted/variables.tf'. error: /path/redacted/variables.tf:24,3-11: Unsupported argument; An argument named "nullable" is not expected here.
Description
After adding nullable = false to a variable definition, terrascan can no longer parse the file.
See https://www.terraform.io/language/values/variables#disallowing-null-input-values for documentation of the field.
Here is a minimal example:
What I Did
terraform validate
,terraform plan
,terraform apply
all succeed (terraform v1.3.6)Terrascan throws variations of the following, depending on environment:
Terrascan Sandbox
Alpine/edge (gitlab runner)
Additional notes
This bug was first reported in version 1.13.2 here: https://github.com/tenable/terrascan/issues/1176 It was incorrectly marked as fixed by https://github.com/tenable/terrascan/pull/1211 It is still present in 1.18.0 and similar issues are found in multiple versions e.g. here: https://github.com/tenable/terrascan/issues/1262