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
CFn: Parametrize Fn::GetAZs test across all regions #10681
base: master
Are you sure you want to change the base?
Conversation
LocalStack Community integration with Pro 2 files ±0 2 suites ±0 1h 35m 59s ⏱️ -47s Results for commit c2651db. ± Comparison against base commit 7917b4a. This pull request removes 1 and adds 8 tests. Note that renamed tests count towards both.
♻️ 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.
Thanks @simonrw for creating this PR and having a fun exploration debugging session 🙌 🚀 The fixes LGTM!
@@ -1005,17 +1003,18 @@ def _deploy( | |||
if role_arn is not None: | |||
kwargs["RoleARN"] = role_arn | |||
|
|||
response = aws_client.cloudformation.create_change_set(**kwargs) | |||
cfn_aws_client = custom_aws_client if custom_aws_client is not None else aws_client |
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.
we can add a comment here stating why was this custom aws client required
cd54f9b
to
f2e4988
Compare
As found by @sannya-singal, there was an attempt to update moto a little while ago which was reverted. |
|
||
try: | ||
client.describe_stream(StreamARN=model["Arn"]) | ||
return ProgressEvent( |
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.
All good with this changes for Kinesis.
We should probably check in future, if we are missing clean up for any other service
): | ||
state = [] | ||
state: list[tuple[str, Callable]] = [] |
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.
Always nice to see more typehints added to project :)
|
||
template_path = os.path.join( | ||
os.path.dirname(__file__), "../../templates/functions_get_azs.yml" | ||
) | ||
|
||
aws_client = aws_client_factory(region_name=region) |
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 logic looks good to me.
We are allowing CFn to use custom client for deployment.
Co-Authored-By: Sannya Singal <[email protected]>
Co-Authored-By: Sannya Singal <[email protected]>
Co-Authored-By: Sannya Singal <[email protected]>
Co-Authored-By: Sannya Singal <[email protected]>
Deletes are asynchronous
f2e4988
to
49aad81
Compare
Motivation
We cannot currently run the
test_get_azs_function
test against any other region but us-east-1 due to snapshot capture, and thedeploy_cfn_template
fixture being locked to the current profile region. We do not get coverage of other regions with this test.Note: the
Fn::GetAZs
intrinsic function must be called with the stack region as its argument, otherwise it returns nothing.Changes
deploy_cfn_template
including standardising the stack deletion process between the automatic fixture cleanup, and theDeployResult.destroy
method, ensuring the correct region is usedtest_get_azs_function
to evaluate all regions. This basically ignores the chosen region for the cross-region tests, but in a sense we gain more coverage as we are testing all regions each time.This PR will fail until the list of AZs per region as been corrected in
moto
./cc @sannya-singal