Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

use splat syntax in fully_qualified_domain_name output #31

Merged
merged 2 commits into from
Jan 4, 2018

Conversation

vlfig
Copy link
Contributor

@vlfig vlfig commented Jan 3, 2018

Terraform >0.11.1 warns about non-splat references to resources with count defined.

This will become fatal in 0.12 (hashicorp/terraform#16735)

See https://github.com/hashicorp/terraform/blob/v0.11.1/CHANGELOG.md

@vlfig vlfig changed the title use splat syntax in fully_qualified_domain_name output use splat syntax in fully_qualified_domain_name output Jan 3, 2018
Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

Thx for the PR!

@@ -15,5 +15,5 @@ output "load_balancer_security_group_id" {
}

output "fully_qualified_domain_name" {
value = "${aws_route53_record.vault_elb.fqdn}"
value = "${aws_route53_record.vault_elb.*.fqdn}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will turn this output into a list, which is probably not what we want. You instead need to use the slightly ugly workaround listed here:

value = "${element(concat(aws_route53_record.vault_elb.*.fqdn, list("")), 0)}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Wasn't aware of that guide. Have a look.

Keeps fully_qualified_domain_name with type string
deals correctly with the case when vault_elb is absent
Copy link
Collaborator

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@brikis98 brikis98 merged commit 4e888fd into hashicorp:master Jan 4, 2018
@brikis98
Copy link
Collaborator

brikis98 commented Jan 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants