update_event_source_mapping - Boto3 1.38.13 documentation (original) (raw)

Lambda / Client / update_event_source_mapping

Lambda.Client.update_event_source_mapping(**kwargs)

Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.

For details about how to configure different event sources, see the following topics.

The following error handling options are available only for DynamoDB and Kinesis event sources:

For stream sources (DynamoDB, Kinesis, Amazon MSK, and self-managed Apache Kafka), the following option is also available:

For information about which configuration parameters apply to each event source, see the following topics.

See also: AWS API Documentation

Request Syntax

response = client.update_event_source_mapping( UUID='string', FunctionName='string', Enabled=True|False, BatchSize=123, FilterCriteria={ 'Filters': [ { 'Pattern': 'string' }, ] }, MaximumBatchingWindowInSeconds=123, DestinationConfig={ 'OnSuccess': { 'Destination': 'string' }, 'OnFailure': { 'Destination': 'string' } }, MaximumRecordAgeInSeconds=123, BisectBatchOnFunctionError=True|False, MaximumRetryAttempts=123, ParallelizationFactor=123, SourceAccessConfigurations=[ { 'Type': 'BASIC_AUTH'|'VPC_SUBNET'|'VPC_SECURITY_GROUP'|'SASL_SCRAM_512_AUTH'|'SASL_SCRAM_256_AUTH'|'VIRTUAL_HOST'|'CLIENT_CERTIFICATE_TLS_AUTH'|'SERVER_ROOT_CA_CERTIFICATE', 'URI': 'string' }, ], TumblingWindowInSeconds=123, FunctionResponseTypes=[ 'ReportBatchItemFailures', ], ScalingConfig={ 'MaximumConcurrency': 123 }, DocumentDBEventSourceConfig={ 'DatabaseName': 'string', 'CollectionName': 'string', 'FullDocument': 'UpdateLookup'|'Default' }, KMSKeyArn='string', MetricsConfig={ 'Metrics': [ 'EventCount', ] }, ProvisionedPollerConfig={ 'MinimumPollers': 123, 'MaximumPollers': 123 } )

Parameters:

Name formats

Return type:

dict

Returns:

Response Syntax

{ 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': 'string', 'FilterCriteria': { 'Filters': [ { 'Pattern': 'string' }, ] }, 'FunctionArn': 'string', 'LastModified': datetime(2015, 1, 1), 'LastProcessingResult': 'string', 'State': 'string', 'StateTransitionReason': 'string', 'DestinationConfig': { 'OnSuccess': { 'Destination': 'string' }, 'OnFailure': { 'Destination': 'string' } }, 'Topics': [ 'string', ], 'Queues': [ 'string', ], 'SourceAccessConfigurations': [ { 'Type': 'BASIC_AUTH'|'VPC_SUBNET'|'VPC_SECURITY_GROUP'|'SASL_SCRAM_512_AUTH'|'SASL_SCRAM_256_AUTH'|'VIRTUAL_HOST'|'CLIENT_CERTIFICATE_TLS_AUTH'|'SERVER_ROOT_CA_CERTIFICATE', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ], 'AmazonManagedKafkaEventSourceConfig': { 'ConsumerGroupId': 'string' }, 'SelfManagedKafkaEventSourceConfig': { 'ConsumerGroupId': 'string' }, 'ScalingConfig': { 'MaximumConcurrency': 123 }, 'DocumentDBEventSourceConfig': { 'DatabaseName': 'string', 'CollectionName': 'string', 'FullDocument': 'UpdateLookup'|'Default' }, 'KMSKeyArn': 'string', 'FilterCriteriaError': { 'ErrorCode': 'string', 'Message': 'string' }, 'EventSourceMappingArn': 'string', 'MetricsConfig': { 'Metrics': [ 'EventCount', ] }, 'ProvisionedPollerConfig': { 'MinimumPollers': 123, 'MaximumPollers': 123 } }

Response Structure

Exceptions

Examples

This operation updates a Lambda function event source mapping

response = client.update_event_source_mapping( BatchSize=123, Enabled=True, FunctionName='myFunction', UUID='1234xCy789012', )

print(response)

Expected Output:

{ 'BatchSize': 123, 'EventSourceArn': 'arn:aws:s3:::examplebucket/*', 'FunctionArn': 'arn:aws:lambda:us-west-2:123456789012:function:myFunction', 'LastModified': datetime(2016, 11, 21, 19, 49, 20, 0, 326, 0), 'LastProcessingResult': '', 'State': '', 'StateTransitionReason': '', 'UUID': '1234xCy789012', 'ResponseMetadata': { '...': '...', }, }