Question

Difficulty: EasyEdge Caching and Content Delivery for Resilient Architectures

A company wants to distribute static media assets to global users with low latency. The assets are currently stored in a primary Amazon S3 bucket. The company also wants to ensure high availability by automatically serving content from a backup S3 bucket in a different region if the primary bucket is unavailable. Which combination of actions should a solutions architect take to meet these requirements? (Select TWO.)

  1. Create an Amazon CloudFront distribution and define an origin group with the primary S3 bucket as the primary origin and the backup S3 bucket as the secondary origin.Answer
  2. Configure origin failover within the CloudFront origin group to route requests to the backup S3 bucket when the primary S3 bucket returns specific HTTP error status codes.Answer
  3. C
    Configure Amazon Route 53 with a latency routing policy to route traffic directly to the nearest S3 bucket.
  4. D
    Deploy AWS WAF to monitor the health of the primary S3 bucket and automatically redirect requests to the backup bucket when errors are detected.
  5. E
    Set the CloudFront Cache-Control max-age header and default Time to Live (TTL) value to zero for all behaviors to force direct client access to the S3 buckets.

Answer

Create an Amazon CloudFront distribution and define an origin group with the primary S3 bucket as the primary origin and the backup S3 bucket as the secondary origin. Additionally, configure origin failover within the CloudFront origin group to route requests to the backup S3 bucket when the primary S3 bucket returns specific HTTP error status codes.
To achieve both low latency and high availability for static assets, Amazon CloudFront is the recommended solution. By caching assets at global edge locations, CloudFront reduces the latency for end users. To ensure high availability and automatic failover, CloudFront support for origin groups allows configuring a primary and secondary origin. When origin failover is enabled, CloudFront automatically routes requests to the secondary origin (the backup S3 bucket) if the primary origin (the primary S3 bucket) returns configured error codes (such as 500, 502, 503, or 504).

Step-by-Step Solution

1
Set up a content delivery network to reduce latency for global users by caching content at edge locations close to them.
An Amazon CloudFront distribution is deployed with caching behaviors configured for the static assets.
CloudFront caches content at edge locations, significantly reducing latency compared to direct S3 access.
2
Establish origin-level resiliency to protect against S3 bucket unavailability or service issues.
An origin group is configured in CloudFront, containing the primary S3 bucket as the primary origin and the backup S3 bucket as the secondary origin.
An origin group allows the mapping of multiple origins to a single distribution behavior for failover purposes.
3
Configure the automatic transition rules between the primary and secondary origins.
Origin failover is enabled with criteria pointing to specific 5xx HTTP error status codes.
This guarantees that if the primary S3 bucket is unavailable and returns an error code, CloudFront automatically routes the request to the backup S3 bucket without any operational overhead.

Key Concept

CloudFront Origin Groups and Origin Failover
Rate this question