Event Source Mapping
Provides an Event Source Mapping
Examples
SQS Queue Source Mapping
exports.createResources = () => [
{
type: "EventSourceMapping",
group: "Lambda",
properties: ({}) => ({
BatchSize: 10,
MaximumBatchingWindowInSeconds: 0,
}),
dependencies: () => ({
lambdaFunction: "lambda-hello-world",
sqsQueue: "my-queue-lambda",
}),
},
];
Source Code Examples
Properties
Dependencies
List
The list of event source mappings can be displayed and filtered with the type EventSourceMapping:
gc list -t EventSourceMapping
Listing resources on 1 provider: aws
✓ aws
✓ Initialising
✓ Listing 6/6
┌──────────────────────────────────────────────────────────────────────────────┐
│ 1 Lambda::EventSourceMapping from aws │
├──────────────────────────────────────────────────────────────────────────────┤
│ name: mapping-lambda-hello-world-my-queue │
│ managedByUs: Yes │
│ live: │
│ UUID: 369cfa51-9364-4cba-88d4-7311317adc37 │
│ StartingPosition: null │
│ StartingPositionTimestamp: null │
│ BatchSize: 10 │
│ MaximumBatchingWindowInSeconds: 0 │
│ ParallelizationFactor: null │
│ EventSourceArn: arn:aws:sqs:eu-west-2:840541460064:my-queue │
│ FunctionArn: arn:aws:lambda:eu-west-2:840541460064:function:lambda-hello-… │
│ LastModified: 2021-09-23T13:46:06.664Z │
│ LastProcessingResult: null │
│ State: Enabled │
│ StateTransitionReason: USER_INITIATED │
│ MaximumRecordAgeInSeconds: null │
│ BisectBatchOnFunctionError: null │
│ MaximumRetryAttempts: null │
│ TumblingWindowInSeconds: null │
│ Tags: │
│ gc-project-name: lambda-sqs-nodejs │
│ gc-managed-by: grucloud │
│ gc-stage: dev │
│ gc-created-by-provider: aws │
│ Name: lambda-hello-world │
│ │
└──────────────────────────────────────────────────────────────────────────────┘
List Summary:
Provider: aws
┌─────────────────────────────────────────────────────────────────────────────┐
│ aws │
├────────────────────────────┬────────────────────────────────────────────────┤
│ Lambda::EventSourceMapping │ mapping-lambda-hello-world-my-queue │
└────────────────────────────┴────────────────────────────────────────────────┘
1 resource, 1 type, 1 provider
Command "gc l -t EventSourceMapping" executed in 13s