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)
- Proxy mode doesn't work on Windows HOT 3
- SESV2: send_email() doesn`t return MessageId HOT 2
- DynamoDb transact write items errors for Update expression multiple set action HOT 2
- application-autoscalin.put_scheduled_action are incorrectly overwritten
- DynamoDB transact write items update throws without expression attribute names HOT 1
- Step function creation does not work with Retry conditions specifying MaxAttempts equal 0 HOT 1
- Step function execution incorrectly errors when using JSONPath query syntax
- Step function creation errors when using specific IAM roles within steps
- SQS: get_queue_by_name does not raise QueueDoesNotExist exception when queue does not exist HOT 1
- DynamoDB sorts by Table hash before GSI when comparing ExclusiveStartKey
- Creating aws_db_proxy resources with a engine_family of POSTGRESQL fails validation
- S3: Not throwing an exception with a Deny bucket policy for s3:PutObject HOT 1
- DirectConnect support
- Dynamo DB - Cannot use ARN in place of TableName across multiple methods
- Network Manager: Add additional endpoints for Sites, Links & Devices HOT 1
- KMS mocking fails with AccessDenied in subsequent tests when trying to decrypt
- Moto doesn't support mock cloudformation which has a lambda resource deployed as container
- CloudFormation Stack parameters don't update when UsePreviousValue is set to False
- ACM: Export Certificate permits exporting unexportable certificates
- DynamoDB: Wrong results for paginated query using a GSI HOT 1
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.