Class CfnEventSourceMapping
The AWS::Lambda::EventSourceMapping
resource creates a mapping between an event source and an AWS Lambda function.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnEventSourceMapping : CfnResource, IInspectable
Syntax (vb)
Public Class CfnEventSourceMapping
Inherits CfnResource
Implements IInspectable
Remarks
Lambda reads items from the event source and triggers the function.
For details about each event source type, see the following topics. In particular, each of the topics describes the required and optional parameters for the specific event source.
CloudformationResource: AWS::Lambda::EventSourceMapping
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
var cfnEventSourceMapping = new CfnEventSourceMapping(this, "MyCfnEventSourceMapping", new CfnEventSourceMappingProps {
FunctionName = "functionName",
// the properties below are optional
AmazonManagedKafkaEventSourceConfig = new AmazonManagedKafkaEventSourceConfigProperty {
ConsumerGroupId = "consumerGroupId"
},
BatchSize = 123,
BisectBatchOnFunctionError = false,
DestinationConfig = new DestinationConfigProperty {
OnFailure = new OnFailureProperty {
Destination = "destination"
}
},
DocumentDbEventSourceConfig = new DocumentDBEventSourceConfigProperty {
CollectionName = "collectionName",
DatabaseName = "databaseName",
FullDocument = "fullDocument"
},
Enabled = false,
EventSourceArn = "eventSourceArn",
FilterCriteria = new FilterCriteriaProperty {
Filters = new [] { new FilterProperty {
Pattern = "pattern"
} }
},
FunctionResponseTypes = new [] { "functionResponseTypes" },
MaximumBatchingWindowInSeconds = 123,
MaximumRecordAgeInSeconds = 123,
MaximumRetryAttempts = 123,
ParallelizationFactor = 123,
Queues = new [] { "queues" },
ScalingConfig = new ScalingConfigProperty {
MaximumConcurrency = 123
},
SelfManagedEventSource = new SelfManagedEventSourceProperty {
Endpoints = new EndpointsProperty {
KafkaBootstrapServers = new [] { "kafkaBootstrapServers" }
}
},
SelfManagedKafkaEventSourceConfig = new SelfManagedKafkaEventSourceConfigProperty {
ConsumerGroupId = "consumerGroupId"
},
SourceAccessConfigurations = new [] { new SourceAccessConfigurationProperty {
Type = "type",
Uri = "uri"
} },
StartingPosition = "startingPosition",
StartingPositionTimestamp = 123,
Topics = new [] { "topics" },
TumblingWindowInSeconds = 123
});
Synopsis
Constructors
CfnEventSourceMapping(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnEventSourceMapping(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnEventSourceMapping(Construct, String, ICfnEventSourceMappingProps) |
Properties
AmazonManagedKafkaEventSourceConfig | Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. |
AttrId | The event source mapping's ID. |
BatchSize | The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. |
BisectBatchOnFunctionError | (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
DestinationConfig | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it. |
DocumentDbEventSourceConfig | Specific configuration settings for a DocumentDB event source. |
Enabled | When true, the event source mapping is active. |
EventSourceArn | The Amazon Resource Name (ARN) of the event source. |
FilterCriteria | An object that defines the filter criteria that determine whether Lambda should process an event. |
FunctionName | The name or ARN of the Lambda function. |
FunctionResponseTypes | (Streams and SQS) A list of current response type enums applied to the event source mapping. |
MaximumBatchingWindowInSeconds | The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. |
MaximumRecordAgeInSeconds | (Kinesis and DynamoDB Streams only) Discard records older than the specified age. |
MaximumRetryAttempts | (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. |
ParallelizationFactor | (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. |
Queues | (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. |
ScalingConfig | (Amazon SQS only) The scaling configuration for the event source. |
SelfManagedEventSource | The self-managed Apache Kafka cluster for your event source. |
SelfManagedKafkaEventSourceConfig | Specific configuration settings for a self-managed Apache Kafka event source. |
SourceAccessConfigurations | An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. |
StartingPosition | The position in a stream from which to start reading. |
StartingPositionTimestamp | With |
Topics | The name of the Kafka topic. |
TumblingWindowInSeconds | (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnEventSourceMapping(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnEventSourceMapping(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnEventSourceMapping(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnEventSourceMapping(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnEventSourceMapping(Construct, String, ICfnEventSourceMappingProps)
public CfnEventSourceMapping(Construct scope, string id, ICfnEventSourceMappingProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnEventSourceMappingProps
Resource properties.
Properties
AmazonManagedKafkaEventSourceConfig
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
public virtual object AmazonManagedKafkaEventSourceConfig { get; set; }
Property Value
System.Object
AttrId
The event source mapping's ID.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
BatchSize
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
public virtual Nullable<double> BatchSize { get; set; }
Property Value
System.Nullable<System.Double>
BisectBatchOnFunctionError
(Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry.
public virtual object BisectBatchOnFunctionError { get; set; }
Property Value
System.Object
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
DestinationConfig
(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
public virtual object DestinationConfig { get; set; }
Property Value
System.Object
DocumentDbEventSourceConfig
Specific configuration settings for a DocumentDB event source.
public virtual object DocumentDbEventSourceConfig { get; set; }
Property Value
System.Object
Enabled
When true, the event source mapping is active.
public virtual object Enabled { get; set; }
Property Value
System.Object
Remarks
When false, Lambda pauses polling and invocation.
EventSourceArn
The Amazon Resource Name (ARN) of the event source.
public virtual string EventSourceArn { get; set; }
Property Value
System.String
FilterCriteria
An object that defines the filter criteria that determine whether Lambda should process an event.
public virtual object FilterCriteria { get; set; }
Property Value
System.Object
FunctionName
The name or ARN of the Lambda function.
public virtual string FunctionName { get; set; }
Property Value
System.String
FunctionResponseTypes
(Streams and SQS) A list of current response type enums applied to the event source mapping.
public virtual string[] FunctionResponseTypes { get; set; }
Property Value
System.String[]
MaximumBatchingWindowInSeconds
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
public virtual Nullable<double> MaximumBatchingWindowInSeconds { get; set; }
Property Value
System.Nullable<System.Double>
MaximumRecordAgeInSeconds
(Kinesis and DynamoDB Streams only) Discard records older than the specified age.
public virtual Nullable<double> MaximumRecordAgeInSeconds { get; set; }
Property Value
System.Nullable<System.Double>
MaximumRetryAttempts
(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries.
public virtual Nullable<double> MaximumRetryAttempts { get; set; }
Property Value
System.Nullable<System.Double>
ParallelizationFactor
(Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard.
public virtual Nullable<double> ParallelizationFactor { get; set; }
Property Value
System.Nullable<System.Double>
Queues
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
public virtual string[] Queues { get; set; }
Property Value
System.String[]
ScalingConfig
(Amazon SQS only) The scaling configuration for the event source.
public virtual object ScalingConfig { get; set; }
Property Value
System.Object
SelfManagedEventSource
The self-managed Apache Kafka cluster for your event source.
public virtual object SelfManagedEventSource { get; set; }
Property Value
System.Object
SelfManagedKafkaEventSourceConfig
Specific configuration settings for a self-managed Apache Kafka event source.
public virtual object SelfManagedKafkaEventSourceConfig { get; set; }
Property Value
System.Object
SourceAccessConfigurations
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
public virtual object SourceAccessConfigurations { get; set; }
Property Value
System.Object
StartingPosition
The position in a stream from which to start reading.
public virtual string StartingPosition { get; set; }
Property Value
System.String
Remarks
Required for Amazon Kinesis and Amazon DynamoDB.
StartingPositionTimestamp
With StartingPosition
set to AT_TIMESTAMP
, the time from which to start reading, in Unix time seconds.
public virtual Nullable<double> StartingPositionTimestamp { get; set; }
Property Value
System.Nullable<System.Double>
Topics
The name of the Kafka topic.
public virtual string[] Topics { get; set; }
Property Value
System.String[]
TumblingWindowInSeconds
(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources.
public virtual Nullable<double> TumblingWindowInSeconds { get; set; }
Property Value
System.Nullable<System.Double>
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>