massdriver-cloud / airlock

Generate JSON Schema from various sources (terraform, helm)
https://massdriver.cloud
Apache License 2.0
4 stars 2 forks source link

Issue with Optional Attributes with Defaults #9

Open mathewpeterson opened 1 week ago

mathewpeterson commented 1 week ago

Hello!

I am having issues converting from Terraform inputs that uses an optional attribute with default:

variable "withoptionaldefault" {
  type = object({
    foo = string
    fizz = optional(string, "fizz")
  })
  default = {"foo":"bar"}
}

When I run:

$ airlock terraform input .

I get the following error:

Error: :3,20-36: Invalid type specification; Optional attribute modifier expects only one argument: the attribute type.

Terraform Docs: https://developer.hashicorp.com/terraform/language/expressions/type-constraints#example-nested-structures-with-optional-attributes-and-defaults

mclacore commented 3 days ago

Thanks @mathewpeterson for letting us know! I'll look into that this week