AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 21

A company is adopting AWS CodeDeploy to automate its application deployments for a Java-Apache Tomcat application with an Apache Webserver. The development team started with a proof of concept, created a deployment group for a developer environment, and performed functional tests within the application. After completion, the team will create additional deployment groups for staging and production.
The current log level is configured within the Apache settings, but the team wants to change this configuration dynamically when the deployment occurs, so that they can set different log level configurations depending on the deployment group without having a different application revision for each group.
How can these requirements be met with the LEAST management overhead and without requiring different script versions for each deployment group?

Answer options

Correct answer: B

Explanation

Option B is correct because it directly utilizes the CodeDeploy environment variable DEPLOYMENT_GROUP_NAME, which simplifies the identification of the deployment group and allows for dynamic log level configuration without multiple script versions. Options A, C, and D involve more complexity and management overhead, either by requiring tagging, creating custom environment variables, or using different lifecycle hooks that may not be suitable for the desired flexibility.