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

terrascan does not handle default value for optional type #1731

Open
arongate opened this issue Apr 4, 2025 · 0 comments
Open

terrascan does not handle default value for optional type #1731

arongate opened this issue Apr 4, 2025 · 0 comments

Comments

@arongate
Copy link

arongate commented Apr 4, 2025

terraform fails for optional type with default value

example

variable "my_var" {
  type = object({
    name = string
    value = optional(string,null)
  })
}

terrascan command will return the following type of error


Scan Errors -

        IaC Type            :   terraform
        Directory           :   /project/terraform/security
        Error Message       :   failed to build unified config. errors:
/tmp/9gjrga/variables.tf:27,27-41: Invalid type specification; Optional attribute modifier expects only one argument: the attribute type.
/tmp/9gjrga/variables.tf:39,27-41: Invalid type specification; Optional attribute modifier expects only one argument: the attribute type.
/tmp/9gjrga/variables.tf:52,32-46: Invalid type specification; Optional attribute modifier expects only one argument: the attribute type.
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

1 participant