update_event_source_mapping
¶
update_event_source_mapping(
uuid: UUIDString,
*,
config_overrides: Optional[LambdaClientConfig] = None,
function_name: Optional[NamespacedFunctionName] = None,
enabled: Optional[Enabled] = None,
batch_size: Optional[BatchSize] = None,
filter_criteria: Optional[FilterCriteria] = None,
kms_key_arn: Optional[KMSKeyArn] = None,
metrics_config: Optional[EventSourceMappingMetricsConfig] = None,
logging_config: Optional[EventSourceMappingLoggingConfig] = None,
scaling_config: Optional[ScalingConfig] = None,
maximum_batching_window_in_seconds: Optional[MaximumBatchingWindowInSeconds] = None,
parallelization_factor: Optional[ParallelizationFactor] = None,
destination_config: Optional[DestinationConfig] = None,
maximum_record_age_in_seconds: Optional[MaximumRecordAgeInSeconds] = None,
bisect_batch_on_function_error: Optional[BisectBatchOnFunctionError] = None,
maximum_retry_attempts: Optional[MaximumRetryAttemptsEventSourceMapping] = None,
tumbling_window_in_seconds: Optional[TumblingWindowInSeconds] = None,
source_access_configurations: Optional[SourceAccessConfigurations] = None,
function_response_types: Optional[FunctionResponseTypeList] = None,
amazon_managed_kafka_event_source_config: Optional[
AmazonManagedKafkaEventSourceConfig
] = None,
self_managed_kafka_event_source_config: Optional[
SelfManagedKafkaEventSourceConfig
] = None,
document_db_event_source_config: Optional[DocumentDBEventSourceConfig] = None,
provisioned_poller_config: Optional[ProvisionedPollerConfig] = None,
) -> EventSourceMappingConfiguration
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 for stream sources (DynamoDB, Kinesis, Amazon MSK, and self-managed Apache Kafka):
-
BisectBatchOnFunctionError– If the function returns an error, split the batch in two and retry. -
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. -
OnFailure– Send discarded records to an Amazon SQS queue, Amazon SNS topic, Kafka topic, or Amazon S3 bucket. For more information, see Adding a destination.
The following option is available only for DynamoDB and Kinesis event sources:
-
ParallelizationFactor– Process multiple batches from each shard concurrently.
For information about which configuration parameters apply to each event source, see the following topics.
Parameters:
-
uuid(UUIDString) –The identifier of the event source mapping.
-
function_name(Optional[NamespacedFunctionName], default:None) –The name or ARN 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.
-
-
enabled(Optional[Enabled], default:None) –When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
Default: True
-
batch_size(Optional[BatchSize], default:None) –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.
-
-
filter_criteria(Optional[FilterCriteria], default:None) –An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.
-
kms_key_arn(Optional[KMSKeyArn], default:None) –The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. By default, Lambda does not encrypt your filter criteria object. Specify this property to encrypt data using your own customer managed key.
-
metrics_config(Optional[EventSourceMappingMetricsConfig], default:None) –The metrics configuration for your event source. For more information, see Event source mapping metrics.
-
scaling_config(Optional[ScalingConfig], default:None) –(Amazon SQS only) The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.
-
maximum_batching_window_in_seconds(Optional[MaximumBatchingWindowInSeconds], default:None) –The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure
MaximumBatchingWindowInSecondsto any value from 0 seconds to 300 seconds in increments of seconds.For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change
MaximumBatchingWindowInSecondsin increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set
BatchSizeto a value greater than 10, you must setMaximumBatchingWindowInSecondsto at least 1. -
parallelization_factor(Optional[ParallelizationFactor], default:None) –(Kinesis and DynamoDB Streams only) The number of batches to process from each shard concurrently.
-
destination_config(Optional[DestinationConfig], default:None) –(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A configuration object that specifies the destination of an event after Lambda processes it.
-
maximum_record_age_in_seconds(Optional[MaximumRecordAgeInSeconds], default:None) –(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) Discard records older than the specified age. The default value is infinite (-1).
-
bisect_batch_on_function_error(Optional[BisectBatchOnFunctionError], default:None) –(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If the function returns an error, split the batch in two and retry.
-
maximum_retry_attempts(Optional[MaximumRetryAttemptsEventSourceMapping], default:None) –(Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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.
-
tumbling_window_in_seconds(Optional[TumblingWindowInSeconds], default:None) –(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.
-
source_access_configurations(Optional[SourceAccessConfigurations], default:None) –An array of authentication protocols or VPC components required to secure your event source.
-
function_response_types(Optional[FunctionResponseTypeList], default:None) –(Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and Amazon SQS) A list of current response type enums applied to the event source mapping.
-
document_db_event_source_config(Optional[DocumentDBEventSourceConfig], default:None) –Specific configuration settings for a DocumentDB event source.
-
provisioned_poller_config(Optional[ProvisionedPollerConfig], default:None) –(Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see provisioned mode.
Raises:
-
InvalidParameterValueException–One of the parameters in the request is not valid.
-
ResourceConflictException–The resource already exists, or another operation is in progress.
-
ResourceInUseException–The operation conflicts with the resource's availability. For example, you tried to update an event source mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.
-
ResourceNotFoundException–The resource specified in the request does not exist.
-
ServiceException–The Lambda service encountered an internal error.
-
TooManyRequestsException–The request throughput limit was exceeded. For more information, see Lambda quotas.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To update a Lambda function event source mapping This operation updates a Lambda function event source mapping
>>> client.update_event_source_mapping(batch_size=123, enabled=True, function_name='myFunction', uuid='a1b2c3d4-5678-90ab-cdef-11111EXAMPLE')
Source code in docs_src/capo_lambda/_services/_lambda.py
2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 | |