A company hosts a dynamic web application on Amazon EC2 instances behind an Application Load Balancer (ALB) in the us-east-1 Region. The company wants to improve the application's performance for global users by caching static content. Additionally, they need to ensure high availability by serving a static maintenance page from an Amazon S3 bucket in the us-west-2 Region if the ALB returns HTTP 502 or 504 errors. The solution must minimize latency for global users, automate the failover process, and minimize operational complexity. Which configuration should a solutions architect implement to meet these requirements?
- AConfigure an Amazon Route 53 latency routing policy with health checks pointing to both the ALB in us-east-1 and the S3 bucket in us-west-2 to distribute traffic and fail over during outages.
- BCreate an Amazon CloudFront distribution with the ALB as the origin. Configure an AWS WAF web ACL with custom rules to inspect response codes and redirect client requests to the S3 bucket when the ALB returns 502 or 504 status codes.
- Create an Amazon CloudFront distribution. Configure an Origin Group containing the ALB as the primary origin and the S3 bucket as the secondary origin. Set the failover criteria to include status codes 502 and 504.Cevap
- DCreate an Amazon CloudFront distribution with the ALB as the origin. Configure the Cache Behavior with a Minimum TTL and Default TTL of 0 seconds for all paths, and write a custom Lambda@Edge function to intercept origin response errors and redirect users to the S3 bucket.
Cevap
The correct answer is to create an Amazon CloudFront distribution and configure an Origin Group containing the ALB as the primary origin and the S3 bucket as the secondary origin, setting the failover criteria to include status codes 502 and 504.
The correct answer is to configure an Amazon CloudFront distribution with an Origin Group. CloudFront Origin Groups allow you to specify a primary origin and a secondary failover origin. When the primary origin returns specific HTTP status codes such as 502 or 504, CloudFront automatically routes traffic to the secondary origin (the S3 bucket) to serve the static maintenance page. This solution provides edge caching to reduce latency globally, implements automatic failover, and has low operational complexity.
Adım Adım Çözüm
Anahtar Kavram
Edge caching and resilient origin failover using Amazon CloudFront Origin Groups
Tahmini Süre:2m 0s