(cli): hotswap should not disable rollback
See original GitHub issueWhat is the problem?
Hi team! Currently when we enable hotswap, it also disables rollback implicitly, which is not desirable at least for me. Here is why:
- Hotswap works without disabling rollback, e.g. by the command:
cdk deploy --hotswap --rollback true
. Then why does the hotswap flag currently have unnecessary and confusing side effect? If we need hotswap and no-rollback, we can just typecdk deploy --hotswap -R
, which is shorter and more explicit. - Hotswap can be enabled at any time whereas rollback must not be disabled in some cases. If we disable rollback when there’s a replacement change, the deploy fails in the middle of deployment, requiring some manual operation to recover from the state. Due to this behavior, we need additional consideration when we disable rollback. That’s why I think rollback shouldn’t be disabled implicitly.
When I develop CDK apps, I always deploy with hotswap. Hotswap is great in that it automatically switch to a normal CFn deploy when there are changes that cannot be hotswapped, thus happy to use it almost brainlessly. However, I must also add --rollback true
because otherwise deploy fails if there’s any replacement change. Unlike hotswap, it won’t switch when it cannot be used. It’d be great if we can just use --hotswap
flag simply without worring about rollback. Actually I sometimes forget to add rollback flag, resulting in a failed deployment.
I’d like to hear your opinion about this, thanks!
Reproduction Steps
run deploy with hotswap enabled
npx cdk deploy --hotswap
What did you expect to happen?
Rollback is enabled as per default since I don’t specify any flags related to it.
What actually happened?
Rollback is disabled. Actually if we need hotswap with rollback, we should have used the command below instead:
npx cdk deploy --hotswap --rollback true
CDK CLI Version
1.129.0
Framework Version
1.129.0
Node.js Version
v14.15.0
OS
macOS
Language
Typescript
Language Version
3.9.7
Other information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (9 by maintainers)
Top GitHub Comments
@eladb agreed. I’ve opened a PR changing this behavior for
--hotswap
: https://github.com/aws/aws-cdk/pull/17317, would appreciate a review.I’ll also make sure the “watch” PR (https://github.com/aws/aws-cdk/pull/17240) is updated to no longer default to rollback being disabled.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.