Search code examples
amazon-web-servicesredisterraformamazon-elasticacheterragrunt

Force Terraform to apply pending changes on AWS Elasticache Redis cluster


I am attempting to change the node type of Elasticache from older generation (cache.t2.) to newer generation (cache.t3.) using Terraform.

Able to modify the node types successfully for all of Memcached instances via terraform apply, but unfortunately when I attempt to change the node type of Redis using terraform apply the command reaches completion in just ~30s and no change is applied.

To apply the node types change I have to login to web console and click individual Redis instance & click modify and apply the pending changes and wait for it to complete. This is manual work for me, I have to do this for 100 Redis instances.

Is it possible to force terraform to apply the pending changes for Redis on Elasticache?.


Solution

  • Did you try to argument https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_cluster#apply_immediately ?

    Maybe another solution is to run a bash script with aws-cli --apply-immediately option https://docs.aws.amazon.com/cli/latest/reference/elasticache/modify-cache-cluster.html