Reputation: 1142
I am trying to create an Application Load Balancer using AWS CLI. create-load-balancer
The error message is as follows:
An error occurred (ValidationError) when calling the CreateLoadBalancer operation: At least two subnets in two different Availability Zones must be specified
So I need to get available subnets from a specific zone (ex: us-east-2). How can I get the all available subnets using AWS CLI?
Upvotes: 0
Views: 2339
Reputation: 73
In order to create a new Application Load Balancer you should use the following CLI Command:
aws elbv2 create-load-balancer --name my-load-balancer --subnets SUBNET_1 SUBNET_2
You can get the list of available subnets by analyzing your VPC. To do this please follow these steps:
If you don't have console access for any reason then use this command to get the list of available subnets from the CLI:
aws ec2 describe-subnets
Upvotes: 1