Commit 7d1ad362 authored by Martin Atkins's avatar Martin Atkins Committed by Anton Babenko

db_subnet_group: fix failing output expressions (#22)

Accessing aws_db_subnet_group.this when its count = 0 is an error, so we
need to instead access it via splat syntax and then apply a default value
for when the resulting list is empty.
parent 6e3527a8
# DB subnet group # DB subnet group
output "this_db_subnet_group_id" { output "this_db_subnet_group_id" {
description = "The db subnet group name" description = "The db subnet group name"
value = "${var.count == 0 ? "" : aws_db_subnet_group.this.id}" value = "${element(concat(aws_db_subnet_group.this.*.id, list("")), 0)}"
} }
output "this_db_subnet_group_arn" { output "this_db_subnet_group_arn" {
description = "The ARN of the db subnet group" description = "The ARN of the db subnet group"
value = "${aws_db_subnet_group.this.arn}" value = "${element(concat(aws_db_subnet_group.this.*.arn, list("")), 0)}"
} }
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