An online ticketing platform serves event detail pages and seat map images to a global audience. The application runs on Amazon EC2 instances behind an Application Load Balancer (ALB) in the ap-southeast-1 Region. To reduce latency, the platform uses an Amazon CloudFront distribution. The company wants to implement a highly resilient architecture that automatically serves a static maintenance page from an Amazon S3 bucket in the us-west-2 Region if the ALB returns gateway errors (502, 503, or 504) during high-traffic events.
Which two actions should a solutions architect take to meet these requirements?
- Create a CloudFront origin group with the ALB as the primary origin and the S3 bucket as the secondary origin.Answer
- Configure the origin group's failover criteria to include HTTP status codes 502, 503, and 504.Answer
- CUse AWS WAF to inspect the ALB responses and redirect client requests to the S3 bucket if a gateway error code is detected.
- DConfigure Amazon Route 53 with active-passive failover using a latency routing policy between the ALB and the S3 bucket.
- ECreate a custom cache behavior for the distribution with the Minimum TTL, Maximum TTL, and Default TTL set to 0.
Answer
Create a CloudFront origin group with the ALB as the primary origin and the S3 bucket as the secondary origin, and configure the origin group's failover criteria to include HTTP status codes 502, 503, and 504.
To build a resilient edge architecture that handles backend failures automatically, a CloudFront origin group must be configured. Placing the Application Load Balancer as the primary origin and the Amazon S3 bucket as the secondary origin allows CloudFront to manage the traffic routing. Configuring the origin group's failover criteria to trigger on HTTP status codes 502, 503, and 504 ensures that CloudFront switches to the static maintenance page hosted on Amazon S3 without any user-perceived downtime or DNS propagation delay.
Step-by-Step Solution
Key Concept
Amazon CloudFront Origin Groups and Origin Failover