AWS Lambda
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

Using AWS Lambda with Amazon Cognito

The Amazon Cognito Events feature enables you to run Lambda functions in response to events in Amazon Cognito. For example, you can invoke a Lambda function for the Sync Trigger events, that is published each time a dataset is synchronized. To learn more and walk through an example, see Introducing Amazon Cognito Events: Sync Triggers in the Mobile Development blog.

Example Amazon Cognito Message Event

{ "datasetName": "datasetName", "eventType": "SyncTrigger", "region": "us-east-1", "identityId": "identityId", "datasetRecords": { "SampleKey2": { "newValue": "newValue2", "oldValue": "oldValue2", "op": "replace" }, "SampleKey1": { "newValue": "newValue1", "oldValue": "oldValue1", "op": "replace" } }, "identityPoolId": "identityPoolId", "version": 2 }

You configure event source mapping using Amazon Cognito event subscription configuration. For information about event source mapping and a sample event, see Amazon Cognito Events in the Amazon Cognito Developer Guide.