@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.397Z") @Stability(value=Stable) public class CfnEventSourceMapping extends CfnResource implements IInspectable
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.
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())
.enabled(false)
.eventSourceArn("eventSourceArn")
.filterCriteria(FilterCriteriaProperty.builder()
.filters(List.of(FilterProperty.builder()
.pattern("pattern")
.build()))
.build())
.functionResponseTypes(List.of("functionResponseTypes"))
.maximumBatchingWindowInSeconds(123)
.maximumRecordAgeInSeconds(123)
.maximumRetryAttempts(123)
.parallelizationFactor(123)
.queues(List.of("queues"))
.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)
.topics(List.of("topics"))
.tumblingWindowInSeconds(123)
.build();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty
Example:
|
static class |
CfnEventSourceMapping.Builder
A fluent builder for
CfnEventSourceMapping. |
static interface |
CfnEventSourceMapping.DestinationConfigProperty
A configuration object that specifies the destination of an event after Lambda processes it.
|
static interface |
CfnEventSourceMapping.EndpointsProperty
The list of bootstrap servers for your Kafka brokers in the following format: `"KafkaBootstrapServers": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]` .
|
static interface |
CfnEventSourceMapping.FilterCriteriaProperty
An object that contains the filters for an event source.
|
static interface |
CfnEventSourceMapping.FilterProperty
A structure within a `FilterCriteria` object that defines an event filtering pattern.
|
static interface |
CfnEventSourceMapping.OnFailureProperty
A destination for events that failed processing.
|
static interface |
CfnEventSourceMapping.SelfManagedEventSourceProperty
The self-managed Apache Kafka cluster for your event source.
|
static interface |
CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty
Example:
|
static interface |
CfnEventSourceMapping.SourceAccessConfigurationProperty
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnEventSourceMapping(software.constructs.Construct scope,
String id,
CfnEventSourceMappingProps props)
Create a new `AWS::Lambda::EventSourceMapping`.
|
protected |
CfnEventSourceMapping(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnEventSourceMapping(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAmazonManagedKafkaEventSourceConfig()
`AWS::Lambda::EventSourceMapping.AmazonManagedKafkaEventSourceConfig`.
|
String |
getAttrId()
The event source mapping's ID.
|
Number |
getBatchSize()
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
|
Object |
getBisectBatchOnFunctionError()
(Streams only) If the function returns an error, split the batch in two and retry.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getDestinationConfig()
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
|
Object |
getEnabled()
When true, the event source mapping is active.
|
String |
getEventSourceArn()
The Amazon Resource Name (ARN) of the event source.
|
Object |
getFilterCriteria()
(Streams and Amazon SQS) An object that defines the filter criteria that determine whether Lambda should process an event.
|
String |
getFunctionName()
The name of the Lambda function.
|
List<String> |
getFunctionResponseTypes()
(Streams and SQS) A list of current response type enums applied to the event source mapping.
|
Number |
getMaximumBatchingWindowInSeconds()
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
|
Number |
getMaximumRecordAgeInSeconds()
(Streams only) Discard records older than the specified age.
|
Number |
getMaximumRetryAttempts()
(Streams only) Discard records after the specified number of retries.
|
Number |
getParallelizationFactor()
(Streams only) The number of batches to process concurrently from each shard.
|
List<String> |
getQueues()
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
|
Object |
getSelfManagedEventSource()
The self-managed Apache Kafka cluster for your event source.
|
Object |
getSelfManagedKafkaEventSourceConfig()
`AWS::Lambda::EventSourceMapping.SelfManagedKafkaEventSourceConfig`.
|
Object |
getSourceAccessConfigurations()
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
|
String |
getStartingPosition()
The position in a stream from which to start reading.
|
Number |
getStartingPositionTimestamp()
With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.
|
List<String> |
getTopics()
The name of the Kafka topic.
|
Number |
getTumblingWindowInSeconds()
(Streams only) The duration in seconds of a processing window.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAmazonManagedKafkaEventSourceConfig(CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty value)
`AWS::Lambda::EventSourceMapping.AmazonManagedKafkaEventSourceConfig`.
|
void |
setAmazonManagedKafkaEventSourceConfig(IResolvable value)
`AWS::Lambda::EventSourceMapping.AmazonManagedKafkaEventSourceConfig`.
|
void |
setBatchSize(Number value)
The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function.
|
void |
setBisectBatchOnFunctionError(Boolean value)
(Streams only) If the function returns an error, split the batch in two and retry.
|
void |
setBisectBatchOnFunctionError(IResolvable value)
(Streams only) If the function returns an error, split the batch in two and retry.
|
void |
setDestinationConfig(CfnEventSourceMapping.DestinationConfigProperty value)
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
|
void |
setDestinationConfig(IResolvable value)
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
|
void |
setEnabled(Boolean value)
When true, the event source mapping is active.
|
void |
setEnabled(IResolvable value)
When true, the event source mapping is active.
|
void |
setEventSourceArn(String value)
The Amazon Resource Name (ARN) of the event source.
|
void |
setFilterCriteria(CfnEventSourceMapping.FilterCriteriaProperty value)
(Streams and Amazon SQS) An object that defines the filter criteria that determine whether Lambda should process an event.
|
void |
setFilterCriteria(IResolvable value)
(Streams and Amazon SQS) An object that defines the filter criteria that determine whether Lambda should process an event.
|
void |
setFunctionName(String value)
The name of the Lambda function.
|
void |
setFunctionResponseTypes(List<String> value)
(Streams and SQS) A list of current response type enums applied to the event source mapping.
|
void |
setMaximumBatchingWindowInSeconds(Number value)
The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
|
void |
setMaximumRecordAgeInSeconds(Number value)
(Streams only) Discard records older than the specified age.
|
void |
setMaximumRetryAttempts(Number value)
(Streams only) Discard records after the specified number of retries.
|
void |
setParallelizationFactor(Number value)
(Streams only) The number of batches to process concurrently from each shard.
|
void |
setQueues(List<String> value)
(Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
|
void |
setSelfManagedEventSource(CfnEventSourceMapping.SelfManagedEventSourceProperty value)
The self-managed Apache Kafka cluster for your event source.
|
void |
setSelfManagedEventSource(IResolvable value)
The self-managed Apache Kafka cluster for your event source.
|
void |
setSelfManagedKafkaEventSourceConfig(CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty value)
`AWS::Lambda::EventSourceMapping.SelfManagedKafkaEventSourceConfig`.
|
void |
setSelfManagedKafkaEventSourceConfig(IResolvable value)
`AWS::Lambda::EventSourceMapping.SelfManagedKafkaEventSourceConfig`.
|
void |
setSourceAccessConfigurations(IResolvable value)
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
|
void |
setSourceAccessConfigurations(List<Object> value)
An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
|
void |
setStartingPosition(String value)
The position in a stream from which to start reading.
|
void |
setStartingPositionTimestamp(Number value)
With `StartingPosition` set to `AT_TIMESTAMP` , the time from which to start reading, in Unix time seconds.
|
void |
setTopics(List<String> value)
The name of the Kafka topic.
|
void |
setTumblingWindowInSeconds(Number value)
(Streams only) The duration in seconds of a processing window.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnEventSourceMapping(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnEventSourceMapping(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnEventSourceMapping(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnEventSourceMappingProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrId()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getFunctionName()
Name formats - Function name - MyFunction .
arn:aws:lambda:us-west-2:123456789012:function:MyFunction .arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .123456789012:function:MyFunction .The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
@Stability(value=Stable)
public void setFunctionName(@NotNull
String value)
Name formats - Function name - MyFunction .
arn:aws:lambda:us-west-2:123456789012:function:MyFunction .arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .123456789012:function:MyFunction .The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.
@Stability(value=Stable) @Nullable public Object getAmazonManagedKafkaEventSourceConfig()
@Stability(value=Stable)
public void setAmazonManagedKafkaEventSourceConfig(@Nullable
CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty value)
@Stability(value=Stable)
public void setAmazonManagedKafkaEventSourceConfig(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Number getBatchSize()
Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
@Stability(value=Stable)
public void setBatchSize(@Nullable
Number value)
Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).
@Stability(value=Stable) @Nullable public Object getBisectBatchOnFunctionError()
The default value is false.
@Stability(value=Stable)
public void setBisectBatchOnFunctionError(@Nullable
Boolean value)
The default value is false.
@Stability(value=Stable)
public void setBisectBatchOnFunctionError(@Nullable
IResolvable value)
The default value is false.
@Stability(value=Stable) @Nullable public Object getDestinationConfig()
@Stability(value=Stable)
public void setDestinationConfig(@Nullable
CfnEventSourceMapping.DestinationConfigProperty value)
@Stability(value=Stable)
public void setDestinationConfig(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getEnabled()
Default: True
@Stability(value=Stable)
public void setEnabled(@Nullable
Boolean value)
Default: True
@Stability(value=Stable)
public void setEnabled(@Nullable
IResolvable value)
Default: True
@Stability(value=Stable) @Nullable public String getEventSourceArn()
@Stability(value=Stable)
public void setEventSourceArn(@Nullable
String value)
@Stability(value=Stable) @Nullable public Object getFilterCriteria()
For more information, see Lambda event filtering .
@Stability(value=Stable)
public void setFilterCriteria(@Nullable
CfnEventSourceMapping.FilterCriteriaProperty value)
For more information, see Lambda event filtering .
@Stability(value=Stable)
public void setFilterCriteria(@Nullable
IResolvable value)
For more information, see Lambda event filtering .
@Stability(value=Stable) @Nullable public List<String> getFunctionResponseTypes()
Valid Values: ReportBatchItemFailures
@Stability(value=Stable)
public void setFunctionResponseTypes(@Nullable
List<String> value)
Valid Values: ReportBatchItemFailures
@Stability(value=Stable) @Nullable public Number getMaximumBatchingWindowInSeconds()
Default ( Kinesis , DynamoDB , Amazon SQS event sources) : 0
Default ( Amazon MSK , Kafka, Amazon MQ event sources) : 500 ms
@Stability(value=Stable)
public void setMaximumBatchingWindowInSeconds(@Nullable
Number value)
Default ( Kinesis , DynamoDB , Amazon SQS event sources) : 0
Default ( Amazon MSK , Kafka, Amazon MQ event sources) : 500 ms
@Stability(value=Stable) @Nullable public Number getMaximumRecordAgeInSeconds()
The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
@Stability(value=Stable)
public void setMaximumRecordAgeInSeconds(@Nullable
Number value)
The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.
@Stability(value=Stable) @Nullable public Number getMaximumRetryAttempts()
The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
@Stability(value=Stable)
public void setMaximumRetryAttempts(@Nullable
Number value)
The default value is -1, which sets the maximum number of retries to infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records until the record expires in the event source.
@Stability(value=Stable) @Nullable public Number getParallelizationFactor()
The default value is 1.
@Stability(value=Stable)
public void setParallelizationFactor(@Nullable
Number value)
The default value is 1.
@Stability(value=Stable) @Nullable public List<String> getQueues()
@Stability(value=Stable)
public void setQueues(@Nullable
List<String> value)
@Stability(value=Stable) @Nullable public Object getSelfManagedEventSource()
@Stability(value=Stable)
public void setSelfManagedEventSource(@Nullable
CfnEventSourceMapping.SelfManagedEventSourceProperty value)
@Stability(value=Stable)
public void setSelfManagedEventSource(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getSelfManagedKafkaEventSourceConfig()
@Stability(value=Stable)
public void setSelfManagedKafkaEventSourceConfig(@Nullable
CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty value)
@Stability(value=Stable)
public void setSelfManagedKafkaEventSourceConfig(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getSourceAccessConfigurations()
@Stability(value=Stable)
public void setSourceAccessConfigurations(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setSourceAccessConfigurations(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getStartingPosition()
@Stability(value=Stable)
public void setStartingPosition(@Nullable
String value)
@Stability(value=Stable) @Nullable public Number getStartingPositionTimestamp()
@Stability(value=Stable)
public void setStartingPositionTimestamp(@Nullable
Number value)
@Stability(value=Stable) @Nullable public List<String> getTopics()
@Stability(value=Stable)
public void setTopics(@Nullable
List<String> value)
@Stability(value=Stable) @Nullable public Number getTumblingWindowInSeconds()
The range is between 1 second up to 900 seconds.
@Stability(value=Stable)
public void setTumblingWindowInSeconds(@Nullable
Number value)
The range is between 1 second up to 900 seconds.
Copyright © 2022. All rights reserved.