aws-cdk: (aws-elasticache): Update is failing in stacks containing CfnUserGroup after changing Tags
When using elasticache CfnUserGroup in a stack, the fresh deployment is successful but after changing the Tags in the stack props, the CDK deployment is failing while trying to update the UserGroup. There are no changes made to the UserGroup resource directly.
Found another to this: https://github.com/aws/aws-cdk/issues/15378. It was closed because it was not re-producible.
Reproduction Steps
Consider the stack
import * as cdk from "@aws-cdk/core";
import * as elasticache from "@aws-cdk/aws-elasticache";
export class RedisStack extends cdk.Stack {
    constructor(scope: cdk.Construct, id: string, props: cdk.StackProps) {
        super(scope, id, props);
        const redisDefaultUser = new elasticache.CfnUser(
            this,
            "RedisDefaultUser",
            {
                engine: "redis",
                userId: `redis-default-user`,
                userName: "default",
                passwords: [`dontusethiswaytosetpassword`],
                accessString: "on ~* +@all"
            }
        );
        const redisUserGroup = new elasticache.CfnUserGroup(
            this,
            "RedisUserGroup",
            {
                engine: "redis",
                userGroupId: `redis-user-group-bug`,
                userIds: [redisDefaultUser.ref]
            }
        );
        redisUserGroup.addDependsOn(redisDefaultUser);
    }
}
The stack is created as
import { App } from "@aws-cdk/core";
import { RedisStack } from "./redisStack";
const startCdkDeploy = (): void => {
    //Create the stack
    const app = new App();
    new RedisStack(app, "RedisStack", {
        stackName: "RedisTestStack",
        description: "Redis test stack",
        tags: {
            project: "redis",
            owner: "owner-1"
        }
    });
    app.synth();
};
startCdkDeploy();
The fresh deployment of the stack is successful and upgrade without any changes will also work fine.
Then update the stack tag in the constructer to owner-2
tags: {
            project: "redis",
            owner: "owner-2"
        }
Update the stack using cdk deploy
What did you expect to happen?
The stack should get updated without errors and Tags should be updated.
What actually happened?
The stack update is erroring out with the following error.
7:05:32 AM | UPDATE_FAILED        | AWS::ElastiCache::UserGroup | RedisStack/RedisUserGroup
Resource handler returned message: "Please specify the list of user identifiers to be added or removed. (Service: ElastiCache, Status Code: 4
00, Request ID: 5735c315-84ed-4833-99ba-735b0460d46f, Extended Request ID: null)" (RequestToken: da75398a-3185-86af-ccc0-f2e4bef42778, Handle
rErrorCode: GeneralServiceException)
Environment
- **CDK CLI Version :1.116.0 (build d04661d)
 - **Framework Version:1.117.0
 - **Node.js Version:v12.22.4
 - **OS :CentOS Linux release 7.8.2003
 - **Language (Version):TypeScript(3.9.9)
 
Other
This is š Bug Report
About this issue
- Original URL
 - State: closed
 - Created 3 years ago
 - Reactions: 7
 - Comments: 27 (16 by maintainers)
 
well, it looks like itās going to be delayed a few months. I am told by the end of september
@brentryan @RafalSladek @binpatel31 our workaround was to
Despite changing tags with CDK should be super easy, it took us 3 hours to update tags (of our huge stacks) that way. I hope the fix is coming soon. Thre promises for a fix feels like a windows progress bar, which hangs at 99 percent š
Iāve reached out to service team again, will post an update here when possible
Iām told is supposed to still be on track to release by the end of september, hopefully this will come to fruition
For internal service, code changes are done, and testing needs to take place. Hoping for a release by the end of the week
Iāve escalated the issue internally. Been difficult to get an answer - hopefully will have an update soon
Thank you very much for posting a workaround!
I still havenāt received any updates or ETA from the team at this point Iām sorry to say, so I wouldnāt hold out hope for this coming soon
For amazon employees, the ticket is now being tracked here ELMO-58400
@peterwoodworth while we are waiting for a fix, is there any workaround to solve this issue without deleting the stack and recreating it?
hi there we have the same issue, but there was no change to the stack/cdk, multiple deploys of the same code version lead to this error Do we have any solution or workaround for this?