example of variable definition in terraform with a list of object.
- User
example of variable definition in terraform with a list of object.
Assistant
Here is an example of defining a variable in Terraform that is a list of objects:
hclvariable "security_groups" { type = list(object({ name = string vpc_id = string description = string })) default = [ { name = "web-sg" vpc_id = "vpc-abcd1234" description = "Allow HTTP and SSH traffic" }, { name = "db-sg" vpc_id = "vpc-abcd1234" description = "Allow MySQL and SSH traffic" } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.