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

0

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 年前檢視次數 497 次
1 個回答
1
已接受的答案

Hello,

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 - https://aws.amazon.com/blogs/aws/ AWS New - https://aws.amazon.com/new/

AWS
已回答 1 年前
  • 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 ?

    Thanks.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南