Skip to content

Commit 9127d84

Browse files
fix outputs where coalescelist could be run with all parametes as empty lists
1 parent 7333e94 commit 9127d84

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

outputs.tf

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,17 @@ output "private_route_table_ids" {
196196

197197
output "database_route_table_ids" {
198198
description = "List of IDs of database route tables"
199-
value = coalescelist(aws_route_table.database.*.id, aws_route_table.private.*.id)
199+
value = length(aws_route_table.database.*.id) > 0 ? aws_route_table.database.*.id : aws_route_table.private.*.id
200200
}
201201

202202
output "redshift_route_table_ids" {
203203
description = "List of IDs of redshift route tables"
204-
value = coalescelist(aws_route_table.redshift.*.id, aws_route_table.private.*.id)
204+
value = length(aws_route_table.redshift.*.id) > 0 ? aws_route_table.redshift.*.id : aws_route_table.private.*.id
205205
}
206206

207207
output "elasticache_route_table_ids" {
208208
description = "List of IDs of elasticache route tables"
209-
value = [coalescelist(
210-
aws_route_table.elasticache.*.id,
211-
aws_route_table.private.*.id,
212-
)]
209+
value = length(aws_route_table.elasticache.*.id) > 0 ? aws_route_table.elasticache.*.id : aws_route_table.private.*.id
213210
}
214211

215212
output "intra_route_table_ids" {

0 commit comments

Comments
 (0)