2021/07/06 - AWS Lambda - 5 updated api methods
Changes Added support for AmazonMQRabbitMQ as an event source. Added support for VIRTUAL_HOST as SourceAccessType for streams event source mappings.
{'SourceAccessConfigurations': {'Type': {'VIRTUAL_HOST'}}}
Creates a mapping between an event source and an 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.
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.
See also: AWS API Documentation
Request Syntax
client.create_event_source_mapping( EventSourceArn='string', FunctionName='string', Enabled=True|False, BatchSize=123, MaximumBatchingWindowInSeconds=123, ParallelizationFactor=123, StartingPosition='TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', StartingPositionTimestamp=datetime(2015, 1, 1), DestinationConfig={ 'OnSuccess': { 'Destination': 'string' }, 'OnFailure': { 'Destination': 'string' } }, MaximumRecordAgeInSeconds=123, BisectBatchOnFunctionError=True|False, MaximumRetryAttempts=123, TumblingWindowInSeconds=123, Topics=[ 'string', ], Queues=[ 'string', ], SourceAccessConfigurations=[ { 'Type': 'BASIC_AUTH'|'VPC_SUBNET'|'VPC_SECURITY_GROUP'|'SASL_SCRAM_512_AUTH'|'SASL_SCRAM_256_AUTH'|'VIRTUAL_HOST', 'URI': 'string' }, ], SelfManagedEventSource={ 'Endpoints': { 'string': [ 'string', ] } }, FunctionResponseTypes=[ 'ReportBatchItemFailures', ] )
string
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.
string
[REQUIRED]
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.
boolean
If true, the event source mapping is active. Set to false to pause polling and invocation.
integer
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.
integer
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.
integer
(Streams only) The number of batches to process from each shard concurrently.
string
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
datetime
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
dict
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
integer
(Streams only) Discard records older than the specified age. The default value is infinite (-1).
boolean
(Streams only) If the function returns an error, split the batch in two and retry.
integer
(Streams only) 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.
integer
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
list
The name of the Kafka topic.
(string) --
list
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
list
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
dict
The Self-Managed Apache Kafka cluster to send records.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
list
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
dict
Response Syntax
{ 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': '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', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ] }
Response Structure
(dict) --
A mapping between an Amazon Web Services resource and an Lambda function. See CreateEventSourceMapping for details.
UUID (string) --
The identifier of the event source mapping.
StartingPosition (string) --
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
StartingPositionTimestamp (datetime) --
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
BatchSize (integer) --
The maximum number of items to retrieve in a single batch.
MaximumBatchingWindowInSeconds (integer) --
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
ParallelizationFactor (integer) --
(Streams only) The number of batches to process from each shard concurrently. The default value is 1.
EventSourceArn (string) --
The Amazon Resource Name (ARN) of the event source.
FunctionArn (string) --
The ARN of the Lambda function.
LastModified (datetime) --
The date that the event source mapping was last updated, or its state changed.
LastProcessingResult (string) --
The result of the last Lambda invocation of your Lambda function.
State (string) --
The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
StateTransitionReason (string) --
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
DestinationConfig (dict) --
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
Topics (list) --
The name of the Kafka topic.
(string) --
Queues (list) --
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
SourceAccessConfigurations (list) --
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
SelfManagedEventSource (dict) --
The Self-Managed Apache Kafka cluster for your event source.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
MaximumRecordAgeInSeconds (integer) --
(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.
BisectBatchOnFunctionError (boolean) --
(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts (integer) --
(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.
TumblingWindowInSeconds (integer) --
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
FunctionResponseTypes (list) --
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
{'SourceAccessConfigurations': {'Type': {'VIRTUAL_HOST'}}}
Deletes an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
When you delete an event source mapping, it enters a Deleting state and might not be completely deleted for several seconds.
See also: AWS API Documentation
Request Syntax
client.delete_event_source_mapping( UUID='string' )
string
[REQUIRED]
The identifier of the event source mapping.
dict
Response Syntax
{ 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': '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', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ] }
Response Structure
(dict) --
A mapping between an Amazon Web Services resource and an Lambda function. See CreateEventSourceMapping for details.
UUID (string) --
The identifier of the event source mapping.
StartingPosition (string) --
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
StartingPositionTimestamp (datetime) --
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
BatchSize (integer) --
The maximum number of items to retrieve in a single batch.
MaximumBatchingWindowInSeconds (integer) --
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
ParallelizationFactor (integer) --
(Streams only) The number of batches to process from each shard concurrently. The default value is 1.
EventSourceArn (string) --
The Amazon Resource Name (ARN) of the event source.
FunctionArn (string) --
The ARN of the Lambda function.
LastModified (datetime) --
The date that the event source mapping was last updated, or its state changed.
LastProcessingResult (string) --
The result of the last Lambda invocation of your Lambda function.
State (string) --
The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
StateTransitionReason (string) --
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
DestinationConfig (dict) --
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
Topics (list) --
The name of the Kafka topic.
(string) --
Queues (list) --
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
SourceAccessConfigurations (list) --
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
SelfManagedEventSource (dict) --
The Self-Managed Apache Kafka cluster for your event source.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
MaximumRecordAgeInSeconds (integer) --
(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.
BisectBatchOnFunctionError (boolean) --
(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts (integer) --
(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.
TumblingWindowInSeconds (integer) --
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
FunctionResponseTypes (list) --
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
{'SourceAccessConfigurations': {'Type': {'VIRTUAL_HOST'}}}
Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
See also: AWS API Documentation
Request Syntax
client.get_event_source_mapping( UUID='string' )
string
[REQUIRED]
The identifier of the event source mapping.
dict
Response Syntax
{ 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': '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', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ] }
Response Structure
(dict) --
A mapping between an Amazon Web Services resource and an Lambda function. See CreateEventSourceMapping for details.
UUID (string) --
The identifier of the event source mapping.
StartingPosition (string) --
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
StartingPositionTimestamp (datetime) --
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
BatchSize (integer) --
The maximum number of items to retrieve in a single batch.
MaximumBatchingWindowInSeconds (integer) --
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
ParallelizationFactor (integer) --
(Streams only) The number of batches to process from each shard concurrently. The default value is 1.
EventSourceArn (string) --
The Amazon Resource Name (ARN) of the event source.
FunctionArn (string) --
The ARN of the Lambda function.
LastModified (datetime) --
The date that the event source mapping was last updated, or its state changed.
LastProcessingResult (string) --
The result of the last Lambda invocation of your Lambda function.
State (string) --
The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
StateTransitionReason (string) --
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
DestinationConfig (dict) --
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
Topics (list) --
The name of the Kafka topic.
(string) --
Queues (list) --
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
SourceAccessConfigurations (list) --
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
SelfManagedEventSource (dict) --
The Self-Managed Apache Kafka cluster for your event source.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
MaximumRecordAgeInSeconds (integer) --
(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.
BisectBatchOnFunctionError (boolean) --
(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts (integer) --
(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.
TumblingWindowInSeconds (integer) --
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
FunctionResponseTypes (list) --
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
{'EventSourceMappings': {'SourceAccessConfigurations': {'Type': {'VIRTUAL_HOST'}}}}
Lists event source mappings. Specify an EventSourceArn to only show event source mappings for a single event source.
See also: AWS API Documentation
Request Syntax
client.list_event_source_mappings( EventSourceArn='string', FunctionName='string', Marker='string', MaxItems=123 )
string
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.
string
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.
string
A pagination token returned by a previous call.
integer
The maximum number of event source mappings to return.
dict
Response Syntax
{ 'NextMarker': 'string', 'EventSourceMappings': [ { 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': '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', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ] }, ] }
Response Structure
(dict) --
NextMarker (string) --
A pagination token that's returned when the response doesn't contain all event source mappings.
EventSourceMappings (list) --
A list of event source mappings.
(dict) --
A mapping between an Amazon Web Services resource and an Lambda function. See CreateEventSourceMapping for details.
UUID (string) --
The identifier of the event source mapping.
StartingPosition (string) --
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
StartingPositionTimestamp (datetime) --
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
BatchSize (integer) --
The maximum number of items to retrieve in a single batch.
MaximumBatchingWindowInSeconds (integer) --
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
ParallelizationFactor (integer) --
(Streams only) The number of batches to process from each shard concurrently. The default value is 1.
EventSourceArn (string) --
The Amazon Resource Name (ARN) of the event source.
FunctionArn (string) --
The ARN of the Lambda function.
LastModified (datetime) --
The date that the event source mapping was last updated, or its state changed.
LastProcessingResult (string) --
The result of the last Lambda invocation of your Lambda function.
State (string) --
The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
StateTransitionReason (string) --
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
DestinationConfig (dict) --
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
Topics (list) --
The name of the Kafka topic.
(string) --
Queues (list) --
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
SourceAccessConfigurations (list) --
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
SelfManagedEventSource (dict) --
The Self-Managed Apache Kafka cluster for your event source.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
MaximumRecordAgeInSeconds (integer) --
(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.
BisectBatchOnFunctionError (boolean) --
(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts (integer) --
(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.
TumblingWindowInSeconds (integer) --
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
FunctionResponseTypes (list) --
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
{'SourceAccessConfigurations': {'Type': {'VIRTUAL_HOST'}}}
Updates an event source mapping. You can change the function that 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.
See also: AWS API Documentation
Request Syntax
client.update_event_source_mapping( UUID='string', FunctionName='string', Enabled=True|False, BatchSize=123, 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', 'URI': 'string' }, ], TumblingWindowInSeconds=123, FunctionResponseTypes=[ 'ReportBatchItemFailures', ] )
string
[REQUIRED]
The identifier of the event source mapping.
string
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.
boolean
If true, the event source mapping is active. Set to false to pause polling and invocation.
integer
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.
integer
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds.
dict
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
integer
(Streams only) Discard records older than the specified age. The default value is infinite (-1).
boolean
(Streams only) If the function returns an error, split the batch in two and retry.
integer
(Streams only) 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.
integer
(Streams only) The number of batches to process from each shard concurrently.
list
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
integer
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
list
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --
dict
Response Syntax
{ 'UUID': 'string', 'StartingPosition': 'TRIM_HORIZON'|'LATEST'|'AT_TIMESTAMP', 'StartingPositionTimestamp': datetime(2015, 1, 1), 'BatchSize': 123, 'MaximumBatchingWindowInSeconds': 123, 'ParallelizationFactor': 123, 'EventSourceArn': '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', 'URI': 'string' }, ], 'SelfManagedEventSource': { 'Endpoints': { 'string': [ 'string', ] } }, 'MaximumRecordAgeInSeconds': 123, 'BisectBatchOnFunctionError': True|False, 'MaximumRetryAttempts': 123, 'TumblingWindowInSeconds': 123, 'FunctionResponseTypes': [ 'ReportBatchItemFailures', ] }
Response Structure
(dict) --
A mapping between an Amazon Web Services resource and an Lambda function. See CreateEventSourceMapping for details.
UUID (string) --
The identifier of the event source mapping.
StartingPosition (string) --
The position in a stream from which to start reading. Required for Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources. AT_TIMESTAMP is only supported for Amazon Kinesis streams.
StartingPositionTimestamp (datetime) --
With StartingPosition set to AT_TIMESTAMP, the time from which to start reading.
BatchSize (integer) --
The maximum number of items to retrieve in a single batch.
MaximumBatchingWindowInSeconds (integer) --
(Streams and SQS standard queues) The maximum amount of time to gather records before invoking the function, in seconds. The default value is zero.
ParallelizationFactor (integer) --
(Streams only) The number of batches to process from each shard concurrently. The default value is 1.
EventSourceArn (string) --
The Amazon Resource Name (ARN) of the event source.
FunctionArn (string) --
The ARN of the Lambda function.
LastModified (datetime) --
The date that the event source mapping was last updated, or its state changed.
LastProcessingResult (string) --
The result of the last Lambda invocation of your Lambda function.
State (string) --
The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting.
StateTransitionReason (string) --
Indicates whether the last change to the event source mapping was made by a user, or by the Lambda service.
DestinationConfig (dict) --
(Streams only) An Amazon SQS queue or Amazon SNS topic destination for discarded records.
OnSuccess (dict) --
The destination configuration for successful invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
OnFailure (dict) --
The destination configuration for failed invocations.
Destination (string) --
The Amazon Resource Name (ARN) of the destination resource.
Topics (list) --
The name of the Kafka topic.
(string) --
Queues (list) --
(MQ) The name of the Amazon MQ broker destination queue to consume.
(string) --
SourceAccessConfigurations (list) --
An array of the authentication protocol, or the VPC components to secure your event source.
(dict) --
You can specify the authentication protocol, or the VPC components to secure access to your event source.
Type (string) --
The type of authentication protocol or the VPC components for your event source. For example: "Type":"SASL_SCRAM_512_AUTH".
BASIC_AUTH - (MQ) The Secrets Manager secret that stores your broker credentials.
VPC_SUBNET - The subnets associated with your VPC. Lambda connects to these subnets to fetch data from your Self-Managed Apache Kafka cluster.
VPC_SECURITY_GROUP - The VPC security group used to manage access to your Self-Managed Apache Kafka brokers.
SASL_SCRAM_256_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-256 authentication of your Self-Managed Apache Kafka brokers.
SASL_SCRAM_512_AUTH - The Secrets Manager ARN of your secret key used for SASL SCRAM-512 authentication of your Self-Managed Apache Kafka brokers.
VIRTUAL_HOST - The name of the virtual host in your RabbitMQ broker. Lambda will use this host as the event source.
URI (string) --
The value for your chosen configuration in Type. For example: "URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName".
SelfManagedEventSource (dict) --
The Self-Managed Apache Kafka cluster for your event source.
Endpoints (dict) --
The list of bootstrap servers for your Kafka brokers in the following format: "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"].
(string) --
(list) --
(string) --
MaximumRecordAgeInSeconds (integer) --
(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.
BisectBatchOnFunctionError (boolean) --
(Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
MaximumRetryAttempts (integer) --
(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.
TumblingWindowInSeconds (integer) --
(Streams only) The duration in seconds of a processing window. The range is between 1 second up to 900 seconds.
FunctionResponseTypes (list) --
(Streams only) A list of current response type enums applied to the event source mapping.
(string) --