如何在AWS中为Elastic Beanstalk设置Application Load Balancer [英] How to setup Application Load Balancer for Elastic Beanstalk in AWS
问题描述
我正在尝试使用Application Load Balancer创建一个新的ElasticBeanstalk应用程序.我正在调用以下命令:
I'm trying to create a new ElasticBeanstalk application with an Application Load Balancer. I'm calling the following commands:
$ mkdir HelloWorld
$ cd HelloWorld
$ eb init
$ echo "Hello World" > index.html
$ eb create dev-env --elb-type application
最后一条命令的输出导致此错误:
Output of the last command results in this error:
创建应用程序版本归档文件"app-170821_175709".
Creating application version archive "app-170821_175709".
将HelloWorld/app-170821_175709.zip上载到S3.这可能需要一段时间.
Uploading HelloWorld/app-170821_175709.zip to S3. This may take a while.
上传完成.
错误:配置验证异常:无效的选项值:'null'(名称空间:'aws:ec2:vpc',OptionName:'ELBSubnets'):为负载均衡器类型的应用程序指定VPC的子网.
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.
Any ideas what is wrong with my VPC? I am using the default VPC for this region.
UPDATE :
我已经取得了进一步的进步,但是仍然无法正确设置ALB.我在eb create
命令中添加了一些参数:
UPDATE:
I've made further progress, but am still not able to get the ALB set up correctly. I've added a few parameters to my eb create
command:
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
但是我仍然遇到以下错误:
But I'm still getting the following error:
错误:名为"awseb-e-ifnuqgmbah-stack"的堆栈中止了操作.当前状态:"CREATE_FAILED"原因:无法创建以下资源:[AWSEBV2LoadBalancer].
ERROR: Stack named 'awseb-e-ifnuqgmbah-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBV2LoadBalancer].
错误:创建负载均衡器,名称为:arn:aws:elasticloadbalancing:us-west-2:123456785170:loadbalancer/app/awseb-AWSEB-Y1OVPGRIAZMD/cc5ce6193af39c0b失败原因:S3Bucket:分段存储桶不在同一区域使用ELB:app/awseb-AWSEB-Y1OVPGRIAZMD/cc5ce6193af39c0b ```
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&子网设置.
I was able to get this working by running the eb create
command above with the correct vpc & subnet settings.
这篇关于如何在AWS中为Elastic Beanstalk设置Application Load Balancer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!