An e-commerce company operates a flash sales portal on AWS. The application is hosted on Amazon EC2 instances in an Auto Scaling Group (ASG) across three Availability Zones behind an Application Load Balancer (ALB). The instances require outbound internet access to verify payment transactions via third-party APIs. Currently, all private subnets route outbound traffic through a single NAT Gateway located in Availability Zone A.
During scheduled flash sales, the following issues occur:
- The ALB drops incoming requests and returns HTTP 503 service unavailable errors during the first few minutes of the sale.
- The ASG launches more instances than required during scale-out because the custom bootstrapping script takes 7 minutes to complete, which is longer than the ASG's default cooldown period of 300 seconds.
- An outage in Availability Zone A recently blocked all outbound internet traffic for the instances in the other zones.
Which combination of actions should a Solutions Architect implement to resolve these issues?
- Deploy a NAT Gateway in each Availability Zone, and update the private subnet route tables to use the corresponding local NAT Gateway. Submit a request to AWS Support to pre-warm the ALB prior to the scheduled flash sales. Configure an Auto Scaling lifecycle hook to keep new instances in the pending state until the bootstrapping script completes.Cevap
- BKeep the single NAT Gateway in Availability Zone A and enable Multi-AZ replication on it to protect against zone failures. Rely on the ALB's built-in automatic scaling to handle the sudden flash traffic. Increase the default cooldown period of the Auto Scaling Group to 600 seconds.
- CDeploy a NAT Gateway in each Availability Zone, and update the private subnet route tables to use the corresponding local NAT Gateway. Configure the ALB with a dynamic target tracking policy based on RequestCountPerTarget to scale the load balancer. Decrease the default cooldown period of the Auto Scaling Group to 180 seconds.
- DDeploy a NAT Gateway in each Availability Zone, and create a single route table shared by all private subnets that points to all NAT Gateways. Submit a request to AWS Support to pre-warm the ALB prior to the scheduled flash sales. Decrease the default cooldown period of the Auto Scaling Group to 200 seconds.