A SaaS company operates a document generation platform on AWS. The application tier runs on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB) across three Availability Zones. The instances are launched from a standard Amazon Linux AMI and execute a user data bootstrap script to download 4 GB of template libraries and compile application dependencies. This process takes 8 minutes before the instances can pass ALB health checks. During scheduled marketing events, a rapid spike in requests causes the ASG's target tracking policy (set to 70% average CPU utilization) to launch new instances. However, because these instances take 8 minutes to bootstrap, the ASG repeatedly launches additional instances before the first batch becomes healthy, leading to severe over-provisioning. Additionally, a recent NAT Gateway outage in Availability Zone A prevented instances in Availability Zones B and C from retrieving remote template libraries during bootstrapping. Which solution should a Solutions Architect implement to resolve the scaling instability and ensure high availability for outbound traffic?
- Create a custom AMI with the template libraries and dependencies pre-installed, update the Auto Scaling group to use this AMI, and configure a target tracking scaling policy with an instance warmup of 120 seconds. Deploy a NAT Gateway in each Availability Zone and configure the route table of each private subnet to route outbound traffic through its local NAT Gateway.Cevap
- BRetain the base Amazon Linux AMI with the user data bootstrapping script, but decrease the default cooldown period of the Auto Scaling group to 60 seconds to launch instances faster. Deploy a NAT Gateway in each Availability Zone and configure the private subnet route tables to route outbound traffic locally.
- CCreate a custom AMI with the template libraries and dependencies pre-installed, update the Auto Scaling group to use this AMI, and configure a target tracking scaling policy with an instance warmup of 120 seconds. Keep the single NAT Gateway in Availability Zone A to minimize hourly charges, and use an AWS Lambda function to update the route tables of Availability Zones B and C to point to a backup NAT Gateway if an outage is detected.
- DSubmit a request to AWS Support to pre-warm the Application Load Balancer prior to scheduled events. Deploy a NAT Gateway in each Availability Zone and update the private subnet route tables. Retain the base AMI and user data bootstrapping script, and configure a target tracking scaling policy based on the Application Load Balancer request count per target.