Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you remove an RDS data layer from an Elastic Beanstalk environment

How do you remove an RDS database from an Elastic Beanstalk environment?

There doesn't appear to be an option to do this. I understand I can create an EB environment and have it create an RDS server with it, which we did. Now we just want to get raid of the RDS server by itself but leave the app servers running. I don't see how we're suppose to do this unless I just delete it from the RDS GUI, but I'd think the proper way to do it is remove it from the EB environment.

like image 640
Random5000 Avatar asked Oct 27 '13 05:10

Random5000


People also ask

Does Elastic Beanstalk use RDS?

You can use Elastic Beanstalk with Amazon Relational Database Service (Amazon RDS) to set up, operate, and scale a relational database. There are two options to get started, which are the following. Create a new database in Amazon RDS.


2 Answers

According to this answer on Amazon aws forums:

There is currently no way to remove RDS from an Elastic Beanstalk configuration. You would need to create a new Elastic Beanstalk application configuration that excludes the RDS configuration, launch your app in this new environment, and then change DNS to point to the new environment.

https://forums.aws.amazon.com/message.jspa?messageID=469364

like image 120
João Paulo Motta Avatar answered Oct 11 '22 22:10

João Paulo Motta


It's 2019 and still not possible to remove an RDS database from an Elastic Beanstalk environment. I wish I had known this earlier.

Anyway ... here are the general steps necessary to create a new environment without a managed RDS DB (based on the same thread from the AWS forum):

  1. Create a snapshot of your RDS DB and create a new RDS DB from it. This does not retain the security group, parameter group, or options of your DB. So it might be preferable to create a new empty RDS DB where you can configure everything and then restore the contents from a DB dump like mysqldump.

  2. Save a configuration of your Elastic Beanstalk env and download it from your S3 EBS bucket under resources/templates/<your-app-name>/.

  3. Modify the config to remove all references to RDS, and upload the modified file to your S3 bucket.

  4. Create a new environment from the saved configuration. You should now have an env without a managed RDS DB. Some settings might not be carried over in this process. For example, I had to reconfigure the load balancer for my new env.

  5. Once everything is working in the new env you can use "Swap Environment URLs" or point your DNS record to the new load balancer.

like image 44
Dario Seidl Avatar answered Oct 11 '22 23:10

Dario Seidl