Closed joshuabaird closed 7 months ago
Can we get this merged? @goruha
/test all
/test all
@joshuabaird thanks for the PR Please see the errors https://github.com/cloudposse/actions/actions/runs/4376943663/jobs/7659766652
variables are not allowed in the lifecycle
block. This is an annoying TF feature
We usually get around that by creating two similar resources
resource "aws_elasticache_parameter_group" "default"
count = module.this.enabled && var.parameter_group_create_before_destroy == false ? 1 : 0
resource "aws_elasticache_parameter_group" "create_before_destroy"
count = module.this.enabled && var.parameter_group_create_before_destroy == true ? 1 : 0
and in the outputs.tf
, select one or the other by using var.parameter_group_create_before_destroy ? xxx : yyy
please also run the following commands:
make init
make github/init
make readme
and commit the changes (GitHub token has been chamged in GH workflows, and the command make github/init
will update all the GH workflows in the repo)
thank you
@joshuabaird thanks for the PR Please see the errors https://github.com/cloudposse/actions/actions/runs/4376943663/jobs/7659766652
variables are not allowed in the
lifecycle
block. This is an annoying TF feature We usually get around that by creating two similar resources
I see that Terratest is failing, but this code does work. I'm using it. I'll take a look at your suggestion.
@joshuabaird Yes. We have so issue with our test infrastructure. I will rerun tests ASAP.
Thinking about this more, I don't think we need to parameterize the lifecycle in the first place. I think this is easily solved by always setting create_before_destroy = true
.
what
This PR adds two new variables:
parameter_group_name
parameter_group_create_before_destroy
why
This module doesn't currently support major version upgrades of Redis (eg, 6.x to. 7.x) because:
var.family
fromredis6
toredis7
, Terraform needs to create a new parameter group. Withoutcreate_before_destroy
, Terraform tries to first destroy the old Param group which fails because it's currently in useredis7
, it fails because it tries to do so using the same name as the old param group.references