I have created a RedisCluster
using aws-cdk(python)
. everything is fine in case of deploying this cluster.
Issue
Today when I want to increase/decrease the num of nodes for this RedisCluster
using AWS-CDK(PYTHON), I am experiencing the below error.
UPDATE_FAILED| AWS::ElastiCache::ReplicationGroup| b-redis-2/b-redis-2-cluster (bredis2bredis2cluster)CloudFormation cannot update a stack when a custom-named resource requires replacing. Rename b-redis-2-cluster and update the stack again.
It seems AWS-CDK is not supporting updating RedisCluster
.
Is that true or Am I missing someting?
If I try to rename the b-redis-cluster
to different one, basically it will try to delete the existing cluster and will create a new one.
I dont want to delete the existing redis-cluster and want to just update the number of nodes
Can anyone suggest a solution for this?
2
Answers
The error message is correct. You can’t replace named resources. Recent AWS blog post explains how to deal with such a situation:
And the resolution is that you have to rename your resource sadly, or remove name, so you will have to create new cluster.
But either way, since your update requires replacement you will always get new cluster. Its only the question whether it will have different name or same. So you have to backup it first, and then restore to newly created one.
You can update the nodes in place without deleting the cluster if you set
UseOnlineResharding
to true in the replication group’s UpdatePolicyhttps://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-useonlineresharding