Skip to content

Conversation

ekini
Copy link
Contributor

@ekini ekini commented Apr 7, 2019

Fixes #37

output.tf Outdated

output "host" {
value = "${module.dns.hostname}"
value = "${element(coalescelist(compact(list(module.dns.hostname)), aws_elasticache_replication_group.default.*.primary_endpoint_address), 0)}"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
value = "${element(coalescelist(compact(list(module.dns.hostname)), aws_elasticache_replication_group.default.*.primary_endpoint_address), 0)}"
value = "${coalesce(module.dns.hostname, join("", aws_elasticache_replication_group.default.*.primary_endpoint_address)}"

If enabled=false, module.dns.hostname will be empty and aws_elasticache_replication_group.default.*.primary_endpoint_address will be empty list.
does element work on an empty list?

We can simplify by using coalesce and join.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that's a good point,

Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

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

thanks @ekini
please see comments

@aknysh
Copy link
Member

aknysh commented Apr 11, 2019

Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

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

thanks @ekini

@aknysh aknysh merged commit 1841eaa into cloudposse:master Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output redis host is not returning
2 participants