Test data factories for different AWS Lambda event sources. Built using fishery.
- Amazon API Gateway
- Amazon CloudWatch Logs
- Amazon Cognito
- Amazon DynamoDB Streams
- Amazon EventBridge
- Amazon Kinesis Data Streams
- Amazon Lex v2
- Amazon MSK
- Amazon S3
- Amazon SNS
- Amazon SQS
- Amazon SecretsManager
This package prioritizes structural integrity over veracity. While some of the generated data is truthful, explicit inputs should always be provided for the parts of an event that you really care about.
[!WARNING] This is an ES only package. Before installing, make sure that your project's configuration supports ECMAScript modules.
pnpm add --save-dev @faker-js/faker fishery @driimus/aws-event-factory
Make sure to check out fishery's documentation for a more detailed API Reference of the exposed factories.
import {
dynamodbEventFactory,
dynamodbRecordFactory,
sqsEventFactory,
} from '@driimus/aws-event-factory';
const sqsEvent = sqsEventFactory.build(); // { Records: [...] }
const ddbEvent = dynamodbEventFactory.build({
Records: [
dynamodbRecordFactory.insert().build(), // { eventName: 'INSERT', ...}
dynamodbRecordFactory.modify().build(), // { eventName: 'MODIFY', ...}
dynamodbRecordFactory.remove().build(), // { eventName: 'REMOVE', ...}
],
}); // { Records: [...] }
More examples: