Hard1 markMultiple Choice
Domain 3.4: Reliability ImprovementReliabilityEC2EBSAutomation

AWS SAP-C02 · Question 47 · Domain 3.4: Reliability Improvement

A company is designing a highly available architecture for a stateful legacy application. The application runs on EC2 instances and stores session state on the local EBS volumes. The application cannot be rewritten to use an external session store (like ElastiCache). The architecture must ensure that if an EC2 instance fails, a new instance is launched and the exact same EBS volume (with the session state) is attached to it automatically. Which combination of services and features should be used? (Select TWO)

Answer options:

A.

Use an Amazon EC2 Auto Scaling group with a minimum and maximum size of 1.

B.

Create an AWS Lambda function triggered by EventBridge (EC2 instance state change) to detach the EBS volume from the failed instance and attach it to the new instance.

C.

Use Amazon EFS instead of EBS and mount it to the Auto Scaling group via user data.

D.

Configure the Auto Scaling group to use an EBS snapshot lifecycle policy to restore the volume.

E.

Use AWS Elastic Beanstalk with persistent storage enabled.

F.

Enable EBS Multi-Attach on the volume and attach it to all instances in the Auto Scaling group.

How to approach this question

Identify the pattern for stateful EC2 failover (ASG size 1 + Lambda automation).

Full Answer

For legacy stateful applications that cannot be refactored, a common pattern is the 'floating EBS volume'. You use an Auto Scaling group with Min=1, Max=1 to ensure high availability of the compute. If the instance dies, ASG launches a new one. You use Amazon EventBridge to detect the ASG launch event, which triggers a Lambda function. The Lambda function finds the persistent EBS volume, detaches it from the dead instance, and attaches it to the newly launched instance.

Common mistakes

Suggesting EFS or Multi-Attach, which require application/OS level support that legacy apps often lack.

Practice the full AWS Solutions Architect Professional SAP-C02 Practice Exam 5

75 questions · hints · full answers · grading

More questions from this exam