Commit e4c48d46 authored by Mike Hennessy's avatar Mike Hennessy Committed by GitHub

fix: Ensure database route table output works (#926)

* fix: ensure database route table output works

On initial plan the `database_route_table_ids` output is not
available due to the values not being known until after apply.
Switching the logic to test the length of the array fixes this
issue. Credit to @martin566 for discovering the solution.

fixes #857

* Update outputs.tf

* Update outputs.tf

---------
Co-authored-by: default avatarBryant Biggs <bryantbiggs@gmail.com>
parent b588428c
......@@ -279,7 +279,8 @@ output "database_subnet_group_name" {
output "database_route_table_ids" {
description = "List of IDs of database route tables"
value = try(coalescelist(aws_route_table.database[*].id, local.private_route_table_ids), [])
# Refer to https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/926 before changing logic
value = length(aws_route_table.database[*].id) > 0 ? aws_route_table.database[*].id : aws_route_table.private[*].id
}
output "database_internet_gateway_route_id" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment