0
votes

I would like to setup my application to work on Elastic beanstalk in VPC which would access rds in same subnet. Here is my .ebextensions/conf.config file:

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"

I configured security groups to allow traffic from all:

{
    "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"
        }
    ]
}

And see following error:

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.

At the same time I can successfully create ec2 instance in that vpc and subnet and it works perfectly.

What did I miss?

1

1 Answers

0
votes

Likely because the rpm package:

https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-ami201503-95-9.5-2.noarch.rpm

Is no longer there. If you log into the instance and check the file:

/var/log/eb-commandprocessor.log

You can see the results of your custom .ebextensions commands.