Show / Hide Table of Contents

Class EventSourceMapping

Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB and SQS.

For information about Lambda and how to use it, see What is AWS Lambda?. For information about event source mappings, see CreateEventSourceMapping in the API docs.

Example Usage

DynamoDB

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Lambda.EventSourceMapping("example", new Aws.Lambda.EventSourceMappingArgs
    {
        EventSourceArn = aws_dynamodb_table.Example.Stream_arn,
        FunctionName = aws_lambda_function.Example.Arn,
        StartingPosition = "LATEST",
    });
}

}

Kinesis

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Lambda.EventSourceMapping("example", new Aws.Lambda.EventSourceMappingArgs
    {
        EventSourceArn = aws_kinesis_stream.Example.Arn,
        FunctionName = aws_lambda_function.Example.Arn,
        StartingPosition = "LATEST",
    });
}

}

SQS

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.Lambda.EventSourceMapping("example", new Aws.Lambda.EventSourceMappingArgs
    {
        EventSourceArn = aws_sqs_queue.Sqs_queue_test.Arn,
        FunctionName = aws_lambda_function.Example.Arn,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
EventSourceMapping
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Lambda
Assembly: Pulumi.Aws.dll
Syntax
public class EventSourceMapping : CustomResource

Constructors

View Source

EventSourceMapping(String, EventSourceMappingArgs, CustomResourceOptions)

Create a EventSourceMapping resource with the given unique name, arguments, and options.

Declaration
public EventSourceMapping(string name, EventSourceMappingArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

EventSourceMappingArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

BatchSize

The largest number of records that Lambda will retrieve from your event source at the time of invocation. Defaults to 100 for DynamoDB and Kinesis, 10 for SQS.

Declaration
public Output<int?> BatchSize { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

BisectBatchOnFunctionError

Declaration
public Output<bool?> BisectBatchOnFunctionError { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

DestinationConfig

Declaration
public Output<EventSourceMappingDestinationConfig> DestinationConfig { get; }
Property Value
Type Description
Output<EventSourceMappingDestinationConfig>
View Source

Enabled

Determines if the mapping will be enabled on creation. Defaults to true.

Declaration
public Output<bool?> Enabled { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

EventSourceArn

The event source ARN - can be a Kinesis stream, DynamoDB stream, or SQS queue.

Declaration
public Output<string> EventSourceArn { get; }
Property Value
Type Description
Output<System.String>
View Source

FunctionArn

The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from function_name above.)

Declaration
public Output<string> FunctionArn { get; }
Property Value
Type Description
Output<System.String>
View Source

FunctionName

The name or the ARN of the Lambda function that will be subscribing to events.

Declaration
public Output<string> FunctionName { get; }
Property Value
Type Description
Output<System.String>
View Source

LastModified

The date this resource was last modified.

Declaration
public Output<string> LastModified { get; }
Property Value
Type Description
Output<System.String>
View Source

LastProcessingResult

The result of the last AWS Lambda invocation of your Lambda function.

Declaration
public Output<string> LastProcessingResult { get; }
Property Value
Type Description
Output<System.String>
View Source

MaximumBatchingWindowInSeconds

The maximum amount of time to gather records before invoking the function, in seconds. Records will continue to buffer until either maximum_batching_window_in_seconds expires or batch_size has been met. Defaults to as soon as records are available in the stream. If the batch it reads from the stream only has one record in it, Lambda only sends one record to the function.

Declaration
public Output<int?> MaximumBatchingWindowInSeconds { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

MaximumRecordAgeInSeconds

Declaration
public Output<int> MaximumRecordAgeInSeconds { get; }
Property Value
Type Description
Output<System.Int32>
View Source

MaximumRetryAttempts

Declaration
public Output<int> MaximumRetryAttempts { get; }
Property Value
Type Description
Output<System.Int32>
View Source

ParallelizationFactor

Declaration
public Output<int> ParallelizationFactor { get; }
Property Value
Type Description
Output<System.Int32>
View Source

StartingPosition

The position in the stream where AWS Lambda should start reading. Must be one of AT_TIMESTAMP (Kinesis only), LATEST or TRIM_HORIZON if getting events from Kinesis or DynamoDB. Must not be provided if getting events from SQS. More information about these positions can be found in the AWS DynamoDB Streams API Reference and AWS Kinesis API Reference.

Declaration
public Output<string> StartingPosition { get; }
Property Value
Type Description
Output<System.String>
View Source

StartingPositionTimestamp

A timestamp in RFC3339 format of the data record which to start reading when using starting_position set to AT_TIMESTAMP. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen.

  • parallelization_factor: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10.
  • maximum_retry_attempts: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum of 0, maximum and default of 10000.
  • maximum_record_age_in_seconds: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Minimum of 60, maximum and default of 604800.
  • bisect_batch_on_function_error: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to false.
  • destination_config: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.
Declaration
public Output<string> StartingPositionTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

State

The state of the event source mapping.

Declaration
public Output<string> State { get; }
Property Value
Type Description
Output<System.String>
View Source

StateTransitionReason

The reason the event source mapping is in its current state.

Declaration
public Output<string> StateTransitionReason { get; }
Property Value
Type Description
Output<System.String>
View Source

Uuid

The UUID of the created event source mapping.

Declaration
public Output<string> Uuid { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, EventSourceMappingState, CustomResourceOptions)

Get an existing EventSourceMapping resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static EventSourceMapping Get(string name, Input<string> id, EventSourceMappingState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

EventSourceMappingState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
EventSourceMapping
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.