我在我创建的 VPC 内启动 Elastic Beanstalk 应用程序时遇到问题。
我的 VPC 如下所示:
id: vpc-a1b
name: vpc-green
cidr: 10.0.0.0/16
route table: rtb-1ab
acl: acl-123
我有 6 个子网:
vpc-green-public-us-east-2a (rt: vpc-green-rt-public)
vpc-green-public-us-east-2b (rt: vpc-green-rt-public)
vpc-green-public-us-east-2c (rt: vpc-green-rt-public)
vpc-green-private-us-east-2a (each has its own rt)
vpc-green-private-us-east-2b
vpc-green-private-us-east-2c
路由表:
vpc-green-rt-public
10.0.0.0/16 local
0.0.0.0/0 igw-123
vpc-green-rt-private-us-east-2a
10.0.0.0/16 local
0.0.0.0/0 nat-001
互联网网关:
vpc-green-igw
访问控制列表(ACL):
vpc-green-acl
inbound:
100 ALL/All/All 0.0.0.0/0 ALLOW
* All/All/All 0.0.0.0/0 DENY
outbound:
100 ALL/All/All 0.0.0.0/0 ALLOW
* All/All/All 0.0.0.0/0 DENY
associated subnets: all 6 (public and private)
安全组:
vpc-green-default
inbound:
All/All/All sg-a123 (self)
outbound:
All/All/All 0.0.0.0/0
vpc-green-web
inbound:
tcp, 80, 0.0.0.0/0
tcp, 443, 0.0.0.0/0
icmp, All, 0.0.0.0/0
all, all, all, 0.0.0.0/0
outbound:
UDP, 123, 0.0.0.0/0
all/all/all, 0.0.0.0/0
EB-Load-balancer
inbound:
tcp, 80, 0.0.0.0/0
outbound:
tcp, 80, 0.0.0.0/0
EB-VPC-Security
inbound:
tcp, 80, source=EB-load-balander
outbound:
all, all, 0.0.0.0/0
ElasticBeanstalk 创建的实际 ec2 实例如下所示:
t2.small
security groups:
vpc-green-web
EB-VPC-Security
subnet:
one of my public subnets (vpc-green-public-us-east-2a)
EB 创建的负载均衡器如下所示:
security groups:
EB-load-balancer
subnet:
one of my public subnets (vpc-green-public-us-east-2a)
我收到错误:
The EC2 instances failed to communicate with AWS Elastic Beanstalk, either because of configuration problems with the VPC or a failed EC2 instance. Check your VPC configuration and try launching the environment again.
Stack named 'awseb-e-xxxxx-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].
这里有一个帮助页面:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/events.common.connectivity.html
它说“...这意味着 Amazon EC2 实例未向 Elastic Beanstalk 传达它们已成功启动的信息。“
根据以上信息,问题到底是什么?
我不确定如何修复它,因为在我看来它看起来很好。
如果我访问 EB 生成的 URL,它不起作用:
xxxxx.us-east-2.elasticbeanstalk.com is currently unable to handle this request.
答案1
所以问题最终是我的 VPC 设置中的 DNS 主机名和支持未设置为 True。
今天,AWS 支持已收回成本!