Q44 — AWS DOP-C02 Ch.3

Question 44 of 100 | ← Chapter 3

A company wants to replace its current bash deployment scripts with AWS developer tools. Currently, it deploys a LAMP application to a set of Amazon EC2 instances behind an Application Load Balancer (ALB). During deployment, the company runs unit tests on the submitted application, stops and starts services, deregisters and re-registers instances with the load balancer, and updates file permissions. The company wants to retain the same deployment functionality by adopting AWS services.

Correct Answer: D. Use AWS CodePipeline to trigger AWS CodeBuild to test the application. Use bash scripts invoked by AWS CodeDeploy's appspec.yml file to restart services. Deregister and re-register instances in the ALB from the AWS CodeDeploy deployment group. Update the appspec.yml file to update file permissions without custom scripts.

Explanation

Option D satisfies the requirements. First, using AWS CodePipeline to trigger AWS CodeBuild ensures application quality. Second, invoking bash scripts via AWS CodeDeploy's appspec.yml file enables service restarts. Third, deregistering and re-registering instances in the ALB from the AWS CodeDeploy deployment group ensures proper load balancer operation. Finally, updating the appspec.yml file to modify file permissions without custom scripts simplifies permission management. Overall, option D provides a comprehensive and feasible solution.