A company runs an application that uses a MySQL-compatible Amazon Aurora Multi-AZ DB cluster for its database. A cross-Region read replica was created for disaster-recovery purposes. A DevOps engineer needs to automate promotion of the replica so that it becomes the primary database instance if a failure occurs.
Which solution will achieve this?
A Configure a latency-based Amazon Route 53 CNAME with health checks so it points to both the primary and replica endpoints. Subscribe an Amazon SNS topic to Amazon RDS failure notifications from AWS CloudTrail and use that topic to trigger an AWS Lambda function that will promote the replica instance as the master. B Create an Aurora custom endpoint to point to the primary database instance. Configure the application to use this endpoint. Configure AWS CloudTrail to run an AWS Lambda function to promote the replica instance and modify the custom endpoint to point to the newly promoted instance. C Create an AWS Lambda function to modify the application's AWS Cloud Formation template to promote the replica, apply the template to update the stack, and point the application to the newly promoted instance. Create an Amazon CloudWatch alarm to trigger this Lambda function after the failure event occurs. D Store the Aurora endpoint in AWS Systems Manager Parameter Store. Create an Amazon EventBridge (Amazon CloudWatch Events) event that defects the database failure and runs an AWS Lambda function to promote the replica instance and update the endpoint URL stored in AWS Systems Manager Parameter Store. Code the application to reload the endpoint from Parameter Store if a database connection fails. Show Answer Answer Explanation Aurora MySQL cross-Region read replicas can be promoted to standalone DB clusters through the Amazon RDS promotion API. An EventBridge-triggered Lambda function can detect the failure and invoke that promotion, while updating the active endpoint in Systems Manager Parameter Store. Reloading that parameter after a database connection failure directs the application to the newly promoted cluster, satisfying both promotion and traffic redirection requirements. AWS documentation: Promoting a read replica to a DB cluster for Aurora MySQL
Learn more
Community Discussion