Question

Difficulty: EasyEdge Caching and Content Delivery for Resilient Architectures

A mobile gaming company uses Amazon CloudFront to deliver static game patch files to global users. The patch files are primarily served from an Application Load Balancer (ALB) backed by Amazon EC2 instances. To improve availability, the company has uploaded a backup copy of the patch files to an Amazon S3 bucket. The solutions architect must configure CloudFront to automatically serve files from the S3 bucket if the ALB is unavailable or returns 502 or 504 error codes.

Which two actions should the solutions architect take to meet these requirements? (Select TWO.)

  1. Create an origin group in the CloudFront distribution containing the Application Load Balancer as the primary origin and the Amazon S3 bucket as the secondary origin.Answer
  2. Configure the failover criteria in the CloudFront origin group to trigger on HTTP status codes 502 and 504.Answer
  3. C
    Configure an Amazon Route 53 latency routing policy to route traffic between the Application Load Balancer and the S3 bucket when health checks fail.
  4. D
    Deploy AWS WAF at the CloudFront distribution level to monitor origin health and trigger failover rules when the Application Load Balancer returns 502 and 504 errors.
  5. E
    Set the default Time to Live (TTL) on the CloudFront behavior to 0 seconds to ensure clients bypass the cache and fetch updates directly during failover events.

Answer

Create an origin group in the CloudFront distribution containing the Application Load Balancer as the primary origin and the Amazon S3 bucket as the secondary origin, and configure the failover criteria in the CloudFront origin group to trigger on HTTP status codes 502 and 504.
The correct solution involves creating a CloudFront origin group with the Application Load Balancer as the primary origin and the S3 bucket as the secondary origin. The failover criteria in the group must be configured to trigger on HTTP status codes 502 and 504. When CloudFront receives a 502 or 504 response from the ALB, it will transparently fail over to the S3 bucket to retrieve the content.

Step-by-Step Solution

1
Identify the primary and secondary origins for the content delivery path.
The Application Load Balancer is identified as the primary origin, and the Amazon S3 bucket containing the backup files is identified as the secondary origin.
Establishing the roles of each origin is necessary before configuring failover mechanics.
2
Group the origins in the CloudFront distribution settings.
An origin group is created containing both the Application Load Balancer (primary) and the Amazon S3 bucket (secondary).
CloudFront requires origins to be grouped together to enable automatic failover behavior.
3
Specify the status codes that should trigger failover.
The failover criteria are configured to include 502 and 504 HTTP status codes.
This ensures that when the ALB returns these gateway errors, CloudFront redirects the request to the S3 bucket.

Key Concept

CloudFront Origin Failover using Origin Groups allows automatic redirection of client requests to a backup origin when the primary origin is unreachable or returns specified HTTP error status codes.
Rate this question