Class SqsEventSourceProps
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.AWS.Lambda.EventSources.dll
Syntax (csharp)
public class SqsEventSourceProps : Object, ISqsEventSourceProps
Syntax (vb)
Public Class SqsEventSourceProps
Inherits Object
Implements 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), // default,
ReceiveMessageWaitTime = Duration.Seconds(20)
});
fn.AddEventSource(new SqsEventSource(queue, new SqsEventSourceProps {
BatchSize = 10, // default
MaxBatchingWindow = Duration.Minutes(5),
ReportBatchItemFailures = true
}));
Synopsis
Constructors
SqsEventSourceProps() |
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. |
MaxBatchingWindow | The maximum amount of time to gather records before invoking the function. |
ReportBatchItemFailures | Allow functions to return partially successful responses for a batch of records. |
Constructors
SqsEventSourceProps()
public SqsEventSourceProps()
Properties
BatchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
public Nullable<double> BatchSize { get; set; }
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.
public Nullable<bool> Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
MaxBatchingWindow
The maximum amount of time to gather records before invoking the function.
public Duration MaxBatchingWindow { get; set; }
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.
ReportBatchItemFailures
Allow functions to return partially successful responses for a batch of records.
public Nullable<bool> ReportBatchItemFailures { get; set; }
Property Value
System.Nullable<System.Boolean>