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

Resource 'aws_elasticache_cluster.redis' does not have attribute 'cache_nodes' for variable 'aws_elasticache_cluster.redis.*.cache_nodes' #4703

Closed
chadgrant opened this issue Jan 16, 2016 · 4 comments

Comments

@chadgrant
Copy link

Pretty sure this syntax is correct, I've used it to export elasticache addresses from a module, but it doesn't like it here?

The error occurs on running a plan

Relevant config:

resource "aws_elasticache_cluster" "redis" {
    count = "${length(split(",",var.elasticache_redis_nodes))}"
}

resource "aws_route53_record" "cache" {
  count = "${length(split(",",var.elasticache_redis_nodes))}"

  records = ["${element(aws_elasticache_cluster.redis.*.cache_nodes.0.address, count.index)}"]
}
@cu12
Copy link

cu12 commented Sep 15, 2016

The workaround I found is something like the following:

resource "aws_route53_record" "cache" {
  count = "${length(compact(split(",", var.environments)))}"

  zone_id = "${aws_route53_zone.private.zone_id}"
  name    = "${element(split(",", var.environments), count.index)}-cache"
  type    = "CNAME"
  ttl     = "5"
  records = ["${aws_elasticache_cluster.default.*.cache_nodes.0.address[count.index]}"]
}

Update:

Scratch that, I was playing a lot with this and once you plan - and try to apply like this:

resource "aws_route53_record" "cache" {
  count = "${length(compact(split(",", var.environments)))}"

  zone_id = "${aws_route53_zone.private.zone_id}"
  name    = "${element(split(",", var.environments), count.index)}-cache"
  type    = "CNAME"
  ttl     = "5"
  records = ["${aws_elasticache_cluster.default.*.cache_nodes}"]
}

it will fail, although if you then plan and apply the snippet above, it creates the record. 👽

@promiseofcake
Copy link

What is the correct workaround for this in 2018?

@hashibot
Copy link
Contributor

Hello! 🤖

This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it.

If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform.

Thanks!

@ghost
Copy link

ghost commented Sep 27, 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 Sep 27, 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