Change the number of replicas on my cluster without recreate it using CloudFormation


I have a CloudFormation stack that creates a AWS::ElastiCache::ReplicationGroup wiht 1 shard (NumNodeGroups) which contains 1 primary nodes and 2 replicas. It have cluster mode enabled and uses multi az.

Every time I need to update the parameter ReplicasPerNodeGroup CloudFormation recreates the entire cluster instead of only change shards adding or deleting replicas. The documentation says that the update requires a replacement.

But adding or deleting replicas from console only modify the current cluster without recreate it, keeping the data.

Is there a way to create a Redis Cluster with cluster mode enabled and multi az, using cloudformation, that allows me to change the number of replicas without recreating the entire cluster ? The current cloudformation behaviour does not make sense at all.

1 Answer
Accepted Answer


Currently when CloudFormation requires an REPLACEMENT of a resource, there is no workaround for getting around the replacement of the resource.

For the specific AWS::ElastiCache::ReplicationGroup resource, this resource in the past did not support updating the parameter ReplicasPerNodeGroup via console as well. Upon which the cloudformation resource was designed initially.

That being said the Cloudformation service team is aware of this behavior change for the ReplicasPerNodeGroup parameter via the console and are working towards releasing a fix so that you can update ReplicasPerNodeGroup via Cloudformation without a replacement of the cluster in the same way you are able to do it via the console.

I do not have an ETA when this would be released however as soon as it gets released, it should be publicly announced in either one of the following links:

AWS Blog - AWS New -

answered a year ago
  • Searching for a solution for this, I found my own question.

    If I change the replica count using the console to the desired amount and then update the CloudFormation to reflect this change, will it be applied without try to do any change additional change or does it enters in drift ?


You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions