@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
331 lines (330 loc) • 22.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";
/**
* The ``AWS::Lambda::EventSourceMapping`` resource creates a mapping between an event source and an LAMlong function. LAM 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.
* + [Configuring a Dynamo DB stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)
* + [Configuring a Kinesis stream as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)
* + [Configuring an SQS queue as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)
* + [Configuring an MQ broker as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)
* + [Configuring MSK as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)
* + [Configuring Self-Managed Apache Kafka as an event source](https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)
* + [Configuring Amazon DocumentDB as an event source](https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)
*/
export declare class EventSourceMapping extends pulumi.CustomResource {
/**
* Get an existing EventSourceMapping resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): EventSourceMapping;
/**
* Returns true if the given object is an instance of EventSourceMapping. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is EventSourceMapping;
/**
* Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
*/
readonly amazonManagedKafkaEventSourceConfig: pulumi.Output<outputs.lambda.EventSourceMappingAmazonManagedKafkaEventSourceConfig | undefined>;
/**
* The event source mapping's ID.
*/
readonly awsId: pulumi.Output<string>;
/**
* 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.
*/
readonly batchSize: pulumi.Output<number | undefined>;
/**
* (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
* When using ``BisectBatchOnFunctionError``, check the ``BatchSize`` parameter in the ``OnFailure`` destination message's metadata. The ``BatchSize`` could be greater than 1 since LAM consolidates failed messages metadata when writing to the ``OnFailure`` destination.
*/
readonly bisectBatchOnFunctionError: pulumi.Output<boolean | undefined>;
/**
* (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
*/
readonly destinationConfig: pulumi.Output<outputs.lambda.EventSourceMappingDestinationConfig | undefined>;
/**
* Specific configuration settings for a DocumentDB event source.
*/
readonly documentDbEventSourceConfig: pulumi.Output<outputs.lambda.EventSourceMappingDocumentDbEventSourceConfig | undefined>;
/**
* When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
* Default: True
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* 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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
* + *Amazon MQ* – The ARN of the broker.
* + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
*/
readonly eventSourceArn: pulumi.Output<string | undefined>;
/**
* The Amazon Resource Name (ARN) of the event source mapping.
*/
readonly eventSourceMappingArn: pulumi.Output<string>;
/**
* An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
*/
readonly filterCriteria: pulumi.Output<outputs.lambda.EventSourceMappingFilterCriteria | undefined>;
/**
* 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.
*/
readonly functionName: pulumi.Output<string>;
/**
* (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.
* Valid Values: ``ReportBatchItemFailures``
*/
readonly functionResponseTypes: pulumi.Output<enums.lambda.EventSourceMappingFunctionResponseTypesItem[] | undefined>;
/**
* The ARN of the KMSlong (KMS) customer managed key that Lambda uses to encrypt your function's [filter criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics).
*/
readonly kmsKeyArn: pulumi.Output<string | undefined>;
/**
* The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
* *Default (, , event sources)*: 0
* *Default (, Kafka, , event sources)*: 500 ms
* *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
*/
readonly maximumBatchingWindowInSeconds: pulumi.Output<number | undefined>;
/**
* (Kinesis and DynamoDB 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.
* 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
*/
readonly maximumRecordAgeInSeconds: pulumi.Output<number | undefined>;
/**
* (Kinesis and DynamoDB 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.
*/
readonly maximumRetryAttempts: pulumi.Output<number | undefined>;
/**
* The metrics configuration for your event source. For more information, see [Event source mapping metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics).
*/
readonly metricsConfig: pulumi.Output<outputs.lambda.EventSourceMappingMetricsConfig | undefined>;
/**
* (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
*/
readonly parallelizationFactor: pulumi.Output<number | undefined>;
/**
* (Amazon MSK and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see [provisioned mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode).
*/
readonly provisionedPollerConfig: pulumi.Output<outputs.lambda.EventSourceMappingProvisionedPollerConfig | undefined>;
/**
* (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
*/
readonly queues: pulumi.Output<string[] | undefined>;
/**
* (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
*/
readonly scalingConfig: pulumi.Output<outputs.lambda.EventSourceMappingScalingConfig | undefined>;
/**
* The self-managed Apache Kafka cluster for your event source.
*/
readonly selfManagedEventSource: pulumi.Output<outputs.lambda.EventSourceMappingSelfManagedEventSource | undefined>;
/**
* Specific configuration settings for a self-managed Apache Kafka event source.
*/
readonly selfManagedKafkaEventSourceConfig: pulumi.Output<outputs.lambda.EventSourceMappingSelfManagedKafkaEventSourceConfig | undefined>;
/**
* An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
*/
readonly sourceAccessConfigurations: pulumi.Output<outputs.lambda.EventSourceMappingSourceAccessConfiguration[] | undefined>;
/**
* The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.
* + *LATEST* - Read only new records.
* + *TRIM_HORIZON* - Process all available records.
* + *AT_TIMESTAMP* - Specify a time from which to start reading records.
*/
readonly startingPosition: pulumi.Output<string | undefined>;
/**
* With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
*/
readonly startingPositionTimestamp: pulumi.Output<number | undefined>;
/**
* A list of tags to add to the event source mapping.
* You must have the ``lambda:TagResource``, ``lambda:UntagResource``, and ``lambda:ListTags`` permissions for your [principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CFN stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.
*/
readonly tags: pulumi.Output<outputs.Tag[] | undefined>;
/**
* The name of the Kafka topic.
*/
readonly topics: pulumi.Output<string[] | undefined>;
/**
* (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.
*/
readonly tumblingWindowInSeconds: pulumi.Output<number | undefined>;
/**
* Create a EventSourceMapping resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: EventSourceMappingArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* The set of arguments for constructing a EventSourceMapping resource.
*/
export interface EventSourceMappingArgs {
/**
* Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.
*/
amazonManagedKafkaEventSourceConfig?: pulumi.Input<inputs.lambda.EventSourceMappingAmazonManagedKafkaEventSourceConfigArgs>;
/**
* 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.
*/
batchSize?: pulumi.Input<number>;
/**
* (Kinesis and DynamoDB Streams only) If the function returns an error, split the batch in two and retry. The default value is false.
* When using ``BisectBatchOnFunctionError``, check the ``BatchSize`` parameter in the ``OnFailure`` destination message's metadata. The ``BatchSize`` could be greater than 1 since LAM consolidates failed messages metadata when writing to the ``OnFailure`` destination.
*/
bisectBatchOnFunctionError?: pulumi.Input<boolean>;
/**
* (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka event sources only) A configuration object that specifies the destination of an event after Lambda processes it.
*/
destinationConfig?: pulumi.Input<inputs.lambda.EventSourceMappingDestinationConfigArgs>;
/**
* Specific configuration settings for a DocumentDB event source.
*/
documentDbEventSourceConfig?: pulumi.Input<inputs.lambda.EventSourceMappingDocumentDbEventSourceConfigArgs>;
/**
* When true, the event source mapping is active. When false, Lambda pauses polling and invocation.
* Default: True
*/
enabled?: pulumi.Input<boolean>;
/**
* 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](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)).
* + *Amazon MQ* – The ARN of the broker.
* + *Amazon DocumentDB* – The ARN of the DocumentDB change stream.
*/
eventSourceArn?: pulumi.Input<string>;
/**
* An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see [Lambda event filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html).
*/
filterCriteria?: pulumi.Input<inputs.lambda.EventSourceMappingFilterCriteriaArgs>;
/**
* 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.
*/
functionName: pulumi.Input<string>;
/**
* (Kinesis, DynamoDB Streams, and SQS) A list of current response type enums applied to the event source mapping.
* Valid Values: ``ReportBatchItemFailures``
*/
functionResponseTypes?: pulumi.Input<pulumi.Input<enums.lambda.EventSourceMappingFunctionResponseTypesItem>[]>;
/**
* The ARN of the KMSlong (KMS) customer managed key that Lambda uses to encrypt your function's [filter criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics).
*/
kmsKeyArn?: pulumi.Input<string>;
/**
* The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.
* *Default (, , event sources)*: 0
* *Default (, Kafka, , event sources)*: 500 ms
* *Related setting:* For SQS event sources, when you set ``BatchSize`` to a value greater than 10, you must set ``MaximumBatchingWindowInSeconds`` to at least 1.
*/
maximumBatchingWindowInSeconds?: pulumi.Input<number>;
/**
* (Kinesis and DynamoDB 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.
* 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
*/
maximumRecordAgeInSeconds?: pulumi.Input<number>;
/**
* (Kinesis and DynamoDB 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.
*/
maximumRetryAttempts?: pulumi.Input<number>;
/**
* The metrics configuration for your event source. For more information, see [Event source mapping metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics).
*/
metricsConfig?: pulumi.Input<inputs.lambda.EventSourceMappingMetricsConfigArgs>;
/**
* (Kinesis and DynamoDB Streams only) The number of batches to process concurrently from each shard. The default value is 1.
*/
parallelizationFactor?: pulumi.Input<number>;
/**
* (Amazon MSK and self-managed Apache Kafka only) The provisioned mode configuration for the event source. For more information, see [provisioned mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode).
*/
provisionedPollerConfig?: pulumi.Input<inputs.lambda.EventSourceMappingProvisionedPollerConfigArgs>;
/**
* (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
*/
queues?: pulumi.Input<pulumi.Input<string>[]>;
/**
* (Amazon SQS only) The scaling configuration for the event source. For more information, see [Configuring maximum concurrency for Amazon SQS event sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency).
*/
scalingConfig?: pulumi.Input<inputs.lambda.EventSourceMappingScalingConfigArgs>;
/**
* The self-managed Apache Kafka cluster for your event source.
*/
selfManagedEventSource?: pulumi.Input<inputs.lambda.EventSourceMappingSelfManagedEventSourceArgs>;
/**
* Specific configuration settings for a self-managed Apache Kafka event source.
*/
selfManagedKafkaEventSourceConfig?: pulumi.Input<inputs.lambda.EventSourceMappingSelfManagedKafkaEventSourceConfigArgs>;
/**
* An array of the authentication protocol, VPC components, or virtual host to secure and define your event source.
*/
sourceAccessConfigurations?: pulumi.Input<pulumi.Input<inputs.lambda.EventSourceMappingSourceAccessConfigurationArgs>[]>;
/**
* The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB.
* + *LATEST* - Read only new records.
* + *TRIM_HORIZON* - Process all available records.
* + *AT_TIMESTAMP* - Specify a time from which to start reading records.
*/
startingPosition?: pulumi.Input<string>;
/**
* With ``StartingPosition`` set to ``AT_TIMESTAMP``, the time from which to start reading, in Unix time seconds. ``StartingPositionTimestamp`` cannot be in the future.
*/
startingPositionTimestamp?: pulumi.Input<number>;
/**
* A list of tags to add to the event source mapping.
* You must have the ``lambda:TagResource``, ``lambda:UntagResource``, and ``lambda:ListTags`` permissions for your [principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CFN stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.
*/
tags?: pulumi.Input<pulumi.Input<inputs.TagArgs>[]>;
/**
* The name of the Kafka topic.
*/
topics?: pulumi.Input<pulumi.Input<string>[]>;
/**
* (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.
*/
tumblingWindowInSeconds?: pulumi.Input<number>;
}