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

provider/aws aws_elasticache_cluster: cache_nodes list behaves strangely #12878

Closed
tothandras opened this issue Mar 20, 2017 · 4 comments
Closed

Comments

@tothandras
Copy link

Terraform Version

Terraform v0.9.1

Affected Resource(s)

  • provider/aws:
    • aws_elasticache_cluster

Terraform Configuration Files

The relevant parts:

# this works:
output "nodes" {
  value = ["${format("%s:%s", aws_elasticache_cluster.redis.cache_nodes.0.address, aws_elasticache_cluster.redis.cache_nodes.0.port)}"]
}

# this doesn't:
# output "nodes" {
#  value = ["${formatlist("%s:%s", aws_elasticache_cluster.redis.cache_nodes.*.address, aws_elasticache_cluster.redis.cache_nodes.*.port)}"]
# }

Also:

At column 3, line 1: element: argument 1 should be type list, got type string in:

${element(aws_elasticache_cluster.redis.cache_nodes.*.port, count.index)}

Steps to Reproduce

  1. terraform apply
@tothandras
Copy link
Author

@grubernaut I'd like to contribute with a PR by fixing this bug. Can you help me where I should look for the root issue? Could it come from the resource itself or somewhere else?

@joelhandwell
Copy link
Contributor

joelhandwell commented Feb 5, 2018

@jbardin Related with #10657 ?

@apparentlymart apparentlymart added config and removed core labels Nov 7, 2018
@teamterraform
Copy link
Contributor

Hi @tothandras! Sorry for the long silence here.

This looks like a symptom of a known limitation in Terraform 0.11 and earlier where any list containing an unknown value would itself become an unknown value and no longer be accepted as a list by the type checker.

Terraform 0.12 has addressed that by improving the representation of unknown values so that a list can contain a mixture of known and unknown elements and so that unknown values still track type information.

The handling of these language features was completely rewritten for Terraform 0.12, so if anyone is still seeing problems related to these features we'd ask that you open a new issue so we can capture (via the issue template) information about the bug as it relates to the new implementation. Thanks for reporting this, and sorry again it took so long to respond to it.

@ghost
Copy link

ghost commented Aug 17, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants