Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EC2: fix describe-availability-zones filtering #12661

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

Merged
merged 1 commit into from
May 27, 2025

Conversation

anisaoshafi
Copy link
Contributor

@anisaoshafi anisaoshafi commented May 26, 2025

Motivation

Customer reported some issue trying to run a tf script where they were getting this error: Error: no matching EC2 Availability Zone found.
The reason for that is that this operation implementation in the ec2 provider.py filters doesn't work against moto, resulting into an empty list.

image

More context in the notion ticket.

Changes

Change how filters are passed for the call done to moto.
Added aws validated tests.
test_describe_availability_zones_filter_with_zone_names fails against LS with the old code, and passes now.

@anisaoshafi anisaoshafi added aws:ec2 Amazon Elastic Compute Cloud semver: patch Non-breaking changes which can be included in patch releases labels May 26, 2025
@anisaoshafi anisaoshafi self-assigned this May 26, 2025
@anisaoshafi anisaoshafi added this to the 4.5 milestone May 26, 2025
Copy link

github-actions bot commented May 26, 2025

LocalStack Community integration with Pro

 2 files  ±    0   2 suites  ±0   46s ⏱️ - 1h 42m 5s
31 tests  - 4 434  29 ✅  - 4 047  2 💤  - 387  0 ❌ ±0 
33 runs   - 4 434  29 ✅  - 4 047  4 💤  - 387  0 ❌ ±0 

Results for commit a3ad991. ± Comparison against base commit bae7a0e.

This pull request removes 4437 and adds 3 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.ec2.test_ec2 ‑ test_describe_availability_zones_filter_with_zone_ids
tests.aws.services.ec2.test_ec2 ‑ test_describe_availability_zones_filter_with_zone_names
tests.aws.services.ec2.test_ec2 ‑ test_describe_availability_zones_filters

♻️ This comment has been updated with latest results.

@anisaoshafi anisaoshafi force-pushed the fix-ec2-descibe-availability-zones branch from d8c0912 to 0a1d355 Compare May 26, 2025 14:34
@anisaoshafi anisaoshafi marked this pull request as ready for review May 26, 2025 14:35
Copy link

github-actions bot commented May 26, 2025

Test Results - Preflight, Unit

21 579 tests  ±0   19 927 ✅ ±0   6m 9s ⏱️ +2s
     1 suites ±0    1 652 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit a3ad991. ± Comparison against base commit bae7a0e.

♻️ This comment has been updated with latest results.

@anisaoshafi anisaoshafi marked this pull request as draft May 26, 2025 14:44
Copy link

github-actions bot commented May 26, 2025

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 11s ⏱️ -7s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit a3ad991. ± Comparison against base commit bae7a0e.

♻️ This comment has been updated with latest results.

@anisaoshafi anisaoshafi force-pushed the fix-ec2-descibe-availability-zones branch from 0a1d355 to a3ad991 Compare May 26, 2025 14:56
Copy link

Test Results - Alternative Providers

597 tests   419 ✅  14m 59s ⏱️
  4 suites  178 💤
  4 files      0 ❌

Results for commit a3ad991.

@anisaoshafi anisaoshafi marked this pull request as ready for review May 26, 2025 15:21
Copy link

github-actions bot commented May 26, 2025

Test Results (amd64) - Integration, Bootstrap

    5 files  ±0      5 suites  ±0   2h 21m 22s ⏱️ +38s
4 823 tests +3  4 281 ✅ +3  542 💤 ±0  0 ❌ ±0 
4 829 runs  +3  4 281 ✅ +3  548 💤 ±0  0 ❌ ±0 

Results for commit a3ad991. ± Comparison against base commit bae7a0e.

♻️ This comment has been updated with latest results.

@anisaoshafi
Copy link
Contributor Author

anisaoshafi commented May 26, 2025

Update: After a few retries that unrelated flaky test passed.

FYI: The ci check failure is unrelated to these changes: this test is failing: test_sqs_event_source_mapping_batch_size_override.
image

Copy link
Member

@viren-nadkarni viren-nadkarni left a comment

Choose a reason for hiding this comment

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

A nice clean fix, LGTM!

@anisaoshafi anisaoshafi merged commit 433aeff into master May 27, 2025
98 of 100 checks passed
@anisaoshafi anisaoshafi deleted the fix-ec2-descibe-availability-zones branch May 27, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:ec2 Amazon Elastic Compute Cloud semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants