question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-elasticache): Update is failing in stacks containing CfnUserGroup after changing Tags

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
peterwoodworthcommented, Jun 20, 2022

well, it looks like it’s going to be delayed a few months. I am told by the end of september

2reactions
peterwoodworthcommented, May 24, 2022

I’ve escalated the issue internally. Been difficult to get an answer - hopefully will have an update soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

class CfnUserGroup (construct) · AWS CDK
The values are placeholders you should change. import * as elasticache from '@aws-cdk/aws-elasticache'; const cfnUserGroup = new elasticache.
Read more >
Cloudformation: update stack error Service: ElastiCache ...
im trying update a large stack that contains several nested stacks, like fargate cluster, ec2 security groups, rds and elasticache-redis.
Read more >
awselasticache - Go Packages
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template). Uses duck-typing instead of `instanceof` to allow...
Read more >
Ensure excessive permissions are not granted for IAM policy
Error : Excessive permissions are granted for IAM policy Bridgecrew Policy ID: ... When creating and changing IAM policies in AWS, we recommend...
Read more >
Why is my AWS CloudFormation stack stuck in progress?
... Knowledge Center article with this video: https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation- stack -stuck-progress...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found