Last active
January 7, 2021 20:33
-
-
Save akloya/cef9f2645697aca39b27bf884ceaa67f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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