How to make two environments with an elastic beanstack exchange one database instance

I have a two-medium rail elastic bean gun, staging and production. When creating an application and an intermediate environment with eb init I created a database instance. I used the eb console to create a production environment and created a new database instance which, in my opinion, is clearly wrong.

How to get my two environments to share the same database instance? If this happens, how about when I update the database migration in my application and deploy to the stage; this means that my users would see this because the same database is used by the staging environment.

How to deal with this problem?

I also noticed that git aws.push does not overwrite my database, but does not remove rollback migrations. Am I missing something?

+7
source share
1 answer

I would recommend the following option: Create an rds instance outside the elastic beanstalk environment. Create separate layouts for production and production. Skip the connection strings for your EBS application. A shared rds instance between EBS environments will help you:

  • Lowering the cost of your environment because running multiple instances of rds is expensive.

  • Help you isolate production and intermediate environments.

+4
source

All Articles