I managed to use for_each
to create resources in regions based on a given array. Now I want to use the output URNs to assign the resources to a project in Digital Ocean. The problem is that the way I output the URNs for the resources creates a map while the project_resources resource can only use lists of strings.
My code:
output.tf
output "droplet_urns" {
value = tomap({
for k, drops in digitalocean_droplet.web : k => drops.urn
})
}
How can I convert the map into a list or use the value based on the key? I’m using Terraform v1.1.9