Skip to content

chore(toolkit-lib): recommend to use drift aware change sets when deploying to Cloudformation after hotswapping#1467

Merged
aws-cdk-automation merged 8 commits intomainfrom
use-drift-aware-after-hotswap
May 4, 2026
Merged

chore(toolkit-lib): recommend to use drift aware change sets when deploying to Cloudformation after hotswapping#1467
aws-cdk-automation merged 8 commits intomainfrom
use-drift-aware-after-hotswap

Conversation

@ShadowCat567
Copy link
Copy Markdown
Contributor

@ShadowCat567 ShadowCat567 commented May 1, 2026

Drift aware change sets take into account current resource state when making a changeset and will not make changes if the new template and the resource state align, otherwise will prefer changes from the new template.
When recovering from hotswap deployments, drift aware changesets will do a better job of getting your Cloudformation state and your current resource state back into sync than a regular Cloudformation deployment (using changesets or update stack) would. Adds a message in the CLI that recommends to use drift aware changesets when deploying to Cloudformation after performing hotswap deployments.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions Bot added the p2 label May 1, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team May 1, 2026 19:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.10%. Comparing base (9f872c9) to head (ef181ff).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1467   +/-   ##
=======================================
  Coverage   88.10%   88.10%           
=======================================
  Files          74       74           
  Lines       10669    10669           
  Branches     1457     1457           
=======================================
  Hits         9400     9400           
  Misses       1241     1241           
  Partials       28       28           
Flag Coverage Δ
suite.unit 88.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

aws-amplify-bot added 3 commits May 1, 2026 16:13
);

if (hotswapDeploymentResult) {
if (deploymentMethod.fallback) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true even if we never do the fallback ourselves.

As soon as we hotswap we have introduced drift, and we should print "next non-hotsweap deployment should include --revert-drift".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do a fallback deployment WITHOUT --revert-drift, then that's an entirely different problem :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants