terraform-community-modules/tf_aws_elasticache_redis

I think your "fix Parameter Groups name conflicts in update engine" is not working well

vicendominguez opened this issue · 2 comments

Hey folks,

Updating our Redis (AWS ElasticCache) using a pipeline with terraform 11.11 we saw a conflict where the redis_parameter_group had the same salt word in different pipelines execution. The fix 2cf697a looked like good.

So we did a test with your approach in 2cf697a:

resource "random_id" "salt" {
  byte_length = 8
}
output test_random {
  value = "${random_id.salt.hex}"
}

And after applying it we saw:

./terraform apply
random_id.salt: Refreshing state... [id=dOmiq650dIs]
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
test_random = 74e9a2abae74748b
code/Playground/terraform-locals
▶ ./terraform apply
random_id.salt: Refreshing state... [id=dOmiq650dIs]
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
test_random = 74e9a2abae74748b
code/Playground/terraform-locals
▶ ./terraform apply
random_id.salt: Refreshing state... [id=dOmiq650dIs]
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
test_random = 74e9a2abae74748b

As you can see.. .the salt is always the same and the conflict/problem looks like not solved.

Following the documentation https://www.terraform.io/docs/providers/random/r/id.html#keepers
we saw keepers might solve this problem. Using our same example, it would be something like this:

resource "random_id" "salt" {
  keepers = {
    date = "${timestamp()}"
  }
  byte_length = 8
}

and it worked! And we made the same test with terraform 12 and this case is exactly the same.

This said, my question is: am I missing anything here? was your fix working? how was it tested?

Thanks!!!

As you can see here https://github.com/peertransfer/tf_aws_elasticache_redis/pull/1/files @antonbabenko and I told u in the confmngmntcamp, we chose to use a keeper over the redis version. If it changes, then it makes a new seed.

Hi @vicendominguez !

Better late than never :)

v2.2.0 has been just released with many fixes for Terraform 0.12 users, and v1.9.0 - for Terraform 0.11 users.