Using Amazon Lambda with Amazon CodeCommit - Amazon Lambda
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Using Amazon Lambda with Amazon CodeCommit

You can create a trigger for an Amazon CodeCommit repository so that events in the repository will invoke a Lambda function. For example, you can invoke a Lambda function when a branch or tag is created or when a push is made to an existing branch.

Example Amazon CodeCommit message event
{ "Records": [ { "awsRegion": "us-east-2", "codecommit": { "references": [ { "commit": "5e493c6f3067653f3d04eca608b4901eb227078", "ref": "refs/heads/master" } ] }, "eventId": "31ade2c7-f889-47c5-a937-1cf99e2790e9", "eventName": "ReferenceChanges", "eventPartNumber": 1, "eventSource": "aws:codecommit", "eventSourceARN": "arn:aws-cn:codecommit:us-east-2:123456789012:lambda-pipeline-repo", "eventTime": "2019-03-12T20:58:25.400+0000", "eventTotalParts": 1, "eventTriggerConfigId": "0d17d6a4-efeb-46f3-b3ab-a63741badeb8", "eventTriggerName": "index.handler", "eventVersion": "1.0", "userIdentityARN": "arn:aws-cn:iam::123456789012:user/intern" } ] }

For more information, see Manage triggers for an Amazon CodeCommit repository.