awslabs / aws-support-tools

Tools and sample code provided by AWS Premium Support.
https://aws.amazon.com/premiumsupport/
Apache License 2.0
1.45k stars 798 forks source link

Update MWAA verify_env.py to support new partitions #218

Closed Mercury2699 closed 1 year ago

Mercury2699 commented 1 year ago

Description of changes:

MWAA Launched in China regions BJS and ZHY in mid May 2023. But this helper script doesn't work properly because if the region is specified to china, we will get Invalid Region exception. The issue was that china regions are not returned in the call to get_available_regions. From the implementation of that function, we can see that partition_name='aws' is the default value, and we need to specify a partition for China aws-cn. We can use get_partition_for_region to get the correct partition for each region input, and then this script can work normally.

Some more changes were made to account for the domain name difference in the china partition.

Tested on a fresh environment in BJS region.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.