Split the deployment group into an Environment tag group and a Name tag group to require both tags
A 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?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The semantics are the crux: tags inside one tag group are OR-ed, while an instance must match every tag group to be selected. Keeping both tags in a single group (B) therefore still matches on either tag and does not fix the problem, and adding a Marketing-only group (C) would exclude the intended targets rather than constrain them. Reducing the existing group to Environment=Production and adding a Name=ApplicationA group (A) produces an AND across the two groups, excluding the new Marketing instance.
Within a single tag group, CodeDeploy treats the listed tags as alternatives, so the existing group matching Environment=Production or Name=ApplicationA also picks up any instance that merely carries Environment=Production. The fix is to change the current tag group to contain only Environment=Production and add a second, separate tag group containing only Name=ApplicationA. Tags spread across separate tag groups must all match, so only instances with both tags receive ApplicationA.
Changing the single tag group to include Department=Marketing, Environment=Production, and Name=ApplicationA (B)—tags within one group are alternatives, so this broadens rather than narrows selection and would not exclude the new instance. Adding a separate group with only Department=Marketing (C)—that combination is neither required nor restrictive in the right way, since a single tag group can hold only one tag and the extra group does not exclude the untagged Department instance. Option A follows the documented behavior that a single tag group holds one tag and multiple groups are combined with AND.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
CodeDeploy combines the tags inside a single tag group with OR and requires an instance to satisfy every configured tag group. The original group held Environment=Production and Name=ApplicationA in one group, so the newly launched instance matching only Environment=Production was still selected. Changing that group to contain only Environment=Production and adding a second tag group containing only Name=ApplicationA makes selection require both conditions, so the Department=Marketing, Environment=Production, Name=ApplicationB instance no longer matches and ApplicationA is no longer installed on it.Why the Other Options Are Wrong
B places Department=Marketing, Environment=Production, and Name=ApplicationA into one tag group; because tags inside a single group are OR-ed, this still selects instances matching any one of them, so the change does not achieve the requirement. C adds a Department=Marketing tag group while keeping the current one, which excludes the intended targets from ApplicationA rather than protecting the new instance, since the new instance lacks Department=Marketing but still matches Environment=Production in the existing group. A is the correct fix.Community Comment Notes
Community voted A (93). Commenters established the rule that tags in one tag group are OR-ed while tags across separate tag groups are AND-ed, and noted a single tag group can contain only one tag, so multiple single-tag groups are required. One commenter chose B on the mistaken reading that three tags in one group means all three must match; the AND semantics apply only across separate tag groups.Official Reference
Related Analysis
Practice All DOP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full DOP-C02 Practice Test →