Skip to content

Commit e4c48d4

Browse files
henworthbryantbiggs
andauthoredJul 25, 2023
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: Bryant Biggs <bryantbiggs@gmail.com>
1 parent b588428 commit e4c48d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎outputs.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ output "database_subnet_group_name" {
279279

280280
output "database_route_table_ids" {
281281
description = "List of IDs of database route tables"
282-
value = try(coalescelist(aws_route_table.database[*].id, local.private_route_table_ids), [])
282+
# Refer to https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/926 before changing logic
283+
value = length(aws_route_table.database[*].id) > 0 ? aws_route_table.database[*].id : aws_route_table.private[*].id
283284
}
284285

285286
output "database_internet_gateway_route_id" {

0 commit comments

Comments
 (0)
Please sign in to comment.