A company hosts a public REST API for real-time weather telemetry data on Amazon ECS behind an Application Load Balancer (ALB) in the us-east-1 Region. The telemetry data is updated every 5 minutes. To support a global user base, the company needs to minimize latency, protect the ECS backend from traffic spikes, and ensure high availability by automatically routing traffic to a standby ECS deployment in the us-west-2 Region if the primary Region experiences an outage. Which architecture should a solutions architect recommend to meet these requirements with the LEAST operational overhead?
- Configure an Amazon CloudFront distribution with an origin group. Set the us-east-1 ALB as the primary origin and the us-west-2 ALB as the failover origin. Configure a cache behavior with a TTL of 5 minutes.Answer
- BConfigure an Amazon CloudFront distribution with a single origin pointing to an Amazon Route 53 latency-based routing DNS record. Create Route 53 latency records with health checks pointing to the ALBs in both regions.
- CConfigure an Amazon CloudFront distribution pointing to the us-east-1 ALB. Associate an AWS WAF web ACL with a custom rule that redirects traffic to the us-west-2 ALB when it detects HTTP 5xx errors from the primary ALB.
- DConfigure an Amazon CloudFront distribution with an origin group containing the us-east-1 ALB as primary and the us-west-2 ALB as failover. Set the cache behavior Minimum TTL, Maximum TTL, and Default TTL to 0.
Answer
Configure an Amazon CloudFront distribution with an origin group. Set the us-east-1 ALB as the primary origin and the us-west-2 ALB as the failover origin. Configure a cache behavior with a TTL of 5 minutes.
The correct configuration uses an Amazon CloudFront origin group with the primary Application Load Balancer as the primary origin and the standby Application Load Balancer as the failover origin. This native CloudFront feature allows for seamless, low-latency failover at the edge on specific HTTP status codes. Setting a 5-minute TTL optimizes performance for global users and shields the backend ECS containers from traffic spikes by caching the telemetry data.
Step-by-Step Solution
Key Concept
Amazon CloudFront Origin Groups and Edge Caching