nerdexam
Amazon

SOA-C02 · Question #525

A company has developed a service that is deployed on a fleet of Linux-based Amazon EC2 instances that are in an Auto Scaling group. The service occasionally fails unexpectedly because of an error…

The correct answer is A. Install the Amazon CloudWatch agent on the EC2 instances. Configure the CloudWatch agent to E. Update the EC2 user data that is specified in the Auto Scaling group's launch template to ensure. Options A and E both address the need for continuous, automated service recovery at the instance level. Option A uses the CloudWatch agent configured to monitor the service process and trigger a restart action (via a CloudWatch alarm + SSM or a custom script) whenever the…

Submitted by marco_it· Mar 30, 2026Reliability and Business Continuity

Question

A company has developed a service that is deployed on a fleet of Linux-based Amazon EC2 instances that are in an Auto Scaling group. The service occasionally fails unexpectedly because of an error in the application code. The company's engineering team determines that resolving the underlying cause of the service failure could take several weeks. A SysOps administrator needs to create a solution to automate recovery if the service crashes on any of the EC2 instances. Which solutions will meet this requirement? (Choose two.)

Options

  • AInstall the Amazon CloudWatch agent on the EC2 instances. Configure the CloudWatch agent to
  • BTag the EC2 instances. Create an AWS Lambda function that uses AWS Systems Manager
  • CTag the EC2 instances. Use AWS Systems Manager State Manager to create an association that
  • DUpdate the EC2 user data that is specified in the Auto Scaling group's launch template to include
  • EUpdate the EC2 user data that is specified in the Auto Scaling group's launch template to ensure

How the community answered

(50 responses)
  • A
    78% (39)
  • B
    12% (6)
  • C
    8% (4)
  • D
    2% (1)

Explanation

Options A and E both address the need for continuous, automated service recovery at the instance level. Option A uses the CloudWatch agent configured to monitor the service process and trigger a restart action (via a CloudWatch alarm + SSM or a custom script) whenever the process dies. Option E uses EC2 user data in the launch template to configure the service as a systemd unit with Restart=always, so the OS itself automatically restarts the crashed process without any external intervention.

Why the distractors fail:

  • B (Lambda + SSM): Too much latency and operational overhead - Lambda isn't designed for real-time process-crash detection, so recovery would be delayed and fragile.
  • C (SSM State Manager association): State Manager runs on a schedule, not in response to a crash event - it can't provide immediate, event-driven recovery.
  • D (User data without persistent restart config): EC2 user data runs only once at instance launch; if the service crashes hours later, the user data script doesn't re-run, so nothing recovers it.

Memory tip: Ask yourself "does this solution react continuously, or only at boot/on a timer?" The two winning options (CloudWatch agent monitoring + systemd auto-restart) are always watching - they react the moment the service crashes. The wrong options are either one-shot (user data alone), scheduled (State Manager), or indirectly triggered (Lambda).

Topics

#Automated Recovery#Application Monitoring#Auto Scaling Group#Self-Healing

Community Discussion

No community discussion yet for this question.

Full SOA-C02 Practice