Interface ISqsEventSourceProps
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ISqsEventSourceProps
Syntax (vb)
Public Interface ISqsEventSourceProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda.EventSources;
Function fn;
var queue = new Queue(this, "MyQueue", new QueueProps {
VisibilityTimeout = Duration.Seconds(30)
});
fn.AddEventSource(new SqsEventSource(queue, new SqsEventSourceProps {
BatchSize = 10, // default
MaxBatchingWindow = Duration.Minutes(5),
ReportBatchItemFailures = true
}));
Synopsis
Properties
BatchSize | The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. |
Enabled | If the SQS event source mapping should be enabled. |
Filters | Add filter criteria option. |
MaxBatchingWindow | The maximum amount of time to gather records before invoking the function. |
MaxConcurrency | The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke. |
ReportBatchItemFailures | Allow functions to return partially successful responses for a batch of records. |
Properties
BatchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
virtual Nullable<double> BatchSize { get; }
Property Value
System.Nullable<System.Double>
Remarks
Your function receives an event with all the retrieved records.
Valid Range: Minimum value of 1. Maximum value of 10.
If maxBatchingWindow
is configured, this value can go up to 10,000.
Default: 10
Enabled
If the SQS event source mapping should be enabled.
virtual Nullable<bool> Enabled { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
Filters
Add filter criteria option.
virtual IDictionary<string, object>[] Filters { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>[]
Remarks
Default: - None
MaxBatchingWindow
The maximum amount of time to gather records before invoking the function.
virtual Duration MaxBatchingWindow { get; }
Property Value
Remarks
Valid Range: Minimum value of 0 minutes. Maximum value of 5 minutes.
Default: - no batching window. The lambda function will be invoked immediately with the records that are available.
MaxConcurrency
The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.
virtual Nullable<double> MaxConcurrency { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - No specific limit.
See: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency
Valid Range: Minimum value of 2. Maximum value of 1000.
ReportBatchItemFailures
Allow functions to return partially successful responses for a batch of records.
virtual Nullable<bool> ReportBatchItemFailures { get; }
Property Value
System.Nullable<System.Boolean>