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.

Unable to update only Stack description

See original GitHub issue

When adding a stack description (via the cdk.StackProps object and its description parameter), a cdk deploy will not find any changes and will abort stack update. However, a cdk synthesize will generate a YAML file with the correct description and uploading this YAML file via CloudFormation will result in the stack having the new description.

Reproduction steps

  1. mkdir cdk-stack-example (non-existing folder)
  2. cd cdk-stack-example
  3. cdk init --language=typescript
  4. open ./lib/cdk-stack-example-stack.ts and change it to:
export class CdkStackExampleStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, {
      env: {
        account: process.env['AWS_ACCOUNT_ID'],
        region: process.env['AWS_REGION'],
      },
    });
  }
}

I just use the account id and the region as environment variables. 5. cdk deploy (with valid default AWS credentials) 6. Note successfuly deployment of the CloudFormation stack 7. Change the stack code to:

export class CdkStackExampleStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, {
      env: {
        account: process.env['AWS_ACCOUNT_ID'],
        region: process.env['AWS_REGION'],
      },
      description: 'My Stack' // <- this is new!
    });
  }
}
  1. cdk deploy
  2. Note the output is: “CdkStackExampleStack (no changes)” and note that no changes were performend via CloudFormation on the stack
  3. cdk synthesize
  4. note the description is in the synthesized YAML
  5. upload this YAML either via the AWS CLI or via the AWS Web Console and note that the CloudFormation stack now has the description updated/added.

The above example is a stack only with the CDKMetadata custom resource, but the issue also persists with a stack with actual CloudFormation resources.

Also, this issue persists under Linux/Ubuntu. The actual bug was detected in a CI/CD deployment on a shared GitLab CI/CD runner, which performed the CDK calls.

Environment

  • CLI Version : 1.26.0 (build e251651)
  • Framework Version: 1.26.0
  • OS : Windows 10 x64 / Linux Ubuntu x64
  • Language : typescript

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eladbcommented, Mar 1, 2020

I think the problem is that CFN reports that the change set includes no changes (because on resources have changed), so we bail out of the deployment.

Can you please provide verbose log (cdk deploy -v) so I can make sure this is indeed the case?

0reactions
httpdigestcommented, Mar 1, 2020

Yeah, I just tested it with CLI’s cloudformation update-stack and it won’t update the stack either, if only the stack description changed… Somehow, the Web Console does something different when selecting to update a stack (from either an S3 URL location or a direct upload). Updating a stack description from the web console works just fine. Okay, I going to close the issue here, because -as you said- CDK can’t do anything about it, because apparently the AWS API does not expose this functionality.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update CloudFormation stacks stuck in ... - Amazon AWS
1. From the Stack name column, select the stack that's stuck in UPDATE_ROLLBACK_FAILED status. · 2. Choose Stack Actions, and then choose ...
Read more >
Update of CloudFormation stack fails with error
This error may occur when the administrator attempting to update the CloudFormation stack only has account-level access and has not been ...
Read more >
Can't edit CloudFormation stack after failed update?
Sometimes, it gets into an inconsistent state (when given a bad template or when manual changes are made outside of CloudFormation). When this ......
Read more >
update-stack — AWS CLI 2.9.8 Command Reference
For more information about creating an update template, updating a stack, ... Conditional: You must specify only one of the following parameters: ...
Read more >
Modifying a stack template - Amazon CloudFormation
If the values in a mapping aren't being used by your stack, you can't update the mapping by itself. You need to include...
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