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.)
- 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
- 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
- CConfigure Amazon Route 53 with a latency routing policy to route traffic directly to the nearest S3 bucket.
- DDeploy AWS WAF to monitor the health of the primary S3 bucket and automatically redirect requests to the backup bucket when errors are detected.
- ESet 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
Key Concept
CloudFront Origin Groups and Origin Failover