-
Starting in Terraform 1.3.0 introduced new standard feature - Optional attributes for object type constraints. However TFlint throws error if try to use it with two parameters. Code from Terraform documentationvariable "with_optional_attribute" {
type = object({
a = string # a required attribute
b = optional(string) # an optional attribute
c = optional(number, 127) # an optional attribute with a default value
})
} Actual behaviorTFlint doesn't accept the code above and throws an error: Error: Invalid type specification
on variables.tf line 40, in variable "with_optional_attribute":
40: c = optional(number, 127) # an optional attribute with a default value
Optional attribute modifier expects only one argument: the attribute type. Additional Context$ tflint --version
TFLint version 0.40.0
+ ruleset.terraform (0.1.0-bundled)
$ terraform --version
Terraform v1.3.1
on windows_amd64
+ provider registry.terraform.io/hashicorp/aws v4.34.0 |
Beta Was this translation helpful? Give feedback.
Answered by
wata727
Oct 11, 2022
Replies: 1 comment
-
Please upgrade to v0.41 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wata727
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please upgrade to v0.41
https://github.com/terraform-linters/tflint/releases/tag/v0.41.0