Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adds database_subnet_group_name as an output variable #592

Merged
merged 5 commits into from
Feb 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ output "database_subnet_group" {
value = concat(aws_db_subnet_group.database.*.id, [""])[0]
}

output "database_subnet_group_name" {
description = "Name of database subnet group"
value = aws_db_subnet_group.database.*.name[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the [0] at the end?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want a list here, but a string. And ss the database subnet group name is the same whatever the number of subnets is defined, it is safe to take the first occurrence on the list.

DeLoWaN marked this conversation as resolved.
Show resolved Hide resolved
}

output "redshift_subnets" {
description = "List of IDs of redshift subnets"
value = aws_subnet.redshift.*.id
Expand Down