amazon-web-services – 如何在AWS中为Elastic Beanstalk设置应用程序负载均衡器

我正在尝试使用Application Load Balancer创建一个新的ElasticBeanstalk应用程序.我正在调用以下命令:

$mkdir HelloWorld
$cd HelloWorld
$eb init
$echo "Hello World" > index.html
$eb create dev-env --elb-type application

最后一个命令的输出导致此错误:

Creating application version archive “app-170821_175709”.

Uploading HelloWorld/app-170821_175709.zip to S3. This may take a while.

Upload Complete.

ERROR: Configuration validation exception: Invalid option value: ‘null’ (Namespace: ‘aws:ec2:vpc’, OptionName: ‘ELBSubnets’): Specify the subnets for the VPC for load balancer type application.

任何想法我的VPC有什么问题?我正在使用此区域的默认VPC.

更新:
我已经取得了进一步的进展,但仍然无法正确设置ALB.我在我的eb create命令中添加了一些参数:

eb create staging-env --elb-type application --vpc.id vpc-1234604b --vpc.publicip --vpc.ec2subnets subnet-12340aa2 --vpc.elbsubnets subnet-12340aa3,subnet-12341966 --vpc.securitygroup sg-1234ac01 --vpc.elbpublic

但我仍然收到以下错误:

ERROR: Stack named ‘awseb-e-ifnuqgmbah-stack’ aborted operation. Current state: ‘CREATE_FAILED’ Reason: The following resource(s) failed to create: [AWSEBV2LoadBalancer].

ERROR: Creating load balancer named: arn:aws:elasticloadbalancing:us-west-2:123456785170:loadbalancer/app/awseb-AWSEB-Y1OVPGRIAZMD/cc5ce6193af39c0b failed Reason: S3Bucket: staging-bucket is not located in the same region with ELB: app/awseb-AWSEB-Y1OVPGRIAZMD/cc5ce6193af39c0b
“`

最佳答案
通过使用正确的vpc&运行上面的eb create命令,我能够实现这一点.子网设置.

转载注明原文:amazon-web-services – 如何在AWS中为Elastic Beanstalk设置应用程序负载均衡器 - 代码日志