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.

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.