79204357

Date: 2024-11-19 16:56:04
Score: 1.5
Natty:
Report link

Setting my outputs on the root module to this works.

output "routes" {
  value       = [for route in azurerm_route.routes : route.name]
  description = "Blocks containing configuration of each route."
}

I can then as @marko-e suggested reference this from my child module using

output "routes" {
  value       = module.route_table.routes
  description = "Blocks containing configuration of each route."
}

The output now looks like this:

Outputs:

id = "/subscriptions/e286703f-8ba4-4a0d-bd44-8fb115bdebcd/resourceGroups/rg-rtb-uks-001/providers/Microsoft.Network/routeTables/route-table-001"
name = "route-table-001"
routes = [
  "firewall",
  "internet",
  "route2",
]

Thanks.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @marko-e
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Scott