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

Can't use cache_nodes output of aws_elasticache_cluster as a list #15040

Closed
phoolish opened this issue Jun 3, 2017 · 1 comment
Closed

Can't use cache_nodes output of aws_elasticache_cluster as a list #15040

phoolish opened this issue Jun 3, 2017 · 1 comment

Comments

@phoolish
Copy link
Contributor

phoolish commented Jun 3, 2017

This seems to be the return of #8794

Terraform Version

0.9.6
0.9.2

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_elasticache_cluster

Terraform Configuration Files

resource "aws_elasticache_cluster" "memcached" {
  cluster_id = "foo"
  engine = "memcached"

  num_cache_nodes = 3
  node_type = "cache.t2.micro"
}

resource "route_53_record" "memcached-site-com" {
  count = "${length(aws_elasticache_cluster.memcached.cache_nodes)}"
  zone_id = "${aws_route53_zone.site-com.zone_id}"
  name = "${format("node%d.mem.site.com", count.index)}"
  type = "CNAME"
  records = [
    "${element(aws_elasticache_cluster.memcached.cache_nodes.*.address, count.index)}",
  ]
  ttl = "300"
}

Debug Output

Panic Output

Expected Behavior

3 route53_records should be generated.

Actual Behavior

Error refreshing state: 1 error(s) occurred:

* aws_route53_record.mem-site-com: 3 error(s) occurred:

* aws_route53_record.mem-site-com[0]: At column 3, line 1: element: argument 1 should be type list, got type string in:

${element(aws_elasticache_cluster.mem-site-com.cache_nodes.*.address, count.index)}
* aws_route53_record.mem-site-com[1]: At column 3, line 1: element: argument 1 should be type list, got type string in:

${element(aws_elasticache_cluster.mem-site-com.cache_nodes.*.address, count.index)}

${element(aws_elasticache_cluster.mem-site-com.cache_nodes.*.address, 0)}
* aws_route53_record.mem-site-com[2]: At column 3, line 1: element: argument 1 should be type list, got type string in:

${element(aws_elasticache_cluster.mem-site-com.cache_nodes.*.address, count.index)}

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@ghost
Copy link

ghost commented Apr 9, 2020

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 Apr 9, 2020
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

3 participants