Class CfnEventSourceMapping
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.lambda.CfnEventSourceMapping
- All Implemented Interfaces:
IInspectable,ITaggableV2,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:10.343Z")
@Stability(Stable)
public class CfnEventSourceMapping
extends CfnResource
implements IInspectable, ITaggableV2
The
AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an AWS Lambda function.
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.
- Configuring a Dynamo DB stream as an event source
- Configuring a Kinesis stream as an event source
- Configuring an SQS queue as an event source
- Configuring an MQ broker as an event source
- Configuring MSK as an event source
- Configuring Self-Managed Apache Kafka as an event source
- Configuring Amazon DocumentDB as an event source
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;
CfnEventSourceMapping cfnEventSourceMapping = CfnEventSourceMapping.Builder.create(this, "MyCfnEventSourceMapping")
.functionName("functionName")
// the properties below are optional
.amazonManagedKafkaEventSourceConfig(AmazonManagedKafkaEventSourceConfigProperty.builder()
.consumerGroupId("consumerGroupId")
.build())
.batchSize(123)
.bisectBatchOnFunctionError(false)
.destinationConfig(DestinationConfigProperty.builder()
.onFailure(OnFailureProperty.builder()
.destination("destination")
.build())
.build())
.documentDbEventSourceConfig(DocumentDBEventSourceConfigProperty.builder()
.collectionName("collectionName")
.databaseName("databaseName")
.fullDocument("fullDocument")
.build())
.enabled(false)
.eventSourceArn("eventSourceArn")
.filterCriteria(FilterCriteriaProperty.builder()
.filters(List.of(FilterProperty.builder()
.pattern("pattern")
.build()))
.build())
.functionResponseTypes(List.of("functionResponseTypes"))
.kmsKeyArn("kmsKeyArn")
.maximumBatchingWindowInSeconds(123)
.maximumRecordAgeInSeconds(123)
.maximumRetryAttempts(123)
.metricsConfig(MetricsConfigProperty.builder()
.metrics(List.of("metrics"))
.build())
.parallelizationFactor(123)
.provisionedPollerConfig(ProvisionedPollerConfigProperty.builder()
.maximumPollers(123)
.minimumPollers(123)
.build())
.queues(List.of("queues"))
.scalingConfig(ScalingConfigProperty.builder()
.maximumConcurrency(123)
.build())
.selfManagedEventSource(SelfManagedEventSourceProperty.builder()
.endpoints(EndpointsProperty.builder()
.kafkaBootstrapServers(List.of("kafkaBootstrapServers"))
.build())
.build())
.selfManagedKafkaEventSourceConfig(SelfManagedKafkaEventSourceConfigProperty.builder()
.consumerGroupId("consumerGroupId")
.build())
.sourceAccessConfigurations(List.of(SourceAccessConfigurationProperty.builder()
.type("type")
.uri("uri")
.build()))
.startingPosition("startingPosition")
.startingPositionTimestamp(123)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.topics(List.of("topics"))
.tumblingWindowInSeconds(123)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSpecific configuration settings for an MSK event source.static final classA fluent builder forCfnEventSourceMapping.static interfaceA configuration object that specifies the destination of an event after Lambda processes it.static interfaceDocument db event source config.static interfaceThe endpoints used by AWS Lambda to access a self-managed event source.static interfaceThe filter criteria to control event filtering.static interfaceThe filter object that defines parameters for ESM filtering.static interfaceMetrics config for Event Source Mapping Metrics.static interfaceA destination for records of invocations that failed processing.static interfaceProvisionedPollerConfig.static interfaceThe scaling configuration for the event source.static interfaceThe configuration used by AWS Lambda to access a self-managed event source.static interfaceSpecific configuration settings for a Self-Managed Apache Kafka event source.static interfaceThe configuration used by AWS Lambda to access event source.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnEventSourceMapping(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnEventSourceMapping(software.amazon.jsii.JsiiObjectRef objRef) CfnEventSourceMapping(software.constructs.Construct scope, String id, CfnEventSourceMappingProps props) -
Method Summary
Modifier and TypeMethodDescriptionSpecific configuration settings for an MSK event source.The Amazon Resource Name (ARN) of the event source mapping resource.Event Source Mapping Identifier UUID.The maximum number of items to retrieve in a single batch.(Streams) If the function returns an error, split the batch in two and retry.Tag Manager which manages the tags for this resource.A configuration object that specifies the destination of an event after Lambda processes it.Document db event source config.Disables the event source mapping to pause polling and invocation.The Amazon Resource Name (ARN) of the event source.The filter criteria to control event filtering.The name of the Lambda function.(Streams) A list of response types supported by the function.The Amazon Resource Name (ARN) of the KMS key.(Streams) The maximum amount of time to gather records before invoking the function, in seconds.(Streams) The maximum age of a record that Lambda sends to a function for processing.(Streams) The maximum number of times to retry when the function returns an error.Metrics config for Event Source Mapping Metrics.(Streams) The number of batches to process from each shard concurrently.ProvisionedPollerConfig.(ActiveMQ) A list of ActiveMQ queues.The scaling configuration for the event source.The configuration used by AWS Lambda to access a self-managed event source.Specific configuration settings for a Self-Managed Apache Kafka event source.A list of SourceAccessConfiguration.The position in a stream from which to start reading.With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, in Unix time seconds.getTags()A list of tags to apply to event source mapping resource.(Kafka) A list of Kafka topics.(Streams) Tumbling window (non-overlapping time window) duration to perform aggregations.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidSpecific configuration settings for an MSK event source.voidsetAmazonManagedKafkaEventSourceConfig(CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty value) Specific configuration settings for an MSK event source.voidsetBatchSize(Number value) The maximum number of items to retrieve in a single batch.void(Streams) If the function returns an error, split the batch in two and retry.void(Streams) If the function returns an error, split the batch in two and retry.voidsetDestinationConfig(IResolvable value) A configuration object that specifies the destination of an event after Lambda processes it.voidA configuration object that specifies the destination of an event after Lambda processes it.voidDocument db event source config.voidDocument db event source config.voidsetEnabled(Boolean value) Disables the event source mapping to pause polling and invocation.voidsetEnabled(IResolvable value) Disables the event source mapping to pause polling and invocation.voidsetEventSourceArn(String value) The Amazon Resource Name (ARN) of the event source.voidsetFilterCriteria(IResolvable value) The filter criteria to control event filtering.voidThe filter criteria to control event filtering.voidsetFunctionName(String value) The name of the Lambda function.voidsetFunctionResponseTypes(List<String> value) (Streams) A list of response types supported by the function.voidsetKmsKeyArn(String value) The Amazon Resource Name (ARN) of the KMS key.void(Streams) The maximum amount of time to gather records before invoking the function, in seconds.void(Streams) The maximum age of a record that Lambda sends to a function for processing.voidsetMaximumRetryAttempts(Number value) (Streams) The maximum number of times to retry when the function returns an error.voidsetMetricsConfig(IResolvable value) Metrics config for Event Source Mapping Metrics.voidMetrics config for Event Source Mapping Metrics.voidsetParallelizationFactor(Number value) (Streams) The number of batches to process from each shard concurrently.voidProvisionedPollerConfig.voidProvisionedPollerConfig.void(ActiveMQ) A list of ActiveMQ queues.voidsetScalingConfig(IResolvable value) The scaling configuration for the event source.voidThe scaling configuration for the event source.voidThe configuration used by AWS Lambda to access a self-managed event source.voidThe configuration used by AWS Lambda to access a self-managed event source.voidSpecific configuration settings for a Self-Managed Apache Kafka event source.voidsetSelfManagedKafkaEventSourceConfig(CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty value) Specific configuration settings for a Self-Managed Apache Kafka event source.voidsetSourceAccessConfigurations(List<Object> value) A list of SourceAccessConfiguration.voidA list of SourceAccessConfiguration.voidsetStartingPosition(String value) The position in a stream from which to start reading.voidWith StartingPosition set to AT_TIMESTAMP, the time from which to start reading, in Unix time seconds.voidA list of tags to apply to event source mapping resource.void(Kafka) A list of Kafka topics.voidsetTumblingWindowInSeconds(Number value) (Streams) Tumbling window (non-overlapping time window) duration to perform aggregations.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnEventSourceMapping
protected CfnEventSourceMapping(software.amazon.jsii.JsiiObjectRef objRef) -
CfnEventSourceMapping
protected CfnEventSourceMapping(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnEventSourceMapping
@Stability(Stable) public CfnEventSourceMapping(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnEventSourceMappingProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrEventSourceMappingArn
The Amazon Resource Name (ARN) of the event source mapping resource. -
getAttrId
Event Source Mapping Identifier UUID. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getFunctionName
The name of the Lambda function. -
setFunctionName
The name of the Lambda function. -
getAmazonManagedKafkaEventSourceConfig
Specific configuration settings for an MSK event source. -
setAmazonManagedKafkaEventSourceConfig
Specific configuration settings for an MSK event source. -
setAmazonManagedKafkaEventSourceConfig
@Stability(Stable) public void setAmazonManagedKafkaEventSourceConfig(@Nullable CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty value) Specific configuration settings for an MSK event source. -
getBatchSize
The maximum number of items to retrieve in a single batch. -
setBatchSize
The maximum number of items to retrieve in a single batch. -
getBisectBatchOnFunctionError
(Streams) If the function returns an error, split the batch in two and retry. -
setBisectBatchOnFunctionError
(Streams) If the function returns an error, split the batch in two and retry. -
setBisectBatchOnFunctionError
(Streams) If the function returns an error, split the batch in two and retry. -
getDestinationConfig
A configuration object that specifies the destination of an event after Lambda processes it. -
setDestinationConfig
A configuration object that specifies the destination of an event after Lambda processes it. -
setDestinationConfig
@Stability(Stable) public void setDestinationConfig(@Nullable CfnEventSourceMapping.DestinationConfigProperty value) A configuration object that specifies the destination of an event after Lambda processes it. -
getDocumentDbEventSourceConfig
Document db event source config. -
setDocumentDbEventSourceConfig
Document db event source config. -
setDocumentDbEventSourceConfig
@Stability(Stable) public void setDocumentDbEventSourceConfig(@Nullable CfnEventSourceMapping.DocumentDBEventSourceConfigProperty value) Document db event source config. -
getEnabled
Disables the event source mapping to pause polling and invocation. -
setEnabled
Disables the event source mapping to pause polling and invocation. -
setEnabled
Disables the event source mapping to pause polling and invocation. -
getEventSourceArn
The Amazon Resource Name (ARN) of the event source. -
setEventSourceArn
The Amazon Resource Name (ARN) of the event source. -
getFilterCriteria
The filter criteria to control event filtering. -
setFilterCriteria
The filter criteria to control event filtering. -
setFilterCriteria
@Stability(Stable) public void setFilterCriteria(@Nullable CfnEventSourceMapping.FilterCriteriaProperty value) The filter criteria to control event filtering. -
getFunctionResponseTypes
(Streams) A list of response types supported by the function. -
setFunctionResponseTypes
(Streams) A list of response types supported by the function. -
getKmsKeyArn
The Amazon Resource Name (ARN) of the KMS key. -
setKmsKeyArn
The Amazon Resource Name (ARN) of the KMS key. -
getMaximumBatchingWindowInSeconds
(Streams) The maximum amount of time to gather records before invoking the function, in seconds. -
setMaximumBatchingWindowInSeconds
(Streams) The maximum amount of time to gather records before invoking the function, in seconds. -
getMaximumRecordAgeInSeconds
(Streams) The maximum age of a record that Lambda sends to a function for processing. -
setMaximumRecordAgeInSeconds
(Streams) The maximum age of a record that Lambda sends to a function for processing. -
getMaximumRetryAttempts
(Streams) The maximum number of times to retry when the function returns an error. -
setMaximumRetryAttempts
(Streams) The maximum number of times to retry when the function returns an error. -
getMetricsConfig
Metrics config for Event Source Mapping Metrics. -
setMetricsConfig
Metrics config for Event Source Mapping Metrics. -
setMetricsConfig
@Stability(Stable) public void setMetricsConfig(@Nullable CfnEventSourceMapping.MetricsConfigProperty value) Metrics config for Event Source Mapping Metrics. -
getParallelizationFactor
(Streams) The number of batches to process from each shard concurrently. -
setParallelizationFactor
(Streams) The number of batches to process from each shard concurrently. -
getProvisionedPollerConfig
ProvisionedPollerConfig. -
setProvisionedPollerConfig
ProvisionedPollerConfig. -
setProvisionedPollerConfig
@Stability(Stable) public void setProvisionedPollerConfig(@Nullable CfnEventSourceMapping.ProvisionedPollerConfigProperty value) ProvisionedPollerConfig. -
getQueues
(ActiveMQ) A list of ActiveMQ queues. -
setQueues
(ActiveMQ) A list of ActiveMQ queues. -
getScalingConfig
The scaling configuration for the event source. -
setScalingConfig
The scaling configuration for the event source. -
setScalingConfig
@Stability(Stable) public void setScalingConfig(@Nullable CfnEventSourceMapping.ScalingConfigProperty value) The scaling configuration for the event source. -
getSelfManagedEventSource
The configuration used by AWS Lambda to access a self-managed event source. -
setSelfManagedEventSource
The configuration used by AWS Lambda to access a self-managed event source. -
setSelfManagedEventSource
@Stability(Stable) public void setSelfManagedEventSource(@Nullable CfnEventSourceMapping.SelfManagedEventSourceProperty value) The configuration used by AWS Lambda to access a self-managed event source. -
getSelfManagedKafkaEventSourceConfig
Specific configuration settings for a Self-Managed Apache Kafka event source. -
setSelfManagedKafkaEventSourceConfig
Specific configuration settings for a Self-Managed Apache Kafka event source. -
setSelfManagedKafkaEventSourceConfig
@Stability(Stable) public void setSelfManagedKafkaEventSourceConfig(@Nullable CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty value) Specific configuration settings for a Self-Managed Apache Kafka event source. -
getSourceAccessConfigurations
A list of SourceAccessConfiguration. -
setSourceAccessConfigurations
A list of SourceAccessConfiguration. -
setSourceAccessConfigurations
A list of SourceAccessConfiguration. -
getStartingPosition
The position in a stream from which to start reading. -
setStartingPosition
The position in a stream from which to start reading. -
getStartingPositionTimestamp
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, in Unix time seconds. -
setStartingPositionTimestamp
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, in Unix time seconds. -
getTags
A list of tags to apply to event source mapping resource. -
setTags
A list of tags to apply to event source mapping resource. -
getTopics
(Kafka) A list of Kafka topics. -
setTopics
(Kafka) A list of Kafka topics. -
getTumblingWindowInSeconds
(Streams) Tumbling window (non-overlapping time window) duration to perform aggregations. -
setTumblingWindowInSeconds
(Streams) Tumbling window (non-overlapping time window) duration to perform aggregations.
-