Question

Difficulty: MediumEdge Caching and Content Delivery for Resilient Architectures

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?

  1. Create a CloudFront origin group with the ALB as the primary origin and the S3 bucket as the secondary origin.Answer
  2. Configure the origin group's failover criteria to include HTTP status codes 502, 503, and 504.Answer
  3. C
    Use AWS WAF to inspect the ALB responses and redirect client requests to the S3 bucket if a gateway error code is detected.
  4. D
    Configure Amazon Route 53 with active-passive failover using a latency routing policy between the ALB and the S3 bucket.
  5. E
    Create 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

1
Configure the two distinct destinations as CloudFront origins.
The Application Load Balancer and the Amazon S3 bucket are defined as origins within the CloudFront distribution.
This registers the primary application stack and the backup static storage as valid backend targets.
2
Group the origins into an origin group.
An origin group is established with the ALB designated as the primary origin and the S3 bucket as the secondary origin.
An origin group is the CloudFront configuration wrapper required to enable origin-level resilience and automatic failover.
3
Define the origin failover criteria.
The origin group is configured to failover when the primary origin returns HTTP status codes 502, 503, or 504.
This tells CloudFront to automatically query the backup S3 bucket instead of the ALB when those gateway error codes are returned.

Key Concept

Amazon CloudFront Origin Groups and Origin Failover
Rate this question