-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
CFNV2: Switch provider defaults to new engine #13098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test Results (amd64) - Integration, Bootstrap 5 files ±0 5 suites ±0 2h 34m 9s ⏱️ + 13m 27s Results for commit 1b454ad. ± Comparison against base commit 9043813. This pull request removes 1 test.♻️ This comment has been updated with latest results. |
Test Results (amd64, MA/MR) - Integration, Bootstrap 5 files ±0 5 suites ±0 2h 34m 29s ⏱️ + 12m 42s Results for commit 1b454ad. ± Comparison against base commit 9043813. This pull request removes 1 test.♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ±0 2 suites ±0 1h 55m 45s ⏱️ + 11m 44s Results for commit 1b454ad. ± Comparison against base commit 9043813. This pull request removes 1 test.♻️ This comment has been updated with latest results. |
1c80c27 to
3167d52
Compare
5ef40c3 to
7e45ad4
Compare
k-a-il
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see the new CloudFormation engine, kudos to the team! 🚀
pinzon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a journey, so thankful to have been part of this project! 😃
Motivation
For a very long time, the LocalStack CloudFormation engine has been frustrating to use. In particular it did not correctly the resource update process. This lead to the common advice of "restart LocalStack" if you want to make a change to your stack.
LocalStack excels at providing a local first experience, particularly for devops and IaC with its ability to emulate the cloud locally. However with larger stacks or regular changes being required, it was a slow and frustrating experience needing to regularly restart LocalStack because CloudFormation resources did not update.
This PR finishes a long journey implementing the internals (the "engine") of CloudFormation with a focus on correctness, parity with AWS and modelling which resources are and are not updated.
The new engine models the changes to a stack as a whole, rather than attempting to work out which resources should and should not be updated as an operation that requires two static and poorly defined templates. We strongly type the concepts of a pair of stacks and build an internal representation that can be traversed, or "visited".
We primarily achieve this with
ChangeSetModelwhich is a visitor over a pair of templates, and constructsUpdateModelour internal representation (a graph) of the templates, where each node in the graph has aChangeTyperepresenting if it isUnchangedCreatedModifiedDeletedUpdateModeland through depth first search perform one of a few operations:flowchart TD ChangeSetModelVisitor --> ChangeSetModelPreproc ChangeSetModelPreproc --> ChangeSetModelTransformer ChangeSetModelPreproc --> ChangeSetModelValidator ChangeSetModelPreproc --> ChangeSetModelDescriber ChangeSetModelPreproc --> ChangeSetModelExecutorWhere the previous engine would order resources based on their dependencies (topological sort) and hope that the resources deployed correctly, this engine visits the update model in a depth first order and therefore fully resolves resource dependencies (such as intrinsic function calls) before deploying parent resources.
This new engine passes all of the current (now legacy) engine's tests, and passes over 100 parity tests that the legacy engine does not.
Tip
Should you experience issues with this new engine, please submit a bug report. You can continue to opt in to using the legacy engine by setting
PRs that contributed to this change
A huge thanks to @MEPalma , @pinzon and @dominikschubert for collaborating on this work 🎉
Changes
engine-v2Test CloudFormation Engine legacystep