Comments (5)
Hi @jrindy-iterable, thanks for raising this, and welcome to Moto!
We currently support the following filters:
- zone-id
- zone-type
- zone-name
- region-name
I'll mark it as an enhancement to also support the zone-id
/zone-name
parameters and the status
filter.
from moto.
aws --endpoint=http://localhost:5000 ec2 describe-availability-zones --filters Name=zoneid,Values=use1-az4
Note that this doesn't work because of the typo in the name - it does work if you use Name=zone-id
from moto.
Got it. I assumed it was just zoneid due to it being ZoneId in the describe-availability-zones
output. Thanks for the info there @bblommers, I was able to do a filter passing it in as zone-id
.
That being said, I am hopeful that the enhancement will fix the bug I am seeing when using it with Terraform and the aws_availability_zone data source. Sample code here for reproduction with the providers.tf just pointing ec2 to moto-server:
# providers.tf
provider "aws" {
region = "us-east-1"
s3_use_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
endpoints {
ec2 = "http://localhost:5000"
}
access_key = "my-access-key"
secret_key = "my-secret-key"
}
# main.tf
data "aws_availability_zone" "test_id" {
zone_id = "use1-az1"
filter {
name = "state"
values = ["available"]
}
}
data "aws_availability_zone" "test_name" {
name = "us-east-1b"
filter {
name = "state"
values = ["available"]
}
}
This results in the following errors with Terraform:
Error: multiple EC2 Availability Zones matched; use additional constraints to reduce matches to a single EC2 Availability Zone
│
│ with data.aws_availability_zone.test_id,
│ on az.tf line 1, in data "aws_availability_zone" "test_id":
│ 1: data "aws_availability_zone" "test_id" {
│
╵
╷
│ Error: multiple EC2 Availability Zones matched; use additional constraints to reduce matches to a single EC2 Availability Zone
│
│ with data.aws_availability_zone.test_name,
│ on az.tf line 9, in data "aws_availability_zone" "test_name":
│ 9: data "aws_availability_zone" "test_name" {
Thanks so much in advance for your help!
from moto.
@jrindy-iterable I've just ran your TF example, and the attached PR does indeed fix that problem.
It is now part of moto >= 4.2.12.dev20. Let us know if you run into any other issues!
from moto.
I swapped my compose to latest and gave it a try and it is filtering the AZ as expected now. Thanks again!
from moto.
Related Issues (20)
- Unit tests for boto3 client('bedrock-runtime') HOT 1
- ELBV2 describe_target_health on deregistered target should return a state of "unused" instead of "unavailable" HOT 2
- DynamoDB: Need methods to put/get/delete policy on table
- iot-data: shadow state delta is backward
- events.create_connection does not create secret HOT 1
- Unable to easily mock Athena result CSV HOT 3
- Feature - Add basic support for Network Manager. Global and Core Networks HOT 1
- S3: Configure the MaxKeys limit (list_objects/list_objects_v2) using an env variable
- Cognito-Idp: I see 'code_delivery_details' is nil when signingUp.
- IAM - create_policy returns bad tags HOT 1
- DynamoDB query with GSI doesn't return LastEvaluatedKey when paging moto 5.0.4 and later HOT 3
- No validationError raised on multiple "SET" operators in UpdateExpression HOT 1
- Infinite recursion error with moto 5.0.8 HOT 4
- RDS Clusters: Setting default values HOT 1
- EC2 DescribeRouteTables filter 'route.transit-gateway-id' not implemented HOT 3
- Error when I try to use scaffolding to create shield HOT 3
- Unable to create rds cluster HOT 1
- SSM.Client.get_parameter() by ARN instead of Name fails with ParameterNotFound
- DynamoDB Table query GSI with ExclusiveStartKey missing the primary key does not raise a ClientError
- EventBridge targets are not identified by moto when parsing cloudformation file.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moto.