Posted On: Feb 28, 2023
AWS Lambda now supports HAQM DocumentDB change streams as an event source. The change streams feature in HAQM DocumentDB (with MongoDB compatibility) provides a time-ordered sequence of change events that occur within your cluster’s collections. Customers can now consume these events in their serverless applications built on Lambda.
HAQM DocumentDB is a fully managed, scalable, and highly available MongoDB-compatible document database which makes it easy to store, query, and index JSON data. With HAQM DocumentDB change streams as an event source for Lambda, you can build event-driven applications that react to changes in your databases in near-real time. You can use Lambda functions to process new documents, track updates to existing documents, or log deleted documents. You can use any programming language that is supported by Lambda to write your functions.
To get started, enable change streams on your HAQM DocumentDB cluster, and then select your cluster as the event source for your Lambda function through the AWS Management Console, AWS CLI, AWS SAM, or AWS SDK for Lambda. HAQM DocumentDB change streams as a Lambda event source is available in all commercial AWS Regions where both AWS Lambda and HAQM DocumentDB are available. Provisioning an event source mapping incurs no additional charge, however, charges apply for enabling HAQM DocumentDB change streams, see HAQM DocumentDB pricing for more information. You pay for the Lambda invocations triggered by an HAQM DocumentDB change stream. To learn more about building an HAQM DocumentDB consumer application with Lambda, read the Lambda Developer Guide.