title: How to create an AWS Cloudwatch event that runs Codebuild when a pull request is created in CodeCommit?
body: <p>I want to create a Cloudwatch event that runs a Codebuild project every time a pull request is made on a CodeCommit branch. However, the event I made is not triggering upon creation of the pull request on the master branch. Hope you guys could give me some advice on this.</p>
  <p>Below is the event pattern of the event rule that I made:</p>
  <pre><code>{
    &quot;source&quot;: [
      &quot;aws.codecommit&quot;
    ],
    &quot;detail-type&quot;: [
      &quot;CodeCommit Pull Request State Change&quot;
    ],
    &quot;resources&quot;: [
      &quot;arn:aws:codecommit:XX-XX-1:XXX:dev-test&quot;
    ],
    &quot;detail&quot;: {
      &quot;event&quot;: [
        &quot;pullRequestCreated&quot;
      ],
      &quot;referenceType&quot;: [
        &quot;branch&quot;
      ],
      &quot;referenceName&quot;: [
        &quot;master&quot;
      ]
    }
  }
  </code></pre>