AWS DevOps Engineer Professional Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the AWS DevOps Engineer Professional Test. Enhance your skills with flashcards and multiple-choice questions, each offering hints and explanations. Become exam-ready!

Practice this question and more.


What is the method to automatically start a CodeBuild build upon the creation of a pull request in AWS CodeCommit?

  1. Create a manual trigger in the CodeBuild console

  2. Send an SNS notification to start the build

  3. Create a CloudWatch Events Rule for PR creation

  4. Use AWS Step Functions to monitor pull requests

The correct answer is: Create a CloudWatch Events Rule for PR creation

Automatically starting a CodeBuild build upon the creation of a pull request in AWS CodeCommit can effectively be achieved by creating a CloudWatch Events Rule for pull request creation. This method enables an event-driven architecture, where specific events—like the creation of a pull request—trigger automated workflows. When a pull request is created in CodeCommit, it generates an event that CloudWatch Events can monitor. By configuring a rule that listens for pull request creation events, you can set it to invoke a specific target, such as triggering a CodeBuild project. This allows for continuous integration practices, ensuring that code changes are automatically built and tested as soon as they are proposed in a pull request, enabling earlier detection of integration issues or bugs. This method is preferred over the other options, such as creating a manual trigger or sending SNS notifications, both of which do not align with the automation paradigm that CloudWatch Events is designed for. While using AWS Step Functions could provide a way to manage workflows, it is not the most efficient or direct method for responding specifically to the event of pull request creation.