DOP-C02 exam dumps

DOP-C02 practice question 102 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 102

Single answer

Your company uses AWS OpsWorks for managing application configurations across multiple environments. A new requirement mandates that application servers must automatically register themselves to a centralized monitoring system during deployment. How should you implement this in AWS OpsWorks to ensure the configuration occurs during deployments?

  1. A

    Create a custom recipe and assign it to the Deploy lifecycle event in the OpsWorks layer.

  2. B

    Use AWS Systems Manager Run Command to execute the registration script on all instances after deployment.

  3. C

    Manually execute the registration script on each instance after deployment.

  4. D

    Update the stack's user data to include the registration script and re-launch all instances.

Show answer and explanation

Correct answer: A

Explanation

AWS OpsWorks provides lifecycle events that allow you to automate configuration tasks during specific stages of an instance's lifecycle. Assigning a custom recipe to the Deploy event ensures that any required configuration, such as registering to a monitoring system, is executed automatically during deployments. This approach adheres to DevOps best practices of automation and repeatability.

  • A. Correct.

    This is correct. AWS OpsWorks uses lifecycle events such as Setup, Configure, Deploy, and Shutdown. Assigning a custom recipe to the Deploy event ensures the registration script runs automatically during deployments.

  • B. Incorrect.

    This is incorrect. While AWS Systems Manager Run Command can execute scripts on instances, it is not an automated or integrated approach specific to lifecycle events in OpsWorks.

  • C. Incorrect.

    This is incorrect. Manually executing scripts is error-prone and does not align with DevOps principles of automation and repeatability.

  • D. Incorrect.

    This is incorrect. Updating user data and re-launching instances is unnecessary and does not leverage OpsWorks lifecycle events, which are designed for such configuration tasks.

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