Home > Net >  Terminating AWS Elastic Beanstalk environment and deleting database
Terminating AWS Elastic Beanstalk environment and deleting database

Time:11-17

I want to terminate some environments from Elastic Beanstalk but when I click on terminate environment the following warning appears:

Terminating this environment will also terminate its associated resources.

* URL - name-environment.eu-west-1.elasticbeanstalk.com will be released.

* Additional resources – any resources associated with this environment will also be terminated.

I want to terminate all the environments inside the app ‘App1’ (Region: Ireland) and I want to keep the environments inside the app ‘App2’.

My question is.. Is there a possibility that some of these resources could also be used by other environments? And if this is possible, would I be able to see what environments are using the same resources before terminating the environment?

I also need to delete the database used by the environments that I have to terminate (database ‘staging’) but I need to keep ‘dev-django-db’ and ‘prod-django-db’ databases because they are the databases used by the environments inside the ‘App2’ app.

I can see that all of them share the same VPC and that is why I’m wondering if when I delete the staging database that could affect in any way to the other two databases.

RDS - databases screenshots

CodePudding user response:

The VPC is likely the default VPC for that AWS account and shouldn't be affected by deleting an Elastic Beanstalk app.

If you are intending on keeping any data beyond a short-lived experiment (and certainly in production), it's a good idea to create your RDS databases independently from your Elastic Beanstalk resources. This will ensure that your data isn't tied to the lifecycle of an app/environment. This might mean additional creating/exporting/saving/importing/configuring of database users/credentials for your Django app but will be worth it to save the worry about accidentally deleting a database!

Relevant documentation.

CodePudding user response:

Thanks Blair,

In my case the databases that I'm using for the Django Elastic Beanstalk environments were created outside Elastic Beanstalk then I connected with the environments using inbound rules.

So I guess that if the 'staging' database is removed it should affect the new databases even if they share the default VPC.

What I don't understand very well is how the EC2 instances work and if there is a chance that terminating an environment could eliminate instances that are used in the DB.

  • Related