[英]How to get available subnets from AWS VPC?
I am trying to create an Application Load Balancer using AWS CLI. 我正在尝试使用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). 因此,我需要从特定区域(例如:us-east-2)获取可用的子网。 How can I get the all available subnets using AWS CLI?
如何使用AWS CLI获取所有可用的子网?
In order to create a new Application Load Balancer you should use the following CLI Command: 为了创建新的应用程序负载平衡器,您应该使用以下CLI命令:
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. 您可以通过分析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: 如果由于某种原因没有控制台访问权限,请使用以下命令从CLI获取可用子网的列表:
aws ec2 describe-subnets
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.