0
votes

I'm using Terraform to scale up and scale down an AWS environment for short running events. I'm having an issue where AWS only allows you to scale up an Elasticache Redis instance type and does not allow you to scale down to a smaller instance type. This means that before I scale down with Terraform I have to delete the 10 sharded Redis nodes first in the AWS console. Is there an easier way to do this with Terraform to delete first and then recreate smaller instances?

1

1 Answers

1
votes

terraform taint did the job

So before you need to change to smaller instance type, taint these resources first. terraform apply will destroy first, then re-create these resources.

terraform taint aws_elasticache_cluster.my_cluster

refer:

https://www.terraform.io/docs/commands/taint.html