Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create a new RDS database on AWS Elastic Beanstalk

After using eb create to create a new environment, I am unable to create a new RDS database inside my environment using AWS console. It required me to select at least at least two availability zones from a list of four.

whichever I select I get the error:

DBSubnets: Invalid option value: '["subnet-3dbb9564","subnet-b2edb199"]' (Namespace: 'aws:ec2:vpc', OptionName: 'DBSubnets'): Specify the VPC ID and make sure all subnets exist.

Using EB CLI with the following command eb create --database.engine postgres, I get a timeout.

Environment details for: iod-test
  Application name: image_of_day2
  Region: us-east-1
  Deployed Version: 642b
  Environment ID: e-u7q9j5ft2e
  Platform: 64bit Amazon Linux 2015.03 v2.0.1 running Python 2.7
  Tier: WebServer-Standard
  CNAME: iotd-test2.elasticbeanstalk.com
  Updated: 2015-09-21 19:29:37.262000+00:00
Printing Status:
INFO: createEnvironment is starting.
INFO: Using elasticbeanstalk-us-east-1-249541483051 as Amazon S3 storage bucket for environment data.
INFO: Created security group named: sg-7e948419
INFO: Environment health has transitioned to Pending. There are no instances.
INFO: Created security group named: awseb-e-u7q9j5ft2e-stack-AWSEBSecurityGroup-D0EHQ2UNQQWH
INFO: Created Auto Scaling launch configuration named: awseb-e-u7q9j5ft2e-stack-AWSEBAutoScalingLaunchConfiguration-FQZXDALSR4Z6
INFO: Created RDS database security group named: awseb-e-u7q9j5ft2e-stack-awsebrdsdbsecuritygroup-1xo7y4uzxrwgx
INFO: Creating RDS database named: aaaqgf0bktrtyg. This may take a few minutes.

ERROR: The operation timed out. The state of the environment is unknown.

What other options do I have. Is this a problem from AWS side?

like image 514
Cyrus Gorjipour Avatar asked Sep 21 '15 19:09

Cyrus Gorjipour


2 Answers

I deployed Django application successfully using this command

eb create --database.engine postgres.

Once applied the above command you will get an error as follows

ERROR: The operation timed out. The state of the environment is unknown.

after getting this error you just git add,commit and eb deploy the project. Using this method i successfully deployed Django project to AWS my .ebextensions container commands are added below 01_packages.config

packages:
  yum:
    git: []
    libffi-devel: []
    python27-devel: []
    postgresql93: []
    postgresql93-devel: []
    gcc-c++: []

first add the above configuration and set proper wsgi path and set proper RDS configuration in your settings.py.Then add, commit and deploy.After this add the configuration below and deploy

02_python.config

container_commands:
01_migrate:
    command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py migrate --noinput"
    leader_only: true
02_collectstatic:
    command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py collectstatic --noinput"
    leader_only: true
99_runscript:
    command: "source /opt/python/run/venv/bin/activate && python /opt/python/current/app/manage.py runscript init_db"
like image 138
Navajyoth M S Avatar answered Sep 20 '22 22:09

Navajyoth M S


I had the same error message as you when using the EB CLI but upon checking the AWS web console, it seems like the database was successfully created in the environment.

like image 43
ken Avatar answered Sep 19 '22 22:09

ken