Which solution should the DevOps engineer use?
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.
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.
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.
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.
Explanations:
Fargate doesn’t support specific OS-level tuning or software versions (Apache Tomcat, HAProxy, Varnish Cache). Additionally, Fargate is serverless and may not provide full control over the environment as required.
Elastic Beanstalk’s Tomcat solution stack does not guarantee control over specific versions of Apache Tomcat, HAProxy, or Varnish Cache, which is required for this application.
The worker tier is designed for background tasks, not web applications. Elastic Beanstalk may not allow for the specific software version control or OS-level tuning required.
This option uses CodeCommit for source, CodeDeploy for deployment, and an EC2 Auto Scaling group for scalability and fault tolerance, allowing for specific software installation and OS-level tuning. It satisfies the need for automation and scalability while providing control over the environment.