Q: 8
A company is running an application on several Amazon EC2 instances in an Auto Scaling group
behind an Application Load Balancer. The load on the application varies throughout the day, and EC2
instances are scaled in and out on a regular basis. Log files from the EC2 instances are copied to a
central Amazon S3 bucket every 15 minutes. The security team discovers that log files are missing
from some of the terminated EC2 instances.
Which set of actions will ensure that log files are copied to the central S3 bucket from the terminated
EC2 instances?
Options
Discussion
Option B here. The key is using the lifecycle hook plus SSM SendCommand, so you can pause termination and run your log copy reliably before shutting down. Option A looks tempting but has the ABANDON trap, which would leave instances orphaned. Open to corrections but pretty sure B matches AWS best practice.
Maybe D, just because it also uses lifecycle hooks and SSM SendCommand. I've seen practice exams recommend ensuring log scripts are automated, and the SNS part seemed like a solid trigger. Not totally confident since ABANDON could leave stray instances, but worth double-checking in the official guide.
Guessing B, not D. The ABANDON action in D would leave the instance running which is a trap for leftover resources, but B uses CONTINUE so the instance fully terminates after the log copy runs via SSM. Pretty sure exam practice and AWS docs point to this method.
B not D
B
Yeah, I think B too. Lifecycle hook keeps the instance alive so SSM SendCommand can push the logs out before actual termination. The key is sending CONTINUE after, if you use ABANDON you'd risk zombie EC2s. Not 100% sure but this lines up with AWS docs.
Its B, seen similar asked before and this matches AWS lifecycle hook best practices. Question is super clear on the requirements.
Be respectful. No spam.
Question 8 of 35