Q86 — AWS DOP-C02 Ch.1
Question 86 of 100 | ← Chapter 1
A company runs an application on an Amazon EC2 instance. Application metadata is stored in Amazon S3, and the instance retrieves this metadata upon restart. If the instance becomes unresponsive, it must automatically restart or reboot.
- A. Create an Amazon CloudWatch alarm for the StatusCheckFailed metric. Use the recovery action to stop and start the instance. When the instance is back online, use S3 event notifications to push metadata to the instance.
- B. Configure AWS OpsWorks and use its auto-healing feature to stop and start the instance. Use OpsWorks lifecycle events to fetch metadata from Amazon S3 and update it on the instance. ✓
- C. Use EC2 Auto Recovery to automatically stop and start the instance when failures occur. When the instance is back online, use S3 event notifications to push metadata to the instance.
- D. Use AWS CloudFormation to create an EC2 instance with the UserData property. Include a command in UserData to retrieve application metadata from Amazon S3.
Correct Answer: B. Configure AWS OpsWorks and use its auto-healing feature to stop and start the instance. Use OpsWorks lifecycle events to fetch metadata from Amazon S3 and update it on the instance.
Explanation
AWS OpsWorks provides auto-healing functionality that replaces unhealthy instances, ensuring high availability. Its lifecycle events—such as 'setup' or 'configure'—execute custom scripts during instance initialization, enabling reliable retrieval and application of metadata from Amazon S3. As documented in AWS official sources, OpsWorks auto-healing achieves fault recovery by replacing non-responsive instances, and lifecycle events guarantee metadata synchronization at boot time. Option B leverages auto-healing for failure recovery and lifecycle events for automatic metadata refresh post-restart. Options A and C depend on one-time S3 event notifications, which do not guarantee metadata delivery after every restart. Option D loads metadata only during initial launch via UserData and does not handle subsequent restarts or metadata updates.