DOP-C02 Practice Question 72: Beanstalk CNAME Swap External Database
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 8 · question 2 of 10
An Elastic Beanstalk environment runs a web application with an RDS database that was created inside the environment. The team wants to move to a blue/green deployment model using environment CNAME swaps so that a bad release can be swapped back instantly, and they want the database to persist across every future swap and environment termination without any data migration step.
What should they do first, before adopting the swap workflow?
Show answer and explanation
Answer:
A database created inside a Beanstalk environment is tied to that environment's lifecycle: it is deleted when the environment terminates, which is exactly what happens to the old (blue) environment after a swap-and-terminate cycle, or is orphaned by the wrong environment otherwise. The supported pattern is to run RDS outside Beanstalk (a standalone instance, or one detached from an existing environment) and pass its connection details to every environment as environment properties, so blue and green share the same database and a swap only redirects traffic.
Option A conflates two unrelated features: managed platform updates handle patching the platform version in place and can use an internal rolling process, but they do not create a second environment or perform a CNAME swap, and they do nothing about the database coupling.
Option C adds an operationally heavy snapshot-and-restore step to every single deployment, and still risks data loss or drift for writes made between the snapshot and the swap; it does not solve the underlying coupling problem.
Option D changes availability, not lifecycle ownership; a Multi-AZ database created inside the environment is still deleted with that environment on termination, so the data does not persist across the blue environment's removal.
Reference: Adding a database to your Elastic Beanstalk environment