event_source_mappings
Creates, updates, deletes, gets or lists an event_source_mappings resource.
Overview
| Name | event_source_mappings |
| Type | Resource |
| Id | aws.lambda.event_source_mappings |
Fields
The following fields are returned by SELECT queries:
- get_event_source_mapping
- list_event_source_mappings
| Name | Datatype | Description |
|---|---|---|
amazon_managed_kafka_event_source_config | object | Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. |
batch_size | integer | 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). Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100. Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. |
bisect_batch_on_function_error | boolean | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If the function returns an error, split the batch in two and retry. The default value is false. |
destination_config | object | A configuration object that specifies the destination of an event after Lambda processes it. For more information, see Adding a destination. |
document_db_event_source_config | object | Specific configuration settings for a DocumentDB event source. |
event_source_arn | string | The Amazon Resource Name (ARN) of the event source. (pattern: <code>arn:(aws[a-zA-Z0-9-]):([a-zA-Z0-9-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1})?:(\d{12})?:(.)</code>) |
event_source_mapping_arn | string | The Amazon Resource Name (ARN) of the event source mapping. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:event-source-mapping:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}</code>) |
filter_criteria | object | An object that contains the filters for an event source. |
filter_criteria_error | object | An object that contains details about an error related to filter criteria encryption. |
function_arn | string | The ARN of the Lambda function. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-]+(:($LATEST|[a-zA-Z0-9-]+))?</code>) |
function_response_types | array | (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. |
kms_key_arn | string | The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. (pattern: <code>(arn:(aws[a-zA-Z-])?:[a-z0-9-.]+:.)|()</code>) |
last_modified | string (date-time) | The date that the event source mapping was last updated or that its state changed. |
last_processing_result | string | The result of the event source mapping's last processing attempt. |
logging_config | object | (Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. Use this configuration object to define the level of logs for your event source mapping. |
maximum_batching_window_in_seconds | integer | The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds. For streams 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 MaximumBatchingWindowInSeconds in 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 streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. |
maximum_record_age_in_seconds | integer | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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 |
maximum_retry_attempts | integer | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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. |
metrics_config | object | The metrics configuration for your event source. Use this configuration object to define which metrics you want your event source mapping to produce. |
parallelization_factor | integer | (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1. |
provisioned_poller_config | object | The provisioned mode configuration for the event source. Use Provisioned Mode to customize the minimum and maximum number of event pollers for your event source. |
queues | array | (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. |
scaling_config | object | (Amazon SQS only) The scaling configuration for the event source. To remove the configuration, pass an empty value. |
self_managed_event_source | object | The self-managed Apache Kafka cluster for your event source. |
self_managed_kafka_event_source_config | object | Specific configuration settings for a self-managed Apache Kafka event source. |
source_access_configurations | array | An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. |
starting_position | string | The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka. (TRIM_HORIZON, LATEST, AT_TIMESTAMP) |
starting_position_timestamp | string (date-time) | With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot be in the future. |
state | string | The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting. |
state_transition_reason | string | Indicates whether a user or Lambda made the last change to the event source mapping. |
topics | array | The name of the Kafka topic. |
tumbling_window_in_seconds | integer | (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. |
uuid | string | The identifier of the event source mapping. |
| Name | Datatype | Description |
|---|---|---|
amazon_managed_kafka_event_source_config | object | Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source. |
batch_size | integer | 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). Default value: Varies by service. For Amazon SQS, the default is 10. For all other services, the default is 100. Related setting: When you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. |
bisect_batch_on_function_error | boolean | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) If the function returns an error, split the batch in two and retry. The default value is false. |
destination_config | object | A configuration object that specifies the destination of an event after Lambda processes it. For more information, see Adding a destination. |
document_db_event_source_config | object | Specific configuration settings for a DocumentDB event source. |
event_source_arn | string | The Amazon Resource Name (ARN) of the event source. (pattern: <code>arn:(aws[a-zA-Z0-9-]):([a-zA-Z0-9-])+:((eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1})?:(\d{12})?:(.)</code>) |
event_source_mapping_arn | string | The Amazon Resource Name (ARN) of the event source mapping. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:event-source-mapping:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}</code>) |
filter_criteria | object | An object that contains the filters for an event source. |
filter_criteria_error | object | An object that contains details about an error related to filter criteria encryption. |
function_arn | string | The ARN of the Lambda function. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-]+(:($LATEST|[a-zA-Z0-9-]+))?</code>) |
function_response_types | array | (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. |
kms_key_arn | string | The ARN of the Key Management Service (KMS) customer managed key that Lambda uses to encrypt your function's filter criteria. (pattern: <code>(arn:(aws[a-zA-Z-])?:[a-z0-9-.]+:.)|()</code>) |
last_modified | string (date-time) | The date that the event source mapping was last updated or that its state changed. |
last_processing_result | string | The result of the event source mapping's last processing attempt. |
logging_config | object | (Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. Use this configuration object to define the level of logs for your event source mapping. |
maximum_batching_window_in_seconds | integer | The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds. For streams 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 MaximumBatchingWindowInSeconds in 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 streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1. |
maximum_record_age_in_seconds | integer | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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 |
maximum_retry_attempts | integer | (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) 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. |
metrics_config | object | The metrics configuration for your event source. Use this configuration object to define which metrics you want your event source mapping to produce. |
parallelization_factor | integer | (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1. |
provisioned_poller_config | object | The provisioned mode configuration for the event source. Use Provisioned Mode to customize the minimum and maximum number of event pollers for your event source. |
queues | array | (Amazon MQ) The name of the Amazon MQ broker destination queue to consume. |
scaling_config | object | (Amazon SQS only) The scaling configuration for the event source. To remove the configuration, pass an empty value. |
self_managed_event_source | object | The self-managed Apache Kafka cluster for your event source. |
self_managed_kafka_event_source_config | object | Specific configuration settings for a self-managed Apache Kafka event source. |
source_access_configurations | array | An array of the authentication protocol, VPC components, or virtual host to secure and define your event source. |
starting_position | string | The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka. (TRIM_HORIZON, LATEST, AT_TIMESTAMP) |
starting_position_timestamp | string (date-time) | With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot be in the future. |
state | string | The state of the event source mapping. It can be one of the following: Creating, Enabling, Enabled, Disabling, Disabled, Updating, or Deleting. |
state_transition_reason | string | Indicates whether a user or Lambda made the last change to the event source mapping. |
topics | array | The name of the Kafka topic. |
tumbling_window_in_seconds | integer | (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. |
uuid | string | The identifier of the event source mapping. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_event_source_mapping | select | uuid, region | Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings. | |
list_event_source_mappings | select | region | EventSourceArn, FunctionName, Marker, MaxItems | Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a single event source. |
create_event_source_mapping | insert | region, FunctionName | Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and invokes the function. For details about how to configure different event sources, see the following topics. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB 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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB | |
update_event_source_mapping | update | uuid, region | 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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB 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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB | |
delete_event_source_mapping | delete | uuid, region | 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. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
uuid | string | The identifier of the event source mapping. |
EventSourceArn | 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 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. |
FunctionName | string | 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. |
Marker | string | A pagination token returned by a previous call. |
MaxItems | integer | The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher. |
SELECT examples
- get_event_source_mapping
- list_event_source_mappings
Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.
SELECT
amazon_managed_kafka_event_source_config,
batch_size,
bisect_batch_on_function_error,
destination_config,
document_db_event_source_config,
event_source_arn,
event_source_mapping_arn,
filter_criteria,
filter_criteria_error,
function_arn,
function_response_types,
kms_key_arn,
last_modified,
last_processing_result,
logging_config,
maximum_batching_window_in_seconds,
maximum_record_age_in_seconds,
maximum_retry_attempts,
metrics_config,
parallelization_factor,
provisioned_poller_config,
queues,
scaling_config,
self_managed_event_source,
self_managed_kafka_event_source_config,
source_access_configurations,
starting_position,
starting_position_timestamp,
state,
state_transition_reason,
topics,
tumbling_window_in_seconds,
uuid
FROM aws.lambda.event_source_mappings
WHERE uuid = '{{ uuid }}' -- required
AND region = '{{ region }}' -- required
;
Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a single event source.
SELECT
amazon_managed_kafka_event_source_config,
batch_size,
bisect_batch_on_function_error,
destination_config,
document_db_event_source_config,
event_source_arn,
event_source_mapping_arn,
filter_criteria,
filter_criteria_error,
function_arn,
function_response_types,
kms_key_arn,
last_modified,
last_processing_result,
logging_config,
maximum_batching_window_in_seconds,
maximum_record_age_in_seconds,
maximum_retry_attempts,
metrics_config,
parallelization_factor,
provisioned_poller_config,
queues,
scaling_config,
self_managed_event_source,
self_managed_kafka_event_source_config,
source_access_configurations,
starting_position,
starting_position_timestamp,
state,
state_transition_reason,
topics,
tumbling_window_in_seconds,
uuid
FROM aws.lambda.event_source_mappings
WHERE region = '{{ region }}' -- required
AND EventSourceArn = '{{ EventSourceArn }}'
AND FunctionName = '{{ FunctionName }}'
AND Marker = '{{ Marker }}'
AND MaxItems = '{{ MaxItems }}'
;
INSERT examples
- create_event_source_mapping
- Manifest
Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and invokes the function. For details about how to configure different event sources, see the following topics. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB 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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB
INSERT INTO aws.lambda.event_source_mappings (
EventSourceArn,
FunctionName,
Enabled,
BatchSize,
FilterCriteria,
KMSKeyArn,
MetricsConfig,
LoggingConfig,
ScalingConfig,
MaximumBatchingWindowInSeconds,
ParallelizationFactor,
StartingPosition,
StartingPositionTimestamp,
DestinationConfig,
MaximumRecordAgeInSeconds,
BisectBatchOnFunctionError,
MaximumRetryAttempts,
Tags,
TumblingWindowInSeconds,
Topics,
Queues,
SourceAccessConfigurations,
SelfManagedEventSource,
FunctionResponseTypes,
AmazonManagedKafkaEventSourceConfig,
SelfManagedKafkaEventSourceConfig,
DocumentDBEventSourceConfig,
ProvisionedPollerConfig,
region
)
SELECT
'{{ EventSourceArn }}',
'{{ FunctionName }}' /* required */,
{{ Enabled }},
{{ BatchSize }},
'{{ FilterCriteria }}',
'{{ KMSKeyArn }}',
'{{ MetricsConfig }}',
'{{ LoggingConfig }}',
'{{ ScalingConfig }}',
{{ MaximumBatchingWindowInSeconds }},
{{ ParallelizationFactor }},
'{{ StartingPosition }}',
'{{ StartingPositionTimestamp }}',
'{{ DestinationConfig }}',
{{ MaximumRecordAgeInSeconds }},
{{ BisectBatchOnFunctionError }},
{{ MaximumRetryAttempts }},
'{{ Tags }}',
{{ TumblingWindowInSeconds }},
'{{ Topics }}',
'{{ Queues }}',
'{{ SourceAccessConfigurations }}',
'{{ SelfManagedEventSource }}',
'{{ FunctionResponseTypes }}',
'{{ AmazonManagedKafkaEventSourceConfig }}',
'{{ SelfManagedKafkaEventSourceConfig }}',
'{{ DocumentDBEventSourceConfig }}',
'{{ ProvisionedPollerConfig }}',
'{{ region }}'
RETURNING
amazon_managed_kafka_event_source_config,
batch_size,
bisect_batch_on_function_error,
destination_config,
document_db_event_source_config,
event_source_arn,
event_source_mapping_arn,
filter_criteria,
filter_criteria_error,
function_arn,
function_response_types,
kms_key_arn,
last_modified,
last_processing_result,
logging_config,
maximum_batching_window_in_seconds,
maximum_record_age_in_seconds,
maximum_retry_attempts,
metrics_config,
parallelization_factor,
provisioned_poller_config,
queues,
scaling_config,
self_managed_event_source,
self_managed_kafka_event_source_config,
source_access_configurations,
starting_position,
starting_position_timestamp,
state,
state_transition_reason,
topics,
tumbling_window_in_seconds,
uuid
;
# Description fields are for documentation purposes
- name: event_source_mappings
props:
- name: region
value: "{{ region }}"
description: Required parameter for the event_source_mappings resource.
- name: EventSourceArn
value: "{{ EventSourceArn }}"
- name: FunctionName
value: "{{ FunctionName }}"
- name: Enabled
value: {{ Enabled }}
- name: BatchSize
value: {{ BatchSize }}
- name: FilterCriteria
description: |
An object that contains the filters for an event source.
value:
Filters:
- Pattern: "{{ Pattern }}"
- name: KMSKeyArn
value: "{{ KMSKeyArn }}"
- name: MetricsConfig
description: |
The metrics configuration for your event source. Use this configuration object to define which metrics you want your event source mapping to produce.
value:
Metrics:
- "{{ Metrics }}"
- name: LoggingConfig
description: |
(Amazon MSK, and self-managed Apache Kafka only) The logging configuration for your event source. Use this configuration object to define the level of logs for your event source mapping.
value:
SystemLogLevel: "{{ SystemLogLevel }}"
- name: ScalingConfig
description: |
(Amazon SQS only) The scaling configuration for the event source. To remove the configuration, pass an empty value.
value:
MaximumConcurrency: {{ MaximumConcurrency }}
- name: MaximumBatchingWindowInSeconds
value: {{ MaximumBatchingWindowInSeconds }}
- name: ParallelizationFactor
value: {{ ParallelizationFactor }}
- name: StartingPosition
value: "{{ StartingPosition }}"
valid_values: ['TRIM_HORIZON', 'LATEST', 'AT_TIMESTAMP']
- name: StartingPositionTimestamp
value: "{{ StartingPositionTimestamp }}"
- name: DestinationConfig
description: |
A configuration object that specifies the destination of an event after Lambda processes it. For more information, see Adding a destination.
value:
OnSuccess:
Destination: "{{ Destination }}"
OnFailure:
Destination: "{{ Destination }}"
- name: MaximumRecordAgeInSeconds
value: {{ MaximumRecordAgeInSeconds }}
- name: BisectBatchOnFunctionError
value: {{ BisectBatchOnFunctionError }}
- name: MaximumRetryAttempts
value: {{ MaximumRetryAttempts }}
- name: Tags
value: "{{ Tags }}"
- name: TumblingWindowInSeconds
value: {{ TumblingWindowInSeconds }}
- name: Topics
value:
- "{{ Topics }}"
- name: Queues
value:
- "{{ Queues }}"
- name: SourceAccessConfigurations
value:
- Type: "{{ Type }}"
URI: "{{ URI }}"
- name: SelfManagedEventSource
description: |
The self-managed Apache Kafka cluster for your event source.
value:
Endpoints: "{{ Endpoints }}"
- name: FunctionResponseTypes
value:
- "{{ FunctionResponseTypes }}"
- name: AmazonManagedKafkaEventSourceConfig
description: |
Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
value:
ConsumerGroupId: "{{ ConsumerGroupId }}"
SchemaRegistryConfig:
SchemaRegistryURI: "{{ SchemaRegistryURI }}"
EventRecordFormat: "{{ EventRecordFormat }}"
AccessConfigs:
- Type: "{{ Type }}"
URI: "{{ URI }}"
SchemaValidationConfigs:
- Attribute: "{{ Attribute }}"
- name: SelfManagedKafkaEventSourceConfig
description: |
Specific configuration settings for a self-managed Apache Kafka event source.
value:
ConsumerGroupId: "{{ ConsumerGroupId }}"
SchemaRegistryConfig:
SchemaRegistryURI: "{{ SchemaRegistryURI }}"
EventRecordFormat: "{{ EventRecordFormat }}"
AccessConfigs:
- Type: "{{ Type }}"
URI: "{{ URI }}"
SchemaValidationConfigs:
- Attribute: "{{ Attribute }}"
- name: DocumentDBEventSourceConfig
description: |
Specific configuration settings for a DocumentDB event source.
value:
DatabaseName: "{{ DatabaseName }}"
CollectionName: "{{ CollectionName }}"
FullDocument: "{{ FullDocument }}"
- name: ProvisionedPollerConfig
description: |
The provisioned mode configuration for the event source. Use Provisioned Mode to customize the minimum and maximum number of event pollers for your event source.
value:
MinimumPollers: {{ MinimumPollers }}
MaximumPollers: {{ MaximumPollers }}
PollerGroupName: "{{ PollerGroupName }}"
UPDATE examples
- update_event_source_mapping
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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB 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. Amazon DynamoDB Streams Amazon Kinesis Amazon SQS Amazon MQ and RabbitMQ Amazon MSK Apache Kafka Amazon DocumentDB
UPDATE aws.lambda.event_source_mappings
SET
FunctionName = '{{ FunctionName }}',
Enabled = {{ Enabled }},
BatchSize = {{ BatchSize }},
FilterCriteria = '{{ FilterCriteria }}',
KMSKeyArn = '{{ KMSKeyArn }}',
MetricsConfig = '{{ MetricsConfig }}',
LoggingConfig = '{{ LoggingConfig }}',
ScalingConfig = '{{ ScalingConfig }}',
MaximumBatchingWindowInSeconds = {{ MaximumBatchingWindowInSeconds }},
ParallelizationFactor = {{ ParallelizationFactor }},
DestinationConfig = '{{ DestinationConfig }}',
MaximumRecordAgeInSeconds = {{ MaximumRecordAgeInSeconds }},
BisectBatchOnFunctionError = {{ BisectBatchOnFunctionError }},
MaximumRetryAttempts = {{ MaximumRetryAttempts }},
TumblingWindowInSeconds = {{ TumblingWindowInSeconds }},
SourceAccessConfigurations = '{{ SourceAccessConfigurations }}',
FunctionResponseTypes = '{{ FunctionResponseTypes }}',
AmazonManagedKafkaEventSourceConfig = '{{ AmazonManagedKafkaEventSourceConfig }}',
SelfManagedKafkaEventSourceConfig = '{{ SelfManagedKafkaEventSourceConfig }}',
DocumentDBEventSourceConfig = '{{ DocumentDBEventSourceConfig }}',
ProvisionedPollerConfig = '{{ ProvisionedPollerConfig }}'
WHERE
uuid = '{{ uuid }}' --required
AND region = '{{ region }}' --required
RETURNING
amazon_managed_kafka_event_source_config,
batch_size,
bisect_batch_on_function_error,
destination_config,
document_db_event_source_config,
event_source_arn,
event_source_mapping_arn,
filter_criteria,
filter_criteria_error,
function_arn,
function_response_types,
kms_key_arn,
last_modified,
last_processing_result,
logging_config,
maximum_batching_window_in_seconds,
maximum_record_age_in_seconds,
maximum_retry_attempts,
metrics_config,
parallelization_factor,
provisioned_poller_config,
queues,
scaling_config,
self_managed_event_source,
self_managed_kafka_event_source_config,
source_access_configurations,
starting_position,
starting_position_timestamp,
state,
state_transition_reason,
topics,
tumbling_window_in_seconds,
uuid;
DELETE examples
- delete_event_source_mapping
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.
DELETE FROM aws.lambda.event_source_mappings
WHERE uuid = '{{ uuid }}' --required
AND region = '{{ region }}' --required
;