Skip to content

(aws-cdk): changeset fails with Description attribute mismatch #14316

@shellscape

Description

@shellscape

Upon deploying a stack which has not seen any changes to the local CDK code via cdk deploy, we receive a message of:

ChangeSet cdk-deploy-change-set cannot be created due to a mismatch with existing attribute Description

My first stop was to synth and output the template for the failing stack. The template only had one resource which had a Description field. The value in the template matched perfectly to what had been in the code for some time prior, and the Description on the resource in the AWS Console.

Next, I went into the CloudFormation Stack for the failing stack and took a look at the changesets. For each of our failing stacks, there was a pending changeset. Each changeset had JSON changes which looked like this:

[
  {
    "resourceChange": {
      "logicalResourceId": "CDKMetadata",
      "action": "Modify",
      "physicalResourceId": "6fffac30-9bfd-11eb-9c43-0e0748486565",
      "resourceType": "AWS::CDK::Metadata",
      "replacement": "Conditional",
      "moduleInfo": null,
      "details": [
        {
          "target": {
            "name": "Analytics",
            "requiresRecreation": "Conditionally",
            "attribute": "Properties"
          },
          "causingEntity": null,
          "evaluation": "Static",
          "changeSource": "DirectModification"
        }
      ],
      "changeSetId": null,
      "scope": [
        "Properties"
      ]
    },
    "hookInvocationCount": null,
    "type": "Resource"
  }
]

My initial thought was to delete the pending changesets for the failing services, thinking that maybe they were left over from some interrupted deploy and were causing the conflict. Deleting the changesets just resulted in new pending changesets from subsequent deploy attempts.

Next, I figured I would manually execute the changesets in the failing stacks to see what happened. Every changeset in every failing stack, suffering from the error above, executed successfully when triggered manually in the AWS Console. After manually executing, all failing stacks succeeded with (no changes) in their success messages via cdk deploy

The only possible correlation that I could find in the code here was:

Description: `CDK Changeset for execution ${executionId}`,

Other than that, I'm at a loss.

Reproduction Steps

I'm honestly not sure how to reproduce this. After we initially solved the problem by manually executing the changesets, everything seemed to work as expected.

What did you expect to happen?

Successful deploys.

What actually happened?

Please see above

Environment

  • CDK CLI Version : 1.98.0
  • Framework Version: 1.98.0
  • Node.js Version: 14.15.3
  • OS : MacOS
  • Language (Version): TS 4.1.3

Other


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions