-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
CloudFormation: POC Support for Modeling of Outputs Blocks in the Update Graph, Improved Handling of Intrinsic Function Types #12443
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
LocalStack Community integration with Pro 2 files 2 suites 20m 33s ⏱️ Results for commit bf29ec7. ♻️ This comment has been updated with latest results. |
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.
👍
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.
The test assertions are not correct. This is the advantage of using snapshot tests.
} | ||
outputs_unit = self.debug_outputs(t1, t2) | ||
assert not outputs_unit.before_context | ||
assert outputs_unit.after_context == [{"Name": "NewParamName", "Value": "NewParam"}] |
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.
This is not correct. The value should be the Name
of the parameter, which is autogenerated by CloudFormation. See the docs. So it should be param-name
.
} | ||
outputs_unit = self.debug_outputs(t1, t2) | ||
assert outputs_unit.before_context == [ | ||
{"Name": "FeatureToggleName", "Value": "FeatureToggle"} |
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.
{"Name": "FeatureToggleName", "Value": "FeatureToggle"} | |
{"Name": "FeatureToggleName", "Value": "app-feature-toggle"} |
In this PR, the outputs are evaluated solely by the describer. Since the POC doesn’t yet include executor logic, we still want to validate that Outputs blocks are being parsed correctly and mapped to the intended resources. Given that, the describer currently reports the entity name as a proxy for this verification. I’d like to keep this logic within the describer for now and plan to move it to the template processor in that very spike, where it can be overridden appropriately by the executor. Does that sound reasonable to you? Alternatively, for this PR, the describer would use that to consistently sample the "Name" property from a resource’s properties (as a stand-in for a proper output reference). Then, in the executor spike, we can override this with the actual evaluation logic tied to Ref resolution. |
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.
Ok fair thanks for the explanation @MEPalma . I am happy there is a path forward, but perhaps can we at least add a comment explaining?
Motivation
The current strategy for modeling CloudFormation templates using the Update Graph does not support changes in Outputs blocks. Additionally, the ChangeSetModel class implements a somewhat tedious approach to visiting and modeling intrinsic function types, due to their natural representation as bindings within dictionaries/objects.
This PR introduces support for modeling changes in Outputs blocks within the Update Graph, along with temporary logic to generate descriptions of those changes. The new functionality is covered by several new unit test cases.
Furthermore, this PR improves the parsing and modeling of intrinsic functions by making more extensive use of the recently introduced TypeDivergence node class.
Several additional issues related to intrinsic parsing and the describe logic are also addressed.
Changes