-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactoring of removal of AWS::NoValue in reference list for CFn #12288
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
refactoring of removal of AWS::NoValue in reference list for CFn #12288
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 21m 19s ⏱️ - 1h 31m 59s Results for commit 5a21a8f. ± Comparison against base commit 5d463b5. This pull request removes 3679 tests.
♻️ This comment has been updated with latest results. |
You mention in your PR description:
Only if we have examples where we use this functionality in CFn templates, right?
Let's make sure we do a manual run of the pro tests to be sure |
44100c8
to
f8b5d1a
Compare
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.
Thanks for proving the change is valid in -ext. This change looks good to me, a nice simplification stripping out the values in the list type before it makes it to the intrinsic function call!
@@ -756,8 +753,10 @@ def _resolve_refs_recursively( | |||
{inner_list[0]: inner_list[1]}, | |||
) | |||
|
|||
# remove _aws_no_value_ from resulting references | |||
clean_list = [] | |||
for i in range(len(value)): |
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.
nit: this no longer needs to be a list over the indices
for i in range(len(value)): | |
for item in value: |
@@ -756,8 +753,10 @@ def _resolve_refs_recursively( | |||
{inner_list[0]: inner_list[1]}, | |||
) | |||
|
|||
# remove _aws_no_value_ from resulting references | |||
clean_list = [] |
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.
Thank you for writing the longer (but easier to understand) loop manually building up a new list, rather than some horribly complex list comprehension!
Motivation
As discovered by a customer. CFn should remove the AWS::NoValue from list of references when pasing such list as as an Attribute Value for a resource definition.
Example. In the following code, CFn should remove the AWS::NoValue from the list of RouteTableIds before attempting to create the resource.
The previous solution (#12163) only managed to fix this for
Fn::Join
list parameter. With the new changes, the fix is applied to any referenced list.Changes
No testing