A single EC2 instance runs an application whose metadata is stored in S3 and must be retrieved on restart. The instance must also restart or relaunch automatically if it becomes unresponsive. Which solution satisfies these needs?
Choose an answer
Tap an option to check your answer.
Correct answer: Use AWS OpsWorks with auto-healing to stop and start the instance when required. Use an OpsWorks lifecycle event to pull application metadata from S3 and update the instance..
Why this is the answer
The correct answer is to use AWS OpsWorks with auto-healing and an OpsWorks lifecycle event. OpsWorks provides auto-healing capabilities that can detect unresponsive instances and automatically stop and start them. Lifecycle events in OpsWorks, such as the "setup" or "deploy" event, can be configured to execute scripts that pull application metadata from S3 when an instance starts or restarts, ensuring the application has the necessary configuration. The other options are less suitable: CloudWatch alarm with recover action: While this can restart an instance, it doesn't inherently provide a mechanism to push metadata to the instance after restart without additional custom scripting or services. S3 event notifications are typically for S3 object changes, not for triggering actions on an EC2 instance directly after its restart. EC2 Auto Recovery: This feature automatically recovers an instance by stopping and starting it on underlying hardware failure, but it doesn't address the application metadata retrieval requirement directly. CloudFormation with UserData: UserData scripts run only once when an instance is initially launched. They do not re-run on subsequent stops and starts (restarts), which is required for retrieving metadata after an instance becomes unresponsive and is restarted.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed