Skip to content

Various fixes for MWAA verify_env.py script#206

Open
bishtawi wants to merge 2 commits intoawslabs:masterfrom
bishtawi:sb/airflow-fixes
Open

Various fixes for MWAA verify_env.py script#206
bishtawi wants to merge 2 commits intoawslabs:masterfrom
bishtawi:sb/airflow-fixes

Conversation

@bishtawi
Copy link

@bishtawi bishtawi commented Jul 19, 2022

Issue #, if available:

Description of changes:

I was using this verify_env.py script to find issues with my MWAA environment that I brought up and found a few bugs with the script:

  • AWS profile names can contain periods, underscores and dashes
  • An example AWS account id was hardcoded in the script, instead of using the account_id variable
  • The security group ACL check should skip over rules that have their protocol set to 1 (ICMP)
  • The range of test ports had an off by one bug where the last port was not being included
  • The region url query parameter needs to be lowercase for the AWS console to recognize the parameter

And while not technically a bug, I fixed a couple of instances where there was a function could return either a boolean or an empty string. As someone that prefers proper typing, I switched the empty string response to False. I can revert this change if you want.

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

@anapsix
Copy link

anapsix commented Aug 25, 2022

After submitting #208 I've found this one 😅
Do you mind adding . to AWS profile validation regex, and I'll close mine.

Copy link

@josep-pla-jt josep-pla-jt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please commit this fixes, generated urls are wrong and profile names can't have dashes, underscores...

@josep-pla-jt
Copy link

josep-pla-jt commented Feb 22, 2023

On the check_vpc_service_endpoints there's another issue, you're checking if all the subnets of the vpc endpoint match the MWAA subnet ones, should be the opposite, check the MWAA subnets appear in VPC endpoint ones:

vpc_endpoints = [endpoint for endpoint in vpc_endpoints if all(subnet in endpoint['SubnetIds'] for subnet in s_ids)]

If not script is saying endpoints are not in the MWAA environment subnets and that's not true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments