-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
CFnV2: GetAtt function searches first into resource results #13280
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 - Alternative Providers584 tests 330 ✅ 25m 54s ⏱️ Results for commit 6620515. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 49m 16s ⏱️ Results for commit 6620515. ♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 36m 54s ⏱️ - 1h 21m 55s Results for commit 6620515. ± Comparison against base commit aba1ee8. This pull request removes 4293 tests.♻️ This comment has been updated with latest results. |
f93e89d to
fef2a9b
Compare
fef2a9b to
4656c18
Compare
simonrw
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.
Looks great, just a minor suggestion on coding style
| resource_logical_id=logical_name_of_resource, | ||
| property_name=attribute_name, | ||
| ) | ||
|
|
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.
suggestion: perhaps consider an early return here - I think it is clearer to return the value found and not continue with the rest of the function implementation.
Motivation
A special case in the CloudFormation service is the ability of Custom Resources to self-modify via their outputs. For instance, if a custom resource has a property called Value and its output also includes a property called Value, the GetAtt function should resolve to the computed value.
This PR modifies the engine to first check the resource’s resulting model from the provider, and only then fall back to the template. This ensures that if a custom resource updates its own state, the template engine can retrieve the new value, while still using the original template value as a fallback when needed.
Changes
Testing