SOA-C02 · Question #165
A company runs its infrastructure on Amazon EC2 instances that run in an Auto Scaling group. Recently, the company promoted faulty code to the entire EC2 fleet. This faulty code caused the Auto…
The correct answer is C. Create a new Amazon Machine Image (AMI) that has a custom script configured to send logs to. Option C is correct because a custom script baked into the AMI actively ships logs to a durable, external destination (such as Amazon S3 or CloudWatch Logs) during the instance's lifetime, so logs are already preserved before termination occurs - no dependency on catching the…
Question
A company runs its infrastructure on Amazon EC2 instances that run in an Auto Scaling group. Recently, the company promoted faulty code to the entire EC2 fleet. This faulty code caused the Auto Scaling group to scale the instances before any of the application logs could be retrieved. What should a SysOps administrator do to retain the application logs after instances are terminated?
Options
- AConfigure an Auto Scaling lifecycle hook to create a snapshot of the ephemeral storage upon
- BCreate a new Amazon Machine Image (AMI) that has the Amazon CloudWatch agent installed
- CCreate a new Amazon Machine Image (AMI) that has a custom script configured to send logs to
- DInstall the Amazon CloudWatch agent on the Amazon Machine Image (AMI) that is defined in the
How the community answered
(36 responses)- A6% (2)
- B3% (1)
- C83% (30)
- D8% (3)
Explanation
Option C is correct because a custom script baked into the AMI actively ships logs to a durable, external destination (such as Amazon S3 or CloudWatch Logs) during the instance's lifetime, so logs are already preserved before termination occurs - no dependency on catching the instance before scale-in.
Why the distractors fail:
- A is wrong because Auto Scaling lifecycle hooks can pause termination, but ephemeral (instance store) storage cannot be snapshotted and is destroyed on termination anyway - this doesn't give you the logs.
- B is wrong because simply installing the CloudWatch agent does nothing on its own; without configuration telling it what to collect and where to send it, no logs are shipped.
- D is wrong for the same reason as B - installing the agent on the launch template's AMI without a configured log stream or collection rule leaves logs on the instance, which disappears on scale-in.
Memory tip: Think "C for Configured & Continuous" - the agent must be configured to continuously stream logs off the instance to survive termination. Installation ≠ configuration.
Topics
Community Discussion
No community discussion yet for this question.