Unable to create new RDS database on AWS Elastic Beanstalk

After using eb create to create a new environment, I cannot create a new RDS database inside my environment using the AWS console. I needed to select at least two availability zones from a list of four.

Whatever I choose, I get an error:

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

Using the EB CLI with the following 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 an AWS issue?

+5
source share
4 answers

I successfully applied the Django application with this command

eb create --database.engine postgres.

After applying the above command, you will receive an error message

ERROR: Operation completed. The state of the environment is unknown.

after receiving this error you just git add, commit and deploy the eb project. Using this method, I successfully deployed a Django project for AWS my .ebextensions 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 the correct wsgi path and configure the correct RDS configuration in your .py.Then settings add, commit and expand. After that add the configuration below and expand

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" 
+7
source

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

+1
source

As for the fact that you cannot create the database from the Elastic Beanstalk console (your first question), it looks like this is an AWS problem. According to this post , this is a known bug that they hopefully fix.

This seems like a problem with our console with certain types of RDS DB instances. We will work on a fix, but at the same time try a different type of RDS DB instance or use the EB CLI to create your environment using RDS DB. Here is a link to the docs for the EB Create command with the --database option: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html

I tried using several types of instances and could not create it through the console. I finished creating a separate instance of RDS and connected to it. Here is a post that included interesting points about connecting to an existing database.

+1
source

It appears that you may not have created your DBSubnets in AWS.

Have you created your own DBSubnets for all relevant availability zones? as described in step 3 below the link?

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo-vpc-rds.html#AWSHowTo-vpc-rds-subnet

Create DB Subnet Group

  • Open the Amazon RDS console at https://console.aws.amazon.com/rds/ .

  • In the navigation pane, click Subnet groups.

  • Click Create DB Subnet Group.

  • Click Name, and then enter the name of your subnet.

  • Click Description, and then describe your DB subnet group.

  • Next to the VPC ID, select the ID of the created VPC.

  • Click the "Add all subnets in Add Subnet (s)" link to this "Subnet Group" section.

  • When you're done, click "Yes", "Create"
  • In the confirmation window, click "Close."
0
source

Source: https://habr.com/ru/post/1231967/


All Articles