Class DynamoEventSourceProps
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DynamoEventSourceProps : IDynamoEventSourceProps, IStreamEventSourceProps, IBaseStreamEventSourceProps
Syntax (vb)
Public Class DynamoEventSourceProps Implements IDynamoEventSourceProps, IStreamEventSourceProps, IBaseStreamEventSourceProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda.EventSources;
using Amazon.CDK.AWS.DynamoDB;
Function fn;
var table = new Table(this, "Table", new TableProps {
PartitionKey = new Attribute {
Name = "id",
Type = AttributeType.STRING
},
Stream = StreamViewType.NEW_IMAGE
});
fn.AddEventSource(new DynamoEventSource(table, new DynamoEventSourceProps {
StartingPosition = StartingPosition.LATEST,
MetricsConfig = new MetricsConfig {
Metrics = new [] { MetricType.EVENT_COUNT }
}
}));
Synopsis
Constructors
| DynamoEventSourceProps() |
Properties
| BatchSize | The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. |
| BisectBatchOnError | If the function returns an error, split the batch in two and retry. |
| Enabled | If the stream event source mapping should be enabled. |
| FilterEncryption | Add Customer managed KMS key to encrypt Filter Criteria. |
| Filters | Add filter criteria option. |
| MaxBatchingWindow | The maximum amount of time to gather records before invoking the function. |
| MaxRecordAge | The maximum age of a record that Lambda sends to a function for processing. |
| MetricsConfig | Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source. |
| OnFailure | An Amazon S3, Amazon SQS queue or Amazon SNS topic destination for discarded records. |
| ParallelizationFactor | The number of batches to process from each shard concurrently. |
| ProvisionedPollerConfig | Configuration for provisioned pollers that read from the event source. |
| ReportBatchItemFailures | Allow functions to return partially successful responses for a batch of records. |
| RetryAttempts | Maximum number of retry attempts. |
| StartingPosition | Where to begin consuming the stream. |
| TumblingWindow | The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes. |
Constructors
DynamoEventSourceProps()
public DynamoEventSourceProps()
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda.EventSources;
using Amazon.CDK.AWS.DynamoDB;
Function fn;
var table = new Table(this, "Table", new TableProps {
PartitionKey = new Attribute {
Name = "id",
Type = AttributeType.STRING
},
Stream = StreamViewType.NEW_IMAGE
});
fn.AddEventSource(new DynamoEventSource(table, new DynamoEventSourceProps {
StartingPosition = StartingPosition.LATEST,
MetricsConfig = new MetricsConfig {
Metrics = new [] { MetricType.EVENT_COUNT }
}
}));
Properties
BatchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.
public double? BatchSize { get; set; }
Property Value
Remarks
Your function receives an event with all the retrieved records.
Valid Range:
Default: 100
BisectBatchOnError
If the function returns an error, split the batch in two and retry.
public bool? BisectBatchOnError { get; set; }
Property Value
bool?
Remarks
Default: false
Enabled
If the stream event source mapping should be enabled.
public bool? Enabled { get; set; }
Property Value
bool?
Remarks
Default: true
FilterEncryption
Add Customer managed KMS key to encrypt Filter Criteria.
public IKey? FilterEncryption { get; set; }
Property Value
Remarks
Default: - none
See: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
Filters
Add filter criteria option.
public IDictionary<string, object>[]? Filters { get; set; }
Property Value
IDictionary<string, object>[]
Remarks
Default: - None
MaxBatchingWindow
The maximum amount of time to gather records before invoking the function.
public Duration? MaxBatchingWindow { get; set; }
Property Value
Remarks
Maximum of Duration.minutes(5).
Default: - Duration.seconds(0) for Kinesis, DynamoDB, and SQS event sources, Duration.millis(500) for MSK, self-managed Kafka, and Amazon MQ.
MaxRecordAge
The maximum age of a record that Lambda sends to a function for processing.
public Duration? MaxRecordAge { get; set; }
Property Value
Remarks
Valid Range:
The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records. Record are valid until it expires in the event source.
Default: -1
MetricsConfig
Configuration for enhanced monitoring metrics collection When specified, enables collection of additional metrics for the stream event source.
public IMetricsConfig? MetricsConfig { get; set; }
Property Value
Remarks
Default: - Enhanced monitoring is disabled
OnFailure
An Amazon S3, Amazon SQS queue or Amazon SNS topic destination for discarded records.
public IEventSourceDlq? OnFailure { get; set; }
Property Value
Remarks
Default: - discarded records are ignored
ParallelizationFactor
The number of batches to process from each shard concurrently.
public double? ParallelizationFactor { get; set; }
Property Value
Remarks
Valid Range:
Default: 1
ProvisionedPollerConfig
Configuration for provisioned pollers that read from the event source.
public IProvisionedPollerConfig? ProvisionedPollerConfig { get; set; }
Property Value
Remarks
When specified, allows control over the minimum and maximum number of pollers that can be provisioned to process events from the source.
Default: - no provisioned pollers
ReportBatchItemFailures
Allow functions to return partially successful responses for a batch of records.
public bool? ReportBatchItemFailures { get; set; }
Property Value
bool?
Remarks
RetryAttempts
Maximum number of retry attempts.
public double? RetryAttempts { get; set; }
Property Value
Remarks
Set to -1 for infinite retries (until the record expires in the event source).
Valid Range: -1 (infinite) or 0 to 10000
Default: -1 (infinite retries)
StartingPosition
Where to begin consuming the stream.
public StartingPosition StartingPosition { get; set; }
Property Value
Remarks
ExampleMetadata: infused
TumblingWindow
The size of the tumbling windows to group records sent to DynamoDB or Kinesis Valid Range: 0 - 15 minutes.
public Duration? TumblingWindow { get; set; }
Property Value
Remarks
Default: - None