Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(aws): get regions by partition #5748

Merged

Conversation

pedrooot
Copy link
Member

Description

This pull request introduces improvements to the get_aws_available_regions function in the prowler/providers/aws/aws_provider.py file, adding support for filtering by AWS partition. Additionally, it includes new tests to verify the functionality of this enhancement.

Enhancements to get_aws_available_regions function:

  • prowler/providers/aws/aws_provider.py: Modified get_aws_available_regions to accept an optional partition parameter, allowing the function to filter available regions by the specified AWS partition.

New tests for partition filtering:

  • tests/config/config_test.py: Added test_get_aws_available_regions_with_partition and test_get_aws_available_regions_with_unknown_partition to verify the function's behavior when a specific partition is provided and when an unknown partition is provided.
  • tests/providers/aws/aws_provider_test.py: Added test_get_aws_available_regions_with_partition and test_get_aws_available_regions_with_unknown_partition to ensure the function correctly handles known and unknown partitions, using mocked data for testing.

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@pedrooot pedrooot requested review from a team as code owners November 13, 2024 12:05
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Nov 13, 2024
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.91%. Comparing base (5641160) to head (dac26c3).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5748      +/-   ##
==========================================
+ Coverage   89.83%   89.91%   +0.07%     
==========================================
  Files        1128     1128              
  Lines       35154    35170      +16     
==========================================
+ Hits        31582    31623      +41     
+ Misses       3572     3547      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

prowler/providers/aws/aws_provider.py Outdated Show resolved Hide resolved
prowler/providers/aws/aws_provider.py Outdated Show resolved Hide resolved
prowler/providers/aws/aws_provider.py Outdated Show resolved Hide resolved
prowler/providers/aws/aws_provider.py Outdated Show resolved Hide resolved
prowler/providers/aws/aws_provider.py Outdated Show resolved Hide resolved
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

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

🚀

@jfagoagas jfagoagas merged commit a419b4b into master Nov 13, 2024
11 checks passed
@jfagoagas jfagoagas deleted the PRWLR-5350-aws-add-a-way-to-get-the-regions-by-partition branch November 13, 2024 17:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants