Find answers, ask questions, and connect with our
community around the world.

Home Forums AWS AWS Certified DevOps Engineer Professional CodeDeploy tag groups

  • CodeDeploy tag groups

  • lpetrini

    Member
    February 7, 2025 at 2:44 am

    Hello! I’m struggling to understand the explanations for the following question and answers, regarding CodeDeploy, in the Timed Mode Bonus Test (question 8 – DOP – Configuration Management and Infrastructure as Code):

    A DevOps Engineer is managing the deployment of a microservice, Microservice1, in an AWS environment using AWS CodeDeploy. A single group of tags is used by the deployment group of Microservice1 to determine which instances are eligible for deployment. This tag group targets instances that have both Type=DataProcessing and Name=Microservice1 tags.

    Recently, a new Amazon EC2 instance was launched with Type=DataProcessing, Team=HR, and Name=Microservice2 tags. However, during the next CodeDeploy deployment of Microservice1, Microservice1 was unexpectedly installed on the new instance.

    The DevOps Engineer must modify the current deployment group to avoid the installation of Microservice1 on the newly created instance.

    Which of the following options would meet these requirements?

    The correct answer is:

    Modify the tag group in the deployment group for Microservice1 to target instances that have both Type=DataProcessing and Name=Microservice1 tags, and do not have the Team=HR tag.

    As far as I know, there is no way to exclude a tag in a tag group. How one would target instances that do not have the tag Team=HR?

    Also, regarding the following explanation for one of the wrong answers:

    The option that says: Remove the Type=DataProcessing tag from the tag group in the deployment group for Microservice1 is incorrect because it would make the targeting criteria for the deployment group too broad. Without the Type=DataProcessing tag, the deployment group could potentially target instances that aren’t meant for any microservice at all, leading to incorrect deployments.

    Isn’t the behaviour the opposite? If we remove Type=DataProcessing from the tag group, won’t it actually narrow down the targeting criteria for the deployment group? Without that tag, it would only target instances where Name=Microservice1, whereas if we left Type=DataProcessing, it would target any instances with a tag Name=Microservice1 and also any instances where Type=DataProcessing, correct?

  • Neil-TutorialsDojo

    Member
    February 10, 2025 at 11:16 am

    Hello Ipetrini,

    Good day!

    Thank you for bringing this to our attention!

    In the original setup, the deployment group used a single tag group:

    Tag Group 1: {Type=DataProcessing, Name=Microservice1}

    This meant an instance was included if it had either of these tags. When a new EC2 instance was launched with Type=DataProcessing but Name=Microservice2, it still met the deployment criteria, which caused Microservice1 to be installed unexpectedly.

    To fix this, the one common approach is to split the single tag group into two:

    Tag Group 1: {Type=DataProcessing}

    Tag Group 2:{Name=Microservice1}

    This ensures only instances with both tags are selected, preventing deployments to Microservice2.

    Regarding your first concern, you are right that there is no way to explicitly exclude instances with a Team=HR tag in CodeDeploy’s tag-based filtering. The only way to avoid including unintended instances is to refine the tag groups to be more selective.

    We appreciate your keen attention to detail and will update this explanation as soon as possible. Thanks again for your valuable feedback!

    Regards,

    Neil @ tutorials dojo

  • lpetrini

    Member
    February 18, 2025 at 6:10 am

    Thank you, Neil! It makes sense now.

    Best regards,

    Lucas

Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
Skip to content