title: Trigger AWS lambda function after ECR event
body: <p>I am trying to get an AWS Lambda function to run whenever a new image is pushed to an AWS container registry. I have created and tested the function which works fine. I have then created a simple CloudWatch event rule with the pattern:</p>
  
  <pre><code>{
    "source": [
      "aws.ecr"
    ]
  }
  </code></pre>
  
  <p>which I believe will trigger on any event from ECR.</p>
  
  <p>The rule has a target of the lambda function. The problem is the function is not called when a new image is pushed to the registry (or deleted etc). Nothing appears in the CloudWatch logs for the function. Is there something missing from the event rule or a way to diagnose what could be going wrong?</p>