Question #539
A retail company operates its ecommerce application on AWS. The application runs on Amazon EC2 instances behind an Application Load Balancer (ALB), with Amazon RDS as the database backend. Amazon CloudFront is configured with the ALB as its origin, caching static content. Amazon Route 53 manages DNS. After an update, the ALB intermittently returns a 504 status code (Gateway Timeout) due to backend latency. Users see the default ALB error page, but reloading the page resolves the issue temporarily. The solutions architect must implement a custom error page with minimal operational overhead.
Create an Amazon S3 bucket to host a static error page. Upload the custom error page to S3.
Configure a CloudWatch alarm for the ALB's HTTPCodeTargetTimeout_Count metric. Use a Lambda function to redirect traffic to a backup server.
Modify Route 53 health checks to route traffic to an S3-hosted error page when health checks fail.
Use Lambda@Edge to intercept 504 errors and redirect requests to a static error page hosted on S3.
Configure CloudFront to return a custom error page for HTTP 504 status codes, pointing to the S3-hosted error page.
Explanation
Answer A and E are correct because:
1. A: Hosting a static error page on S3 is simple, cost-effective, and aligns with AWS best practices for static content.
2. E: CloudFront can be configured to return custom error pages for specific HTTP status codes (like 504). This approach leverages CloudFront's existing integration with S3, minimizing operational overhead.
Why other options are incorrect:
- B: Using Lambda and CloudWatch adds complexity (alarm setup, Lambda execution) and requires maintaining a backup server.
- C: Route 53 health checks are not granular enough to handle intermittent 504 errors and may cause unnecessary routing delays.
- D: Lambda@Edge introduces operational overhead (code maintenance) compared to CloudFront's native error handling.
Key Points:
- Use CloudFront's built-in error page configuration for cached content.
- S3 is ideal for hosting static error pages with minimal maintenance.
- Avoid overcomplicating solutions with Lambda or Route 53 for transient errors.
Answer
The correct answer is: AE