Question 5
Domain 1: SDLC AutomationA company has an AWS CodeDeploy application. The application has a deployment group that uses a single tag group to identify instances for the deployment of Application. The single tag group configuration identifies instances that have Environment=Production and Name=ApplicationA tags for the deployment of ApplicationA. The company launches an additional Amazon EC2 instance with Department=Marketing, Environment=Production, and Name=ApplicationB tags. On the next CodeDeploy deployment of Application, the additional instance has ApplicationA installed on it. A DevOps engineer needs to configure the existing deployment group to prevent ApplicationA from being installed on the additional instance. Which solution will meet these requirements?
Correct answer: A
Explanation
CodeDeploy single tag groups use AND logic within a group, so the current group matches any instance with both "Environment=Production" and "Name=ApplicationA". Changing to two single tag groups makes the deployment target only instances that match both groups, preventing the new instance with "Name=ApplicationB" from being selected.
Why each option is right or wrong
A. Change the current single tag group to include only the Environment=Production tag. Add another single tag group that includes only the Name=ApplicationA tag.
AWS CodeDeploy deployment groups evaluate a single tag set with AND logic across the tags in that set, so the original group matches any instance that has both `Environment=Production` and `Name=ApplicationA` regardless of other tags. By splitting the criteria into two single tag groups, CodeDeploy requires an instance to satisfy both group selectors before it is targeted, which excludes the new EC2 instance because it lacks `Name=ApplicationA` and instead has `Name=ApplicationB`.
B. Change the current single tag group to include the Department=Marketing, Environment=production, and Name=ApplicationA tags.
Adding Department=Marketing would target marketing instances, not exclude the unintended ApplicationB server.
C. Add another single tag group that includes only the Department=Marketing tag. Keep the Environment=Production and Name=ApplicationA tags with the current single tag group.
A Department=Marketing group broadens selection logic and can still include the unwanted instance.
D. Change the current single tag group to include only the Environment=Production tag. Add another single tag group that includes only the Department=Marketing tag.
Environment plus Department does not require Name=ApplicationA, so application identity is no longer enforced.