1. 1

We run an app on elastic beanstalk, and EB is set up to manage an RDS Postgres instance. Is it possible to break this relationship, so that we start managing the RDS instance manually through the RDS console?

Our motivation for this is that we want to upgrade our Docker environment to a version that supports the new Health dashboard. We would need to do this without downtime. We cannot currently do a CNAME Swap, because EB manages our RDS instance. The reason is described here:

Although using Elastic Beanstalk to attach an Amazon RDS database to your environment can help you avoid downtime in accessing your application, you might lose data during the CNAME swap process. This can happen as the application continues to generate data between the time the original database is deleted and a new database becomes available for the new environment. Taking a snapshot of the original database (as recommended in the instructions that follow) only saves some data because the snapshot will not contain any newly generated data.

To avoid that, manage your Amazon RDS database from the Amazon RDS console, CLI, or API instead of Elastic Beanstalk. That way, the database is unaffected by what you do to your Elastic Beanstalk environments. If you manage the database using Amazon RDS instead of managing it using Elastic Beanstalk, during a CNAME swap from one environment to another, the original environment continues to read from and write to the existing database until you delete the environment. When traffic stops flowing to the database after the CNAME swap, you can delete the original environment without losing data.

We haven’t found a simple way to break the EB+RDS connection. Is there one (this suggests not), or do we have to do this elaborate dance:

  1. Create DB read-replica (db-prime)
  2. Create new EB deployment (call it app-prime) of app, which does not manage RDS
  3. Point app-prime at db-prime
  4. Put app in READ_ONLY_MODE
  5. Wait for replication to catch up, then promote db-prime to stand-alone master
  6. Do CNAME Swap between app and app-prime
  7. Terminate old app

At a minimum, that will make our app read-only after step 4, until step 6 is completed. We may be able to accept that, but I’d really love to know if there’s an easier way.


  2. 1

    I intended to ask this on AWS forums, but I keep getting an error message saying “Your message quota has been reached. Please try again later.” which is a bit silly since I just signed up today and never having posted anything there :-)

    1. 1

      Seems like an AWS specific thing, I would recommend engaging their support about this.

      1. 1

        Yeah… Unfortunately their support plan is not something we currently pay for, and as my other comment mentions for some reason I’m not allowed to post in their support forums. (Perhaps the two are related? Do you have to pay for support to be able to post there too?) I’ll petition for us to pay for AWS support so I can ask them, but hoped I might be able to lean on the lobste.rs community for help in this instance.