Class CfnEventSourceMappingProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEventSourceMappingProps>
- Enclosing interface:
CfnEventSourceMappingProps
CfnEventSourceMappingProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionamazonManagedKafkaEventSourceConfig
(IResolvable amazonManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getAmazonManagedKafkaEventSourceConfig()
amazonManagedKafkaEventSourceConfig
(CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty amazonManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getAmazonManagedKafkaEventSourceConfig()
Sets the value ofCfnEventSourceMappingProps.getBatchSize()
bisectBatchOnFunctionError
(Boolean bisectBatchOnFunctionError) Sets the value ofCfnEventSourceMappingProps.getBisectBatchOnFunctionError()
bisectBatchOnFunctionError
(IResolvable bisectBatchOnFunctionError) Sets the value ofCfnEventSourceMappingProps.getBisectBatchOnFunctionError()
build()
Builds the configured instance.destinationConfig
(IResolvable destinationConfig) Sets the value ofCfnEventSourceMappingProps.getDestinationConfig()
destinationConfig
(CfnEventSourceMapping.DestinationConfigProperty destinationConfig) Sets the value ofCfnEventSourceMappingProps.getDestinationConfig()
documentDbEventSourceConfig
(IResolvable documentDbEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getDocumentDbEventSourceConfig()
documentDbEventSourceConfig
(CfnEventSourceMapping.DocumentDBEventSourceConfigProperty documentDbEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getDocumentDbEventSourceConfig()
Sets the value ofCfnEventSourceMappingProps.getEnabled()
enabled
(IResolvable enabled) Sets the value ofCfnEventSourceMappingProps.getEnabled()
eventSourceArn
(String eventSourceArn) Sets the value ofCfnEventSourceMappingProps.getEventSourceArn()
filterCriteria
(IResolvable filterCriteria) Sets the value ofCfnEventSourceMappingProps.getFilterCriteria()
filterCriteria
(CfnEventSourceMapping.FilterCriteriaProperty filterCriteria) Sets the value ofCfnEventSourceMappingProps.getFilterCriteria()
functionName
(String functionName) Sets the value ofCfnEventSourceMappingProps.getFunctionName()
functionResponseTypes
(List<String> functionResponseTypes) Sets the value ofCfnEventSourceMappingProps.getFunctionResponseTypes()
Sets the value ofCfnEventSourceMappingProps.getKmsKeyArn()
maximumBatchingWindowInSeconds
(Number maximumBatchingWindowInSeconds) Sets the value ofCfnEventSourceMappingProps.getMaximumBatchingWindowInSeconds()
maximumRecordAgeInSeconds
(Number maximumRecordAgeInSeconds) Sets the value ofCfnEventSourceMappingProps.getMaximumRecordAgeInSeconds()
maximumRetryAttempts
(Number maximumRetryAttempts) Sets the value ofCfnEventSourceMappingProps.getMaximumRetryAttempts()
parallelizationFactor
(Number parallelizationFactor) Sets the value ofCfnEventSourceMappingProps.getParallelizationFactor()
Sets the value ofCfnEventSourceMappingProps.getQueues()
scalingConfig
(IResolvable scalingConfig) Sets the value ofCfnEventSourceMappingProps.getScalingConfig()
scalingConfig
(CfnEventSourceMapping.ScalingConfigProperty scalingConfig) Sets the value ofCfnEventSourceMappingProps.getScalingConfig()
selfManagedEventSource
(IResolvable selfManagedEventSource) Sets the value ofCfnEventSourceMappingProps.getSelfManagedEventSource()
selfManagedEventSource
(CfnEventSourceMapping.SelfManagedEventSourceProperty selfManagedEventSource) Sets the value ofCfnEventSourceMappingProps.getSelfManagedEventSource()
selfManagedKafkaEventSourceConfig
(IResolvable selfManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getSelfManagedKafkaEventSourceConfig()
selfManagedKafkaEventSourceConfig
(CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty selfManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getSelfManagedKafkaEventSourceConfig()
sourceAccessConfigurations
(List<? extends Object> sourceAccessConfigurations) Sets the value ofCfnEventSourceMappingProps.getSourceAccessConfigurations()
sourceAccessConfigurations
(IResolvable sourceAccessConfigurations) Sets the value ofCfnEventSourceMappingProps.getSourceAccessConfigurations()
startingPosition
(String startingPosition) Sets the value ofCfnEventSourceMappingProps.getStartingPosition()
startingPositionTimestamp
(Number startingPositionTimestamp) Sets the value ofCfnEventSourceMappingProps.getStartingPositionTimestamp()
Sets the value ofCfnEventSourceMappingProps.getTags()
Sets the value ofCfnEventSourceMappingProps.getTopics()
tumblingWindowInSeconds
(Number tumblingWindowInSeconds) Sets the value ofCfnEventSourceMappingProps.getTumblingWindowInSeconds()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
functionName
Sets the value ofCfnEventSourceMappingProps.getFunctionName()
- Parameters:
functionName
- The name or ARN of the Lambda function. This parameter is required. Name formats - Function name –MyFunction
.- Function ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction
. - Version or Alias ARN –
arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD
. - Partial ARN –
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.
- Function ARN –
- Returns:
this
-
amazonManagedKafkaEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder amazonManagedKafkaEventSourceConfig(IResolvable amazonManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getAmazonManagedKafkaEventSourceConfig()
- Parameters:
amazonManagedKafkaEventSourceConfig
- Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.- Returns:
this
-
amazonManagedKafkaEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder amazonManagedKafkaEventSourceConfig(CfnEventSourceMapping.AmazonManagedKafkaEventSourceConfigProperty amazonManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getAmazonManagedKafkaEventSourceConfig()
- Parameters:
amazonManagedKafkaEventSourceConfig
- Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.- Returns:
this
-
batchSize
Sets the value ofCfnEventSourceMappingProps.getBatchSize()
- Parameters:
batchSize
- The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. 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).- Amazon Kinesis – Default 100. Max 10,000.
- Amazon DynamoDB Streams – Default 100. Max 10,000.
- Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.
- Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
- Self-managed Apache Kafka – Default 100. Max 10,000.
- Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
- DocumentDB – Default 100. Max 10,000.
- Returns:
this
-
bisectBatchOnFunctionError
@Stability(Stable) public CfnEventSourceMappingProps.Builder bisectBatchOnFunctionError(Boolean bisectBatchOnFunctionError) Sets the value ofCfnEventSourceMappingProps.getBisectBatchOnFunctionError()
- Parameters:
bisectBatchOnFunctionError
- (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.- Returns:
this
-
bisectBatchOnFunctionError
@Stability(Stable) public CfnEventSourceMappingProps.Builder bisectBatchOnFunctionError(IResolvable bisectBatchOnFunctionError) Sets the value ofCfnEventSourceMappingProps.getBisectBatchOnFunctionError()
- Parameters:
bisectBatchOnFunctionError
- (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.- Returns:
this
-
destinationConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder destinationConfig(IResolvable destinationConfig) Sets the value ofCfnEventSourceMappingProps.getDestinationConfig()
- Parameters:
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.- Returns:
this
-
destinationConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder destinationConfig(CfnEventSourceMapping.DestinationConfigProperty destinationConfig) Sets the value ofCfnEventSourceMappingProps.getDestinationConfig()
- Parameters:
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.- Returns:
this
-
documentDbEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder documentDbEventSourceConfig(IResolvable documentDbEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getDocumentDbEventSourceConfig()
- Parameters:
documentDbEventSourceConfig
- Specific configuration settings for a DocumentDB event source.- Returns:
this
-
documentDbEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder documentDbEventSourceConfig(CfnEventSourceMapping.DocumentDBEventSourceConfigProperty documentDbEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getDocumentDbEventSourceConfig()
- Parameters:
documentDbEventSourceConfig
- Specific configuration settings for a DocumentDB event source.- Returns:
this
-
enabled
Sets the value ofCfnEventSourceMappingProps.getEnabled()
- Parameters:
enabled
- When true, the event source mapping is active. When false, Lambda pauses polling and invocation. Default: True- Returns:
this
-
enabled
Sets the value ofCfnEventSourceMappingProps.getEnabled()
- Parameters:
enabled
- When true, the event source mapping is active. When false, Lambda pauses polling and invocation. Default: True- Returns:
this
-
eventSourceArn
Sets the value ofCfnEventSourceMappingProps.getEventSourceArn()
- Parameters:
eventSourceArn
- The Amazon Resource Name (ARN) of the event source.- Amazon Kinesis – The ARN of the data stream or a stream consumer.
- Amazon DynamoDB Streams – The ARN of the stream.
- Amazon Simple Queue Service – The ARN of the queue.
- Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings ).
- Amazon MQ – The ARN of the broker.
- Amazon DocumentDB – The ARN of the DocumentDB change stream.
- Returns:
this
-
filterCriteria
@Stability(Stable) public CfnEventSourceMappingProps.Builder filterCriteria(IResolvable filterCriteria) Sets the value ofCfnEventSourceMappingProps.getFilterCriteria()
- Parameters:
filterCriteria
- An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering .- Returns:
this
-
filterCriteria
@Stability(Stable) public CfnEventSourceMappingProps.Builder filterCriteria(CfnEventSourceMapping.FilterCriteriaProperty filterCriteria) Sets the value ofCfnEventSourceMappingProps.getFilterCriteria()
- Parameters:
filterCriteria
- An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering .- Returns:
this
-
functionResponseTypes
@Stability(Stable) public CfnEventSourceMappingProps.Builder functionResponseTypes(List<String> functionResponseTypes) Sets the value ofCfnEventSourceMappingProps.getFunctionResponseTypes()
- Parameters:
functionResponseTypes
- (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping. Valid Values:ReportBatchItemFailures
- Returns:
this
-
kmsKeyArn
Sets the value ofCfnEventSourceMappingProps.getKmsKeyArn()
- Parameters:
kmsKeyArn
- The ARN of the AWS Key Management Service ( AWS KMS ) customer managed key that Lambda uses to encrypt your function's filter criteria .- Returns:
this
-
maximumBatchingWindowInSeconds
@Stability(Stable) public CfnEventSourceMappingProps.Builder maximumBatchingWindowInSeconds(Number maximumBatchingWindowInSeconds) Sets the value ofCfnEventSourceMappingProps.getMaximumBatchingWindowInSeconds()
- Parameters:
maximumBatchingWindowInSeconds
- The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. Default ( Kinesis , DynamoDB , Amazon SQS event sources) : 0Default ( Amazon MSK , Kafka, Amazon MQ , Amazon DocumentDB event sources) : 500 ms
Related setting: For Amazon SQS event sources, when you set
BatchSize
to a value greater than 10, you must setMaximumBatchingWindowInSeconds
to at least 1.- Returns:
this
-
maximumRecordAgeInSeconds
@Stability(Stable) public CfnEventSourceMappingProps.Builder maximumRecordAgeInSeconds(Number maximumRecordAgeInSeconds) Sets the value ofCfnEventSourceMappingProps.getMaximumRecordAgeInSeconds()
- Parameters:
maximumRecordAgeInSeconds
- (Kinesis and DynamoDB Streams only) Discard records older than the specified age. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records.The minimum valid value for maximum record age is 60s. Although values less than 60 and greater than -1 fall within the parameter's absolute range, they are not allowed
- Returns:
this
-
maximumRetryAttempts
@Stability(Stable) public CfnEventSourceMappingProps.Builder maximumRetryAttempts(Number maximumRetryAttempts) Sets the value ofCfnEventSourceMappingProps.getMaximumRetryAttempts()
- Parameters:
maximumRetryAttempts
- (Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. 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.- Returns:
this
-
parallelizationFactor
@Stability(Stable) public CfnEventSourceMappingProps.Builder parallelizationFactor(Number parallelizationFactor) Sets the value ofCfnEventSourceMappingProps.getParallelizationFactor()
- Parameters:
parallelizationFactor
- (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.- Returns:
this
-
queues
Sets the value ofCfnEventSourceMappingProps.getQueues()
- Parameters:
queues
- (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.- Returns:
this
-
scalingConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder scalingConfig(IResolvable scalingConfig) Sets the value ofCfnEventSourceMappingProps.getScalingConfig()
- Parameters:
scalingConfig
- (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources .- Returns:
this
-
scalingConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder scalingConfig(CfnEventSourceMapping.ScalingConfigProperty scalingConfig) Sets the value ofCfnEventSourceMappingProps.getScalingConfig()
- Parameters:
scalingConfig
- (Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources .- Returns:
this
-
selfManagedEventSource
@Stability(Stable) public CfnEventSourceMappingProps.Builder selfManagedEventSource(IResolvable selfManagedEventSource) Sets the value ofCfnEventSourceMappingProps.getSelfManagedEventSource()
- Parameters:
selfManagedEventSource
- The self-managed Apache Kafka cluster for your event source.- Returns:
this
-
selfManagedEventSource
@Stability(Stable) public CfnEventSourceMappingProps.Builder selfManagedEventSource(CfnEventSourceMapping.SelfManagedEventSourceProperty selfManagedEventSource) Sets the value ofCfnEventSourceMappingProps.getSelfManagedEventSource()
- Parameters:
selfManagedEventSource
- The self-managed Apache Kafka cluster for your event source.- Returns:
this
-
selfManagedKafkaEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder selfManagedKafkaEventSourceConfig(IResolvable selfManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getSelfManagedKafkaEventSourceConfig()
- Parameters:
selfManagedKafkaEventSourceConfig
- Specific configuration settings for a self-managed Apache Kafka event source.- Returns:
this
-
selfManagedKafkaEventSourceConfig
@Stability(Stable) public CfnEventSourceMappingProps.Builder selfManagedKafkaEventSourceConfig(CfnEventSourceMapping.SelfManagedKafkaEventSourceConfigProperty selfManagedKafkaEventSourceConfig) Sets the value ofCfnEventSourceMappingProps.getSelfManagedKafkaEventSourceConfig()
- Parameters:
selfManagedKafkaEventSourceConfig
- Specific configuration settings for a self-managed Apache Kafka event source.- Returns:
this
-
sourceAccessConfigurations
@Stability(Stable) public CfnEventSourceMappingProps.Builder sourceAccessConfigurations(IResolvable sourceAccessConfigurations) Sets the value ofCfnEventSourceMappingProps.getSourceAccessConfigurations()
- Parameters:
sourceAccessConfigurations
- An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.- Returns:
this
-
sourceAccessConfigurations
@Stability(Stable) public CfnEventSourceMappingProps.Builder sourceAccessConfigurations(List<? extends Object> sourceAccessConfigurations) Sets the value ofCfnEventSourceMappingProps.getSourceAccessConfigurations()
- Parameters:
sourceAccessConfigurations
- An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.- Returns:
this
-
startingPosition
@Stability(Stable) public CfnEventSourceMappingProps.Builder startingPosition(String startingPosition) Sets the value ofCfnEventSourceMappingProps.getStartingPosition()
- Parameters:
startingPosition
- The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.- LATEST - Read only new records.
- TRIM_HORIZON - Process all available records.
- AT_TIMESTAMP - Specify a time from which to start reading records.
- Returns:
this
-
startingPositionTimestamp
@Stability(Stable) public CfnEventSourceMappingProps.Builder startingPositionTimestamp(Number startingPositionTimestamp) Sets the value ofCfnEventSourceMappingProps.getStartingPositionTimestamp()
- Parameters:
startingPositionTimestamp
- WithStartingPosition
set toAT_TIMESTAMP
, the time from which to start reading, in Unix time seconds.StartingPositionTimestamp
cannot be in the future.- Returns:
this
-
tags
Sets the value ofCfnEventSourceMappingProps.getTags()
- Parameters:
tags
- A list of tags to add to the event source mapping.You must have the
lambda:TagResource
,lambda:UntagResource
, andlambda:ListTags
permissions for your IAM principal to manage the AWS CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.- Returns:
this
-
topics
Sets the value ofCfnEventSourceMappingProps.getTopics()
- Parameters:
topics
- The name of the Kafka topic.- Returns:
this
-
tumblingWindowInSeconds
@Stability(Stable) public CfnEventSourceMappingProps.Builder tumblingWindowInSeconds(Number tumblingWindowInSeconds) Sets the value ofCfnEventSourceMappingProps.getTumblingWindowInSeconds()
- Parameters:
tumblingWindowInSeconds
- (Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnEventSourceMappingProps>
- Returns:
- a new instance of
CfnEventSourceMappingProps
- Throws:
NullPointerException
- if any required attribute was not provided
-