【发布时间】:2017-01-29 23:20:33
【问题描述】:
我想将我的应用程序设置为在 VPC 中的 Elastic beanstalk 上工作,这将访问同一子网中的 rds。 这是我的 .ebextensions/conf.config 文件:
option_settings:
aws:ec2:vpc:
VPCId: "vpc-aaaaaaaa"
Subnets: "subnet-zzzzzzzz"
aws:autoscaling:launchconfiguration:
InstanceType: m1.small
SecurityGroups: "sg-xxxxxxxx"
EC2KeyName: provisioner
aws:elb:loadbalancer:
SecurityGroups: "sg-yyyyyyyy"
aws:elasticbeanstalk:application:environment:
NODE_ENV: development
commands:
01_command:
command: "rpm -i https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-ami201503-95-9.5-2.noarch.rpm"
02_command:
command: "yum install postgresql95-devel -y"
我将安全组配置为允许来自所有人的流量:
{
"SecurityGroups": [
{
"IpPermissionsEgress": [
{
"IpProtocol": "-1",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"UserIdGroupPairs": [],
"PrefixListIds": []
}
],
"Description": "Security group for API server in EBS",
"IpPermissions": [
{
"PrefixListIds": [],
"FromPort": 0,
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"ToPort": 64000,
"IpProtocol": "tcp",
"UserIdGroupPairs": []
}
],
"GroupName": "api_ebs_dev",
"VpcId": "vpc-aaaaaaaa",
"OwnerId": "092511111111",
"GroupId": "sg-xxxxxxxx"
},
{
"IpPermissionsEgress": [
{
"IpProtocol": "-1",
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"UserIdGroupPairs": [],
"PrefixListIds": []
}
],
"Description": "Security group for API ELB",
"IpPermissions": [
{
"PrefixListIds": [],
"FromPort": 0,
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"ToPort": 64000,
"IpProtocol": "tcp",
"UserIdGroupPairs": []
}
],
"GroupName": "api_lb_dev",
"VpcId": "vpc-aaaaaaaa",
"OwnerId": "09251111111",
"GroupId": "sg-yyyyyyyy"
}
]
}
并看到以下错误:
2016-09-21 14:20:03 INFO Added instance [i-d206f766] to your environment.
2016-09-21 14:30:02 WARN Environment health has transitioned from Pending to Severe. Initialization in progress (running for 12 minutes). None of the instances are sending data. ELB health is failing or not available for all instances.
2016-09-21 14:35:43 ERROR 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.
2016-09-21 14:35:46 ERROR Stack named 'awseb-e-5sccvbi2wa-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBInstanceLaunchWaitCondition].
2016-09-21 14:35:49 INFO Launched environment: devtest. However, there were issues during launch. See event log for details.
同时,我可以在该 vpc 和子网中成功创建 ec2 实例,并且运行良好。
我错过了什么?
【问题讨论】:
标签: amazon-web-services amazon-elastic-beanstalk