Question 1
Domain 1: SDLC AutomationA DevOps engineer wants to find a solution to migrate an application from on premises to AWS. The application is running on Linux and needs to run on specific versions of Apache Tomcat, HAProxy, and Varnish Cache to function properly. The application's operating system-level parameters require tuning. The solution must include a way to automate the deployment of new application versions. The infrastructure should be scalable and faulty servers should be replaced automatically. Which solution should the DevOps engineer use?
Correct answer: D
Explanation
AWS CodeDeploy supports deployments to Amazon EC2 Auto Scaling groups, which provides automatic replacement of failed instances and scalability. The use of an "appspec.yml" file lets CodeDeploy "configure and install the necessary software" and run deployment hooks, while CodePipeline with CodeCommit automates release of new application versions from source to deployment.
Why each option is right or wrong
A. Upload the application as a Docker image that contains all the necessary software to Amazon ECR. Create an Amazon ECS cluster using an AWS Fargate launch type and an Auto Scaling group. Create an AWS CodePipeline pipeline that uses Amazon ECR as a source and Amazon ECS as a deployment provider.
Fargate abstracts away host management, so OS-level tuning and instance Auto Scaling control do not fit.
B. Upload the application code to an AWS CodeCommit repository with a saved configuration file to configure and install the software. Create an AWS Elastic Beanstalk web server tier and a load balanced-type environment that uses the Tomcat solution stack. Create an AWS CodePipeline pipeline that uses CodeCommit as a source and Elastic Beanstalk as a deployment provider.
Elastic Beanstalk web tier simplifies Tomcat hosting but is less suited to strict host-level customization requirements.
C. Upload the application code to an AWS CodeCommit repository with a set of.ebextensions files to configure and install the software. Create an AWS Elastic Beanstalk worker tier environment that uses the Tomcat solution stack. Create an AWS CodePipeline pipeline that uses CodeCommit as a source and Elastic Beanstalk as a deployment provider.
Worker tier is for background processing, not a typical web application serving traffic through Tomcat.
D. Upload the application code to an AWS CodeCommit repository with an appspec.yml file to configure and install the necessary software. Create an AWS CodeDeploy deployment group associated with an Amazon EC2 Auto Scaling group. Create an AWS CodePipeline pipeline that uses CodeCommit as a source and CodeDeploy as a deployment provider.
AWS CodeDeploy is the service that supports in-place or blue/green deployments to Amazon EC2 Auto Scaling groups, and Auto Scaling provides the required automatic replacement of unhealthy instances plus horizontal scaling. The `appspec.yml` file is the deployment manifest CodeDeploy uses to install the required Tomcat, HAProxy, and Varnish Cache components and run lifecycle hooks, while CodePipeline can trigger deployments from CodeCommit so new application versions are released automatically end-to-end.