Hey there! I have been experimenting with Objects/Lists in Terraform and I’m getting an issue that I’m not sure how to solve. Would love to get input from you guys!
Basically I have one list for example:
[
"Dev"
"Prod"
]
And then there is one object that has values like the following (this object is coming from an output, that’s why I need to make it dynamic:
{
"Dev": "value-dev",
"Stg": "value-stg",
"Prod": "value-prod"
}
Is there any way to build a list with just the values but only if the first list contains the Keys?
For example, the remaining list should be something like:
[
"value-dev",
"value-prod"
]
As you can see Stg Key => Value pair was ignored because “Stg” was not present in the first list!
Thank you so much!