
Answer-first summary for fast verification
Answer: Configure an Amazon CloudFront distribution with an Amazon S3 endpoint to an S3 bucket that is configured to host the static content. Configure an Application Load Balancer that targets an Amazon Elastic Container Service (Amazon ECS) service that runs AWS Fargate tasks for the PHP application. Configure the PHP application to use an Amazon ElastiCache for Redis cluster that runs in multiple Availability Zones.
## Explanation **Option D is the correct answer** because it provides a comprehensive, highly available architecture using AWS managed services: ### Why Option D is correct: 1. **High Availability**: Uses multiple AWS managed services designed for high availability 2. **Static Content**: Amazon S3 + CloudFront provides highly available, scalable static content delivery with global edge caching 3. **PHP Application**: ECS with Fargate provides serverless container management with automatic scaling and high availability across multiple Availability Zones 4. **Session Management**: Amazon ElastiCache for Redis with Multi-AZ provides managed, highly available Redis cluster for user sessions 5. **Load Balancing**: Application Load Balancer distributes traffic across multiple Fargate tasks in different AZs ### Why other options are incorrect: **Option A**: Elastic Beanstalk with a single EC2 instance in a public subnet with a public IP address does not provide high availability. It's still a single point of failure. **Option B**: While Lambda provides serverless compute, hosting static content in Lambda is not optimal. Static content should be served from S3 + CloudFront for better performance and cost efficiency. Also, Lambda may not be ideal for PHP applications without proper runtime support. **Option C**: Keeping backend code on a single EC2 instance is not highly available. Even with ElastiCache for Redis and S3 for static content, the EC2 instance remains a single point of failure. ### Key AWS Services Used in Option D: - **Amazon S3**: For static content hosting - **Amazon CloudFront**: CDN for global content delivery - **Amazon ECS with Fargate**: Serverless container management for PHP application - **Application Load Balancer**: Distributes traffic across containers - **Amazon ElastiCache for Redis**: Managed Redis service for session management with Multi-AZ This architecture follows AWS best practices for building highly available web applications using managed services.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company recently migrated its web application to the AWS Cloud. The company uses an Amazon EC2 instance to run multiple processes to host the application. The processes include an Apache web server that serves static content. The Apache web server makes requests to a PHP application that uses a local Redis server for user sessions.
The company wants to redesign the architecture to be highly available and to use AWS managed solutions.
Which solution will meet these requirements?
A
Use AWS Elastic Beanstalk to host the static content and the PHP application. Configure Elastic Beanstalk to deploy its EC2 instance into a public subnet. Assign a public IP address.
B
Use AWS Lambda to host the static content and the PHP application. Use an Amazon API Gateway REST API to proxy requests to the Lambda function. Set the API Gateway CORS configuration to respond to the domain name. Configure Amazon ElastiCache for Redis to handle session information.
C
Keep the backend code on the EC2 instance. Create an Amazon ElastiCache for Redis cluster that has Multi-AZ enabled. Configure the ElastiCache for Redis cluster in cluster mode. Copy the frontend resources to Amazon S3. Configure the backend code to reference the EC2 instance.
D
Configure an Amazon CloudFront distribution with an Amazon S3 endpoint to an S3 bucket that is configured to host the static content. Configure an Application Load Balancer that targets an Amazon Elastic Container Service (Amazon ECS) service that runs AWS Fargate tasks for the PHP application. Configure the PHP application to use an Amazon ElastiCache for Redis cluster that runs in multiple Availability Zones.