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

Can't parse Terraform variable field: nullable #1547

Open
leadenmoth opened this issue Mar 17, 2023 · 6 comments
Open

Can't parse Terraform variable field: nullable #1547

leadenmoth opened this issue Mar 17, 2023 · 6 comments

Comments

@leadenmoth
Copy link

  • terrascan version: v1.18.0
  • Operating System: macOS 13.2.1, alpine/edge, Terrascan Sandbox

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:

terraform {
}

variable "in" {
  type     = string
  nullable = false
}

resource "null_resource" "test_resource" {
  triggers = {
    input_value = var.in
  }
}

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

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.

Additional notes

This bug was first reported in version 1.13.2 here: #1176
It was incorrectly marked as fixed by #1211
It is still present in 1.18.0 and similar issues are found in multiple versions e.g. here: #1262

@maxmanus96
Copy link

+1, I am using TERRAFORM_VERSION: '1.3.5'

@arkeros
Copy link

arkeros commented Sep 27, 2023

Any update?

@mjnowen
Copy link

mjnowen commented Dec 29, 2023

+1 this issue is a blocker

@sodds-eq
Copy link

Still an issue in v1.18.11

@oferchen
Copy link

oferchen commented Apr 5, 2024

Still an issue v1.19.1

@stevehipwell
Copy link

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants