aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code

Home Page:https://aws.amazon.com/cdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli: disable no-rollback automatically when a changeset includes replacement type updates

tmokmss opened this issue · comments

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

Thanks for reaching out with this request @tmokmss . Marking it appropriate for team's input.