
Ultimate access to all questions.
A company is using AWS CodeDeploy to automate deployments of their Java-Apache Tomcat application with an Apache Webserver. They have successfully created a deployment group for a developer environment and conducted functional tests. The team plans to create additional deployment groups for staging and production environments. Currently, the log level is configured within the Apache settings, but the team wishes to dynamically adjust this configuration during deployments based on the deployment group, without needing separate application revisions for each group. How can they achieve this with minimal management overhead and without requiring different script versions for each deployment group?
A
Tag the Amazon EC2 instances depending on the deployment group. Then place a script into the application revision that calls the metadata service and the EC2 API to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference the script as part of the AfterInstall lifecycle hook in the appspec.yml file.
B
Create a script that uses the CodeDeploy environment variable DEPLOYMENT_GROUP_NAME to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference this script as part of the BeforeInstall lifecycle hook in the appspec.yml file.
C
Create a CodeDeploy custom environment variable for each environment. Then place a script into the application revision that checks this environment variable to identify which deployment group the instance is part of. Use this information to configure the log level settings. Reference this script as part of the ValidateService lifecycle hook in the appspec.yml file.
D
Create a script that uses the CodeDeploy environment variable DEPLOYMENT_GROUP_ID to identify which deployment group the instance is part of to configure the log level settings. Reference this script as part of the Install lifecycle hook in the appspec.yml file.