Q56 — AWS DOP-C02 Ch.2
Question 56 of 100 | ← Chapter 2
A multi-tier application requires deleting and repopulating a table in an Amazon RDS MySQL database instance during each deployment. This process may take several minutes and renders the web tier unavailable until completion. Currently, the web tier is configured in an Amazon EC2 Auto Scaling group, where instances are terminated and replaced during each deployment. An AWS CodeBuild job runs SQL queries to populate the MySQL table. What should be done to ensure the web tier does not come online before the database is fully configured?
- A. Use Amazon Aurora as a direct replacement for RDS MySQL. Use snapshots to populate the table with correct data.
- B. Modify the Auto Scaling group's launch configuration to pause user data execution for 600 seconds, allowing time for table population.
- C. Use AWS Step Functions to monitor and maintain the data population status. Mark the database as 'in service' before continuing deployment.
- D. Use EC2 Auto Scaling lifecycle hooks to pause web tier instance configuration until the table is populated. ✓
Correct Answer: D. Use EC2 Auto Scaling lifecycle hooks to pause web tier instance configuration until the table is populated.
Explanation
To ensure the web tier does not come online before the database is fully configured, a synchronization mechanism between web tier startup and database table population status is required. Analyzing the options: A. Replacing RDS MySQL with Aurora does not directly solve synchronization and snapshot usage does not guarantee coordination with web tier startup. B. Modifying the Auto Scaling group launch configuration to pause user data execution cannot directly correlate with database table population status and timing may be inaccurate. C. While AWS Step Functions can monitor and maintain state, the scenario does not require complex workflow orchestration, and implementation would be unnecessarily complex. D. EC2 Auto Scaling lifecycle hooks allow custom actions to be executed before web tier instances are brought into service—for example, waiting for table population to complete. This is a direct and effective method to ensure the web tier does not go online before database configuration completes. Therefore, the correct answer is D.