Updates an event source mapping. You can change the function that AWS Lambda invokes, or pause invocation and resume later from the same location.
The following error handling options are only available for stream sources (DynamoDB and Kinesis):
BisectBatchOnFunctionError
- If the function returns an error,
split the batch in two and retry.
DestinationConfig
- Send discarded records to an Amazon SQS queue
or Amazon SNS topic.
MaximumRecordAgeInSeconds
- Discard records older than the
specified age. The default value is infinite (-1). When set to
infinite (-1), failed records are retried until the record expires
MaximumRetryAttempts
- Discard records after the specified number
of retries. The default value is infinite (-1). When set to infinite
(-1), failed records are retried until the record expires.
ParallelizationFactor
- Process multiple batches from each shard
concurrently.
lambda_update_event_source_mapping(UUID, FunctionName, Enabled,
BatchSize, MaximumBatchingWindowInSeconds, DestinationConfig,
MaximumRecordAgeInSeconds, BisectBatchOnFunctionError,
MaximumRetryAttempts, ParallelizationFactor, SourceAccessConfigurations,
TumblingWindowInSeconds, FunctionResponseTypes)
A list with the following syntax:
list(
UUID = "string",
StartingPosition = "TRIM_HORIZON"|"LATEST"|"AT_TIMESTAMP",
StartingPositionTimestamp = as.POSIXct(
"2015-01-01"
),
BatchSize = 123,
MaximumBatchingWindowInSeconds = 123,
ParallelizationFactor = 123,
EventSourceArn = "string",
FunctionArn = "string",
LastModified = as.POSIXct(
"2015-01-01"
),
LastProcessingResult = "string",
State = "string",
StateTransitionReason = "string",
DestinationConfig = list(
OnSuccess = list(
Destination = "string"
),
OnFailure = list(
Destination = "string"
)
),
Topics = list(
"string"
),
Queues = list(
"string"
),
SourceAccessConfigurations = list(
list(
Type = "BASIC_AUTH"|"VPC_SUBNET"|"VPC_SECURITY_GROUP"|"SASL_SCRAM_512_AUTH"|"SASL_SCRAM_256_AUTH",
URI = "string"
)
),
SelfManagedEventSource = list(
Endpoints = list(
list(
"string"
)
)
),
MaximumRecordAgeInSeconds = 123,
BisectBatchOnFunctionError = TRUE|FALSE,
MaximumRetryAttempts = 123,
TumblingWindowInSeconds = 123,
FunctionResponseTypes = list(
"ReportBatchItemFailures"
)
)
[required] The identifier of the event source mapping.
The name of the Lambda function.
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.
If true, the event source mapping is active. Set to false to pause polling and invocation.
The maximum number of items to retrieve in a single batch.
Amazon Kinesis - Default 100. Max 10,000.
Amazon DynamoDB Streams - Default 100. Max 1,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.
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.
(Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
(Streams) Discard records older than the specified age. The default value is infinite (-1).
(Streams) If the function returns an error, split the batch in two and retry.
(Streams) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records will be retried until the record expires.
(Streams) The number of batches to process from each shard concurrently.
An array of the authentication protocol, or the VPC components to secure your event source.
(Streams) The duration of a processing window in seconds. The range is between 1 second up to 15 minutes.
(Streams) A list of current response type enums applied to the event source mapping.
svc$update_event_source_mapping(
UUID = "string",
FunctionName = "string",
Enabled = TRUE|FALSE,
BatchSize = 123,
MaximumBatchingWindowInSeconds = 123,
DestinationConfig = list(
OnSuccess = list(
Destination = "string"
),
OnFailure = list(
Destination = "string"
)
),
MaximumRecordAgeInSeconds = 123,
BisectBatchOnFunctionError = TRUE|FALSE,
MaximumRetryAttempts = 123,
ParallelizationFactor = 123,
SourceAccessConfigurations = list(
list(
Type = "BASIC_AUTH"|"VPC_SUBNET"|"VPC_SECURITY_GROUP"|"SASL_SCRAM_512_AUTH"|"SASL_SCRAM_256_AUTH",
URI = "string"
)
),
TumblingWindowInSeconds = 123,
FunctionResponseTypes = list(
"ReportBatchItemFailures"
)
)
if (FALSE) {
# This operation updates a Lambda function event source mapping
svc$update_event_source_mapping(
BatchSize = 123L,
Enabled = TRUE,
FunctionName = "myFunction",
UUID = "1234xCy789012"
)
}
Run the code above in your browser using DataLab