Skip to content

Instantly share code, notes, and snippets.

@akloya
Last active January 7, 2021 20:33
Show Gist options
  • Save akloya/cef9f2645697aca39b27bf884ceaa67f to your computer and use it in GitHub Desktop.
Save akloya/cef9f2645697aca39b27bf884ceaa67f to your computer and use it in GitHub Desktop.
variable "myvar" {
default = [
{
"name" : "config_bucket",
"value" : "bucketname"
},
{
"name" : "version",
"value" : "1.2.3"
},
]
}
output "demoname" {
value = { for key in var.myvar : key.name => key.value }["config_bucket"]
}
# =====>
# ajayaloya@:  terraform apply
# Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
# Outputs:
# demoname = bucketname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment