DOP-C02 exam dumps

DOP-C02 practice question 378 of 411

AWS Certified DevOps Engineer - Professional. Professional level, Amazon Web Services. Free question with the correct answer and a full explanation.

DOP-C02 Question 378

Single answer

Your company has a CI/CD pipeline set up in AWS CodePipeline. The pipeline deploys an application to an Auto Scaling group of Amazon EC2 instances running behind an Application Load Balancer (ALB). During the deployment of a new version of the application, you notice that some requests are failing because certain instances receive traffic before the application setup is fully completed. What is the BEST way to prevent this issue?

  1. A

    Use the 'AfterInstall' lifecycle hook in AWS CodeDeploy to delay traffic routing to the instances until the application is ready.

  2. B

    Configure health checks on the Auto Scaling group to ensure instances are removed from the ALB until the application is fully initialized.

  3. C

    Use an Elastic Beanstalk environment instead of a custom CI/CD pipeline for automated deployments.

  4. D

    Enable the 'Wait' stage in AWS CodePipeline to delay deployment until the application is fully configured.

Show answer and explanation

Correct answer: A

Explanation

To prevent traffic from being routed to instances before they are fully configured, it is important to use deployment strategies that include lifecycle hooks. The 'AfterInstall' lifecycle hook in AWS CodeDeploy allows you to run custom scripts or commands to finalize the application setup before the instance starts receiving traffic. This ensures that all necessary configurations are completed before any requests are handled, preventing application failures or downtime during the deployment process.

  • A. Correct.

    Correct: The 'AfterInstall' lifecycle hook in AWS CodeDeploy allows you to define specific steps to ensure that instances are fully configured before being added to the load balancer. This ensures traffic is routed only after the application setup is complete.

  • B. Incorrect.

    Incorrect: While health checks are important, they are typically used to monitor the instance's overall health, not to delay traffic routing during deployments. Additional configuration would be needed to achieve this.

  • C. Incorrect.

    Incorrect: Elastic Beanstalk is a managed service for running and deploying applications, but switching to it may not address the specific issue of traffic being routed prematurely during deployments.

  • D. Incorrect.

    Incorrect: The 'Wait' stage in AWS CodePipeline is used to introduce manual or time-based delays in the pipeline and does not inherently ensure that instances are ready to serve traffic before being added to the load balancer.

Timed practice exam

Take a DOP-C02 practice test under exam conditions

75 questions in 180 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam