Q100 — AWS DOP-C02 Ch.2
Question 100 of 100 | ← Chapter 2
A DevOps engineer wants a solution to migrate an application from on-premises to AWS. The application runs on Linux and requires specific versions of Apache Tomcat, HAProxy, and Varnish Cache to operate correctly. Operating system-level parameters must also be tuned. The solution must support automated deployment of new application versions. Infrastructure must be scalable, and failed servers must be automatically replaced.
- A. Upload the application—including all required software—as a Docker image to Amazon ECR. Create an Amazon ECS cluster using the AWS Fargate launch type and an Auto Scaling group. Create an AWS CodePipeline pipeline using Amazon ECR as the source and Amazon ECS as the deployment provider.
- B. Upload the application code to an AWS CodeCommit repository with saved configuration files to install and configure software. Create an AWS Elastic Beanstalk web server environment using the Tomcat solution stack with load balancing. Create an AWS CodePipeline pipeline using CodeCommit as the source and Elastic Beanstalk as the deployment provider.
- C. Upload the application code to an AWS CodeCommit repository using .ebextensions files to configure and install software. Create an AWS Elastic Beanstalk worker environment using the Tomcat solution stack. Create an AWS CodePipeline pipeline using CodeCommit as the source and Elastic Beanstalk as the deployment provider.
- D. Upload the application code to an AWS CodeCommit repository using an appspec.yml file to configure and install required software. Create an AWS CodeDeploy deployment group associated with an Amazon EC2 Auto Scaling group. Create an AWS CodePipeline pipeline using CodeCommit as the source and CodeDeploy as the deployment provider. ✓
Correct Answer: D. Upload the application code to an AWS CodeCommit repository using an appspec.yml file to configure and install required software. Create an AWS CodeDeploy deployment group associated with an Amazon EC2 Auto Scaling group. Create an AWS CodePipeline pipeline using CodeCommit as the source and CodeDeploy as the deployment provider.
Explanation
The requirements include precise runtime dependencies (Tomcat, HAProxy, Varnish), OS-level tuning, automated version deployment, scalability, and automatic replacement of failed instances. Option B satisfies all: Elastic Beanstalk’s Tomcat solution stack natively supports Tomcat, allows OS customization via configuration files (e.g., .ebextensions), integrates seamlessly with CodePipeline for CI/CD, auto-scales via Auto Scaling groups, and replaces unhealthy instances automatically. Option A is invalid because the application cannot run in Docker containers (per stem). Option C uses a worker environment, unsuitable for web-facing applications requiring HAProxy/Varnish. Option D lacks native support for the required middleware stack and OS tuning compared to Elastic Beanstalk’s managed platform.