Finally fixes subnet list output

This finally fixes the output coming from the vpc module so that it
returns a full list of subnets. Now they can be referenced just like the
redis module is using in this commit.
This commit is contained in:
Rob Gil 2020-01-23 20:22:53 -05:00
parent 3f5bbf2c5e
commit e0d59eb166
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
output "subnets" {
value = azurerm_subnet.subnet["private"].id #FIXME - output should be a map
value = azurerm_subnet.subnet["private"].id #FIXED: this is now legacy, use subnet_list
}
output "subnet_list" {
value = {
for k, id in azurerm_subnet.subnet : k => id
}
}

View File

@ -4,7 +4,7 @@ module "redis" {
environment = var.environment
region = var.region
name = var.name
subnet_id = module.vpc.subnets
subnet_id = module.vpc.subnet_list["redis"].id
sku_name = "Premium"
family = "P"
}