Skip to content

cli: --no-rollback and a changeset that includes replacement type updates causes a failed deployment #30546

@tmokmss

Description

@tmokmss

Describe the feature

CDK should automatically disable no-rollback flag when a change set to deploy contains a replacement type updates. Otherwise the deployment fails and it leaves the stack in a non-terminal state, which does not allow updating stack any more without resetting the state.

Use Case

I'm always frustrated when I accidentally deploy a change with no-rollback flag enabled, and the deployment fails after a while because it contains replacement type updates.

Proposed Solution

CDK CLI uses CFn changeset feature to deploy a change, so it knows whether the change contains any replacement. If there is, it should automatically disable no-rollback flag.

Or we should at least validate the flag before actually executing a CFn deployment.

Other Information

The error we get when deploying a change with no-rollback flag and replacement change:

Replacement type updates not supported on stack with disable-rollback.

The error we get when deploying a change after a deployment failed due to the above error.

This stack is currently in a non-terminal [UPDATE_FAILED] state. To update the stack from this state, please use the disable-rollback parameter with update-stack API. To rollback to the last known good state, use the rollback-stack API

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.145.0

Environment details (OS name and version, etc.)

macOS

Metadata

Metadata

Assignees

Labels

@aws-cdk/coreRelated to core CDK functionalitycliIssues related to the CDK CLIeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1package/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