Fork me on GitHub

Module lambda

@pulumi/aws > lambda

Index

lambda/alias.ts lambda/eventSourceMapping.ts lambda/function.ts lambda/getFunction.ts lambda/getInvocation.ts lambda/lambdaMixins.ts lambda/permission.ts lambda/runtimes.ts

class Alias

Creates a Lambda function alias. Creates an alias that points to the specified Lambda function version.

For information about Lambda and how to use it, see [What is AWS Lambda?][1] For information about function aliases, see [CreateAlias][2] and [AliasRoutingConfiguration][3] in the API docs.

constructor

new Alias(name: string, args: AliasArgs, opts?: pulumi.CustomResourceOptions)

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

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AliasState): Alias

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) identifying your Lambda function alias.

property description

public description: pulumi.Output<string | undefined>;

Description of the alias.

property functionName

public functionName: pulumi.Output<string>;

The function ARN of the Lambda function for which you want to create an alias.

property functionVersion

public functionVersion: pulumi.Output<string>;

Lambda function version for which you are creating the alias. Pattern: (\$LATEST|[0-9]+).

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Name for the alias you are creating. Pattern: (?!^[0-9]+$)([a-zA-Z0-9-_]+)

property routingConfig

public routingConfig: pulumi.Output<{ ... } | undefined>;

The Lambda alias’ route configuration settings. Fields documented below

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class CallbackFunction

A CallbackFunction is a special type of aws.lambda.Function that can be created out of an actual JavaScript function instance. The function instance will be analyzed and packaged up (including dependencies) into a form that can be used by AWS Lambda. See https://github.com/pulumi/docs/blob/master/reference/serializing-functions.md for additional details on this process.

constructor

public new CallbackFunction(name: string, args: CallbackFunctionArgs<E, R>, opts?: pulumi.ResourceOptions)

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FunctionState): Function

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function.

property code

public code: pulumi.Output<pulumi.asset.Archive | undefined>;

The path to the function’s deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.

property deadLetterConfig

public deadLetterConfig: pulumi.Output<{ ... } | undefined>;

Nested block to configure the function’s dead letter queue. See details below.

property description

public description: pulumi.Output<string | undefined>;

Description of what your Lambda Function does.

property environment

public environment: pulumi.Output<{ ... } | undefined>;

The Lambda environment’s configuration settings. Fields documented below.

property handler

public handler: pulumi.Output<string>;

The function [entrypoint][3] in your code.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property invokeArn

public invokeArn: pulumi.Output<string>;

The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration’s uri

property kmsKeyArn

public kmsKeyArn: pulumi.Output<string | undefined>;

The ARN for the KMS encryption key.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property memorySize

public memorySize: pulumi.Output<number | undefined>;

Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. See [Limits][5]

property name

public name: pulumi.Output<string>;

A unique name for your Lambda Function.

property publish

public publish: pulumi.Output<boolean | undefined>;

Whether to publish creation/change as new Lambda Function Version. Defaults to false.

property qualifiedArn

public qualifiedArn: pulumi.Output<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function Version (if versioning is enabled via publish = true).

property reservedConcurrentExecutions

public reservedConcurrentExecutions: pulumi.Output<number | undefined>;

The amount of reserved concurrent executions for this lambda function. Defaults to Unreserved Concurrency Limits. See [Managing Concurrency][9]

property role

public role: pulumi.Output<ARN>;

IAM role attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See [Lambda Permission Model][4] for more details.

property roleInstance

roleInstance?: iam.Role;

property runtime

public runtime: pulumi.Output<string>;

See [Runtimes][6] for valid values.

property s3Bucket

public s3Bucket: pulumi.Output<string | undefined>;

The S3 bucket location containing the function’s deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.

property s3Key

public s3Key: pulumi.Output<string | undefined>;

The S3 key of an object containing the function’s deployment package. Conflicts with filename.

property s3ObjectVersion

public s3ObjectVersion: pulumi.Output<string | undefined>;

The object version containing the function’s deployment package. Conflicts with filename.

property sourceCodeHash

public sourceCodeHash: pulumi.Output<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${base64sha256(file("file.zip"))}, where “file.zip” is the local filename of the lambda function source archive.

property sourceCodeSize

public sourceCodeSize: pulumi.Output<number>;

The size in bytes of the function .zip file.

property tags

public tags: pulumi.Output<Tags | undefined>;

A mapping of tags to assign to the object.

property timeout

public timeout: pulumi.Output<number | undefined>;

The amount of time your Lambda Function has to run in seconds. Defaults to 3. See [Limits][5]

property tracingConfig

public tracingConfig: pulumi.Output<{ ... }>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property version

public version: pulumi.Output<string>;

Latest published version of your Lambda Function.

property vpcConfig

public vpcConfig: pulumi.Output<{ ... } | undefined>;

Provide this to allow your function to access your VPC. Fields documented below. See [Lambda in VPC][7]

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?][1] For information about event source mappings, see [CreateEventSourceMapping][2] in the API docs.

constructor

new EventSourceMapping(name: string, args: EventSourceMappingArgs, opts?: pulumi.CustomResourceOptions)

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

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: EventSourceMappingState): EventSourceMapping

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property batchSize

public batchSize: pulumi.Output<number | undefined>;

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.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

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

property eventSourceArn

public eventSourceArn: pulumi.Output<string>;

The event source ARN - can either be a Kinesis or DynamoDB stream.

property functionArn

public functionArn: pulumi.Output<string>;

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.)

property functionName

public functionName: pulumi.Output<string>;

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

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property lastProcessingResult

public lastProcessingResult: pulumi.Output<string>;

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

property startingPosition

public startingPosition: pulumi.Output<string | undefined>;

The position in the stream where AWS Lambda should start reading. Must be one of either TRIM_HORIZON or LATEST if getting events from Kinesis or DynamoDB. Must not be provided if getting events from SQS.

property state

public state: pulumi.Output<string>;

The state of the event source mapping.

property stateTransitionReason

public stateTransitionReason: pulumi.Output<string>;

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

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property uuid

public uuid: pulumi.Output<string>;

The UUID of the created event source mapping.

class EventSubscription

Base type for all subscription types. An event subscription represents a connection between some AWS resource an an AWS lambda that will be triggered when something happens to that resource.

constructor

public new EventSubscription(type: string, name: string, props: Record<string, any>, opts?: pulumi.ResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

method registerOutputs

protected registerOutputs(outputs: Inputs | Promise<Inputs> | Output<Inputs> | undefined): void

property func

public func: LambdaFunction;

property permission

public permission: permission.Permission;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Function

Provides a Lambda Function resource. Lambda allows you to trigger execution of code in response to events in AWS. The Lambda Function itself includes source code and runtime configuration.

For information about Lambda and how to use it, see [What is AWS Lambda?][1]

constructor

new Function(name: string, args: FunctionArgs, opts?: pulumi.CustomResourceOptions)

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

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FunctionState): Function

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property arn

public arn: pulumi.Output<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function.

property code

public code: pulumi.Output<pulumi.asset.Archive | undefined>;

The path to the function’s deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.

property deadLetterConfig

public deadLetterConfig: pulumi.Output<{ ... } | undefined>;

Nested block to configure the function’s dead letter queue. See details below.

property description

public description: pulumi.Output<string | undefined>;

Description of what your Lambda Function does.

property environment

public environment: pulumi.Output<{ ... } | undefined>;

The Lambda environment’s configuration settings. Fields documented below.

property handler

public handler: pulumi.Output<string>;

The function [entrypoint][3] in your code.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property invokeArn

public invokeArn: pulumi.Output<string>;

The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration’s uri

property kmsKeyArn

public kmsKeyArn: pulumi.Output<string | undefined>;

The ARN for the KMS encryption key.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property memorySize

public memorySize: pulumi.Output<number | undefined>;

Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. See [Limits][5]

property name

public name: pulumi.Output<string>;

A unique name for your Lambda Function.

property publish

public publish: pulumi.Output<boolean | undefined>;

Whether to publish creation/change as new Lambda Function Version. Defaults to false.

property qualifiedArn

public qualifiedArn: pulumi.Output<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function Version (if versioning is enabled via publish = true).

property reservedConcurrentExecutions

public reservedConcurrentExecutions: pulumi.Output<number | undefined>;

The amount of reserved concurrent executions for this lambda function. Defaults to Unreserved Concurrency Limits. See [Managing Concurrency][9]

property role

public role: pulumi.Output<ARN>;

IAM role attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See [Lambda Permission Model][4] for more details.

property runtime

public runtime: pulumi.Output<string>;

See [Runtimes][6] for valid values.

property s3Bucket

public s3Bucket: pulumi.Output<string | undefined>;

The S3 bucket location containing the function’s deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.

property s3Key

public s3Key: pulumi.Output<string | undefined>;

The S3 key of an object containing the function’s deployment package. Conflicts with filename.

property s3ObjectVersion

public s3ObjectVersion: pulumi.Output<string | undefined>;

The object version containing the function’s deployment package. Conflicts with filename.

property sourceCodeHash

public sourceCodeHash: pulumi.Output<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${base64sha256(file("file.zip"))}, where “file.zip” is the local filename of the lambda function source archive.

property sourceCodeSize

public sourceCodeSize: pulumi.Output<number>;

The size in bytes of the function .zip file.

property tags

public tags: pulumi.Output<Tags | undefined>;

A mapping of tags to assign to the object.

property timeout

public timeout: pulumi.Output<number | undefined>;

The amount of time your Lambda Function has to run in seconds. Defaults to 3. See [Limits][5]

property tracingConfig

public tracingConfig: pulumi.Output<{ ... }>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property version

public version: pulumi.Output<string>;

Latest published version of your Lambda Function.

property vpcConfig

public vpcConfig: pulumi.Output<{ ... } | undefined>;

Provide this to allow your function to access your VPC. Fields documented below. See [Lambda in VPC][7]

class Permission

Creates a Lambda permission to allow external sources invoking the Lambda function (e.g. CloudWatch Event Rule, SNS or S3).

constructor

new Permission(name: string, args: PermissionArgs, opts?: pulumi.CustomResourceOptions)

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

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PermissionState): Permission

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property action

public action: pulumi.Output<string>;

The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)

property eventSourceToken

public eventSourceToken: pulumi.Output<string | undefined>;

The Event Source Token to validate. Used with [Alexa Skills][1].

property function

public function: pulumi.Output<Function>;

Name of the Lambda function whose resource policy you are updating

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property principal

public principal: pulumi.Output<string>;

The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com.

property qualifier

public qualifier: pulumi.Output<string | undefined>;

Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2

property sourceAccount

public sourceAccount: pulumi.Output<string | undefined>;

This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner.

property sourceArn

public sourceArn: pulumi.Output<string | undefined>;

When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. API Gateway ARNs have a unique structure described here.

property statementId

public statementId: pulumi.Output<string>;

A unique statement identifier. By default generated by Terraform.

property statementIdPrefix

public statementIdPrefix: pulumi.Output<string | undefined>;

A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with statement_id.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function createFunctionFromEventHandler

createFunctionFromEventHandler<E,R>(name: string, handler: EventHandler<E, R>, opts?: pulumi.ResourceOptions): LambdaFunction

function getFunction

getFunction(args: GetFunctionArgs, opts?: pulumi.InvokeOptions): Promise<GetFunctionResult>

Provides information about a Lambda Function.

function getInvocation

getInvocation(args: GetInvocationArgs, opts?: pulumi.InvokeOptions): Promise<GetInvocationResult>

Use this data source to invoke custom lambda functions as data source. The lambda function is invoked with RequestResponse invocation type.

interface AliasArgs

The set of arguments for constructing a Alias resource.

property description

description?: pulumi.Input<string>;

Description of the alias.

property functionName

functionName: pulumi.Input<string>;

The function ARN of the Lambda function for which you want to create an alias.

property functionVersion

functionVersion: pulumi.Input<string>;

Lambda function version for which you are creating the alias. Pattern: (\$LATEST|[0-9]+).

property name

name?: pulumi.Input<string>;

Name for the alias you are creating. Pattern: (?!^[0-9]+$)([a-zA-Z0-9-_]+)

property routingConfig

routingConfig?: pulumi.Input<{ ... }>;

The Lambda alias’ route configuration settings. Fields documented below

interface AliasState

Input properties used for looking up and filtering Alias resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) identifying your Lambda function alias.

property description

description?: pulumi.Input<string>;

Description of the alias.

property functionName

functionName?: pulumi.Input<string>;

The function ARN of the Lambda function for which you want to create an alias.

property functionVersion

functionVersion?: pulumi.Input<string>;

Lambda function version for which you are creating the alias. Pattern: (\$LATEST|[0-9]+).

property name

name?: pulumi.Input<string>;

Name for the alias you are creating. Pattern: (?!^[0-9]+$)([a-zA-Z0-9-_]+)

property routingConfig

routingConfig?: pulumi.Input<{ ... }>;

The Lambda alias’ route configuration settings. Fields documented below

interface Context

Context is the shape of the context object passed to a Function callback. For more information, see: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html

method getRemainingTimeInMillis

getRemainingTimeInMillis(): string

Returns the approximate remaining execution time (before timeout occurs) of the Lambda function that is currently executing. The timeout is one of the Lambda function configuration. When the timeout reaches, AWS Lambda terminates your Lambda function.

You can use this method to check the remaining time during your function execution and take appropriate corrective action at run time.

property awsRequestId

awsRequestId: string;

AWS request ID associated with the request. This is the ID returned to the client that called the invoke method.

If AWS Lambda retries the invocation (for example, in a situation where the Lambda function that is processing Kinesis records throws an exception), the request ID remains the same.

property callbackWaitsForEmptyEventLoop

callbackWaitsForEmptyEventLoop: boolean;

The default value is true. This property is useful only to modify the default behavior of the callback. By default, the callback will wait until the event loop is empty before freezing the process and returning the results to the caller. You can set this property to false to request AWS Lambda to freeze the process soon after the callback is called, even if there are events in the event loop. AWS Lambda will freeze the process, any state data and the events in the event loop (any remaining events in the event loop processed when the Lambda function is called next and if AWS Lambda chooses to use the frozen process).

property clientContext

clientContext: any;

Information about the client application and device when invoked through the AWS Mobile SDK. It can be null.

property functionName

functionName: string;

Name of the Lambda function that is executing.

property functionVersion

functionVersion: string;

The Lambda function version that is executing. If an alias is used to invoke the function, then function_version will be the version the alias points to.

property identity

identity: any;

Information about the Amazon Cognito identity provider when invoked through the AWS Mobile SDK. It can be null.

property invokedFunctionArn

invokedFunctionArn: string;

The ARN used to invoke this function. It can be a function ARN or an alias ARN. An unqualified ARN executes the $LATEST version and aliases execute the function version it is pointing to.

property logGroupName

logGroupName: string;

The name of the CloudWatch log group where you can find logs written by your Lambda function.

property logStreamName

logStreamName: string;

The name of the CloudWatch log group where you can find logs written by your Lambda function. The log stream may or may not change for each invocation of the Lambda function.

The value is null if your Lambda function is unable to create a log stream, which can happen if the execution role that grants necessary permissions to the Lambda function does not include permissions for the CloudWatch actions.

property memoryLimitInMB

memoryLimitInMB: string;

Memory limit, in MB, you configured for the Lambda function. You set the memory limit at the time you create a Lambda function and you can change it later.

interface EventSourceMappingArgs

The set of arguments for constructing a EventSourceMapping resource.

property batchSize

batchSize?: pulumi.Input<number>;

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.

property enabled

enabled?: pulumi.Input<boolean>;

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

property eventSourceArn

eventSourceArn: pulumi.Input<string>;

The event source ARN - can either be a Kinesis or DynamoDB stream.

property functionName

functionName: pulumi.Input<string>;

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

property startingPosition

startingPosition?: pulumi.Input<string>;

The position in the stream where AWS Lambda should start reading. Must be one of either TRIM_HORIZON or LATEST if getting events from Kinesis or DynamoDB. Must not be provided if getting events from SQS.

interface EventSourceMappingState

Input properties used for looking up and filtering EventSourceMapping resources.

property batchSize

batchSize?: pulumi.Input<number>;

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.

property enabled

enabled?: pulumi.Input<boolean>;

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

property eventSourceArn

eventSourceArn?: pulumi.Input<string>;

The event source ARN - can either be a Kinesis or DynamoDB stream.

property functionArn

functionArn?: pulumi.Input<string>;

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.)

property functionName

functionName?: pulumi.Input<string>;

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

property lastModified

lastModified?: pulumi.Input<string>;

The date this resource was last modified.

property lastProcessingResult

lastProcessingResult?: pulumi.Input<string>;

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

property startingPosition

startingPosition?: pulumi.Input<string>;

The position in the stream where AWS Lambda should start reading. Must be one of either TRIM_HORIZON or LATEST if getting events from Kinesis or DynamoDB. Must not be provided if getting events from SQS.

property state

state?: pulumi.Input<string>;

The state of the event source mapping.

property stateTransitionReason

stateTransitionReason?: pulumi.Input<string>;

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

property uuid

uuid?: pulumi.Input<string>;

The UUID of the created event source mapping.

interface FunctionArgs

The set of arguments for constructing a Function resource.

property code

code?: pulumi.Input<pulumi.asset.Archive>;

The path to the function’s deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.

property deadLetterConfig

deadLetterConfig?: pulumi.Input<{ ... }>;

Nested block to configure the function’s dead letter queue. See details below.

property description

description?: pulumi.Input<string>;

Description of what your Lambda Function does.

property environment

environment?: pulumi.Input<{ ... }>;

The Lambda environment’s configuration settings. Fields documented below.

property handler

handler: pulumi.Input<string>;

The function [entrypoint][3] in your code.

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

The ARN for the KMS encryption key.

property memorySize

memorySize?: pulumi.Input<number>;

Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. See [Limits][5]

property name

name?: pulumi.Input<string>;

A unique name for your Lambda Function.

property publish

publish?: pulumi.Input<boolean>;

Whether to publish creation/change as new Lambda Function Version. Defaults to false.

property reservedConcurrentExecutions

reservedConcurrentExecutions?: pulumi.Input<number>;

The amount of reserved concurrent executions for this lambda function. Defaults to Unreserved Concurrency Limits. See [Managing Concurrency][9]

property role

role: pulumi.Input<ARN>;

IAM role attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See [Lambda Permission Model][4] for more details.

property runtime

runtime: pulumi.Input<string>;

See [Runtimes][6] for valid values.

property s3Bucket

s3Bucket?: pulumi.Input<string>;

The S3 bucket location containing the function’s deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.

property s3Key

s3Key?: pulumi.Input<string>;

The S3 key of an object containing the function’s deployment package. Conflicts with filename.

property s3ObjectVersion

s3ObjectVersion?: pulumi.Input<string>;

The object version containing the function’s deployment package. Conflicts with filename.

property sourceCodeHash

sourceCodeHash?: pulumi.Input<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${base64sha256(file("file.zip"))}, where “file.zip” is the local filename of the lambda function source archive.

property tags

tags?: pulumi.Input<Tags>;

A mapping of tags to assign to the object.

property timeout

timeout?: pulumi.Input<number>;

The amount of time your Lambda Function has to run in seconds. Defaults to 3. See [Limits][5]

property tracingConfig

tracingConfig?: pulumi.Input<{ ... }>;

property vpcConfig

vpcConfig?: pulumi.Input<{ ... }>;

Provide this to allow your function to access your VPC. Fields documented below. See [Lambda in VPC][7]

interface FunctionState

Input properties used for looking up and filtering Function resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function.

property code

code?: pulumi.Input<pulumi.asset.Archive>;

The path to the function’s deployment package within the local filesystem. If defined, The s3_-prefixed options cannot be used.

property deadLetterConfig

deadLetterConfig?: pulumi.Input<{ ... }>;

Nested block to configure the function’s dead letter queue. See details below.

property description

description?: pulumi.Input<string>;

Description of what your Lambda Function does.

property environment

environment?: pulumi.Input<{ ... }>;

The Lambda environment’s configuration settings. Fields documented below.

property handler

handler?: pulumi.Input<string>;

The function [entrypoint][3] in your code.

property invokeArn

invokeArn?: pulumi.Input<string>;

The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_integration’s uri

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

The ARN for the KMS encryption key.

property lastModified

lastModified?: pulumi.Input<string>;

The date this resource was last modified.

property memorySize

memorySize?: pulumi.Input<number>;

Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. See [Limits][5]

property name

name?: pulumi.Input<string>;

A unique name for your Lambda Function.

property publish

publish?: pulumi.Input<boolean>;

Whether to publish creation/change as new Lambda Function Version. Defaults to false.

property qualifiedArn

qualifiedArn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) identifying your Lambda Function Version (if versioning is enabled via publish = true).

property reservedConcurrentExecutions

reservedConcurrentExecutions?: pulumi.Input<number>;

The amount of reserved concurrent executions for this lambda function. Defaults to Unreserved Concurrency Limits. See [Managing Concurrency][9]

property role

role?: pulumi.Input<ARN>;

IAM role attached to the Lambda Function. This governs both who / what can invoke your Lambda Function, as well as what resources our Lambda Function has access to. See [Lambda Permission Model][4] for more details.

property runtime

runtime?: pulumi.Input<string>;

See [Runtimes][6] for valid values.

property s3Bucket

s3Bucket?: pulumi.Input<string>;

The S3 bucket location containing the function’s deployment package. Conflicts with filename. This bucket must reside in the same AWS region where you are creating the Lambda function.

property s3Key

s3Key?: pulumi.Input<string>;

The S3 key of an object containing the function’s deployment package. Conflicts with filename.

property s3ObjectVersion

s3ObjectVersion?: pulumi.Input<string>;

The object version containing the function’s deployment package. Conflicts with filename.

property sourceCodeHash

sourceCodeHash?: pulumi.Input<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${base64sha256(file("file.zip"))}, where “file.zip” is the local filename of the lambda function source archive.

property sourceCodeSize

sourceCodeSize?: pulumi.Input<number>;

The size in bytes of the function .zip file.

property tags

tags?: pulumi.Input<Tags>;

A mapping of tags to assign to the object.

property timeout

timeout?: pulumi.Input<number>;

The amount of time your Lambda Function has to run in seconds. Defaults to 3. See [Limits][5]

property tracingConfig

tracingConfig?: pulumi.Input<{ ... }>;

property version

version?: pulumi.Input<string>;

Latest published version of your Lambda Function.

property vpcConfig

vpcConfig?: pulumi.Input<{ ... }>;

Provide this to allow your function to access your VPC. Fields documented below. See [Lambda in VPC][7]

interface GetFunctionArgs

A collection of arguments for invoking getFunction.

property functionName

functionName: string;

Name of the lambda function.

property qualifier

qualifier?: string;

Qualifier of the lambda function. Defaults to $LATEST.

interface GetFunctionResult

A collection of values returned by getFunction.

property arn

arn: string;

The Amazon Resource Name (ARN) identifying your Lambda Function.

property deadLetterConfig

deadLetterConfig: { ... };

Configure the function’s dead letter queue.

property description

description: string;

Description of what your Lambda Function does.

property environment

environment: { ... };

The Lambda environment’s configuration settings.

property handler

handler: string;

The function entrypoint in your code.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property invokeArn

invokeArn: string;

The ARN to be used for invoking Lambda Function from API Gateway.

property kmsKeyArn

kmsKeyArn: string;

The ARN for the KMS encryption key.

property lastModified

lastModified: string;

The date this resource was last modified.

property memorySize

memorySize: number;

Amount of memory in MB your Lambda Function can use at runtime.

property qualifiedArn

qualifiedArn: string;

The Amazon Resource Name (ARN) identifying your Lambda Function Version

property reservedConcurrentExecutions

reservedConcurrentExecutions: number;

The amount of reserved concurrent executions for this lambda function.

property role

role: string;

IAM role attached to the Lambda Function.

property runtime

runtime: string;

The runtime environment for the Lambda function..

property sourceCodeHash

sourceCodeHash: string;

Base64-encoded representation of raw SHA-256 sum of the zip file.

property sourceCodeSize

sourceCodeSize: number;

The size in bytes of the function .zip file.

property timeout

timeout: number;

The function execution time at which Lambda should terminate the function.

property tracingConfig

tracingConfig: { ... };

Tracing settings of the function.

property version

version: string;

The version of the Lambda function.

property vpcConfig

vpcConfig: { ... };

VPC configuration associated with your Lambda function.

interface GetInvocationArgs

A collection of arguments for invoking getInvocation.

property functionName

functionName: string;

The name of the lambda function.

property input

input: string;

A string in JSON format that is passed as payload to the lambda function.

property qualifier

qualifier?: string;

The qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.

interface GetInvocationResult

A collection of values returned by getInvocation.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property result

result: string;

A result of the lambda function invocation.

property resultMap

resultMap: { ... };

This field is set only if result is a map of primitive types.

interface PermissionArgs

The set of arguments for constructing a Permission resource.

property action

action: pulumi.Input<string>;

The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)

property eventSourceToken

eventSourceToken?: pulumi.Input<string>;

The Event Source Token to validate. Used with [Alexa Skills][1].

property function

function: pulumi.Input<Function>;

Name of the Lambda function whose resource policy you are updating

property principal

principal: pulumi.Input<string>;

The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com.

property qualifier

qualifier?: pulumi.Input<string>;

Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2

property sourceAccount

sourceAccount?: pulumi.Input<string>;

This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner.

property sourceArn

sourceArn?: pulumi.Input<string>;

When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. API Gateway ARNs have a unique structure described here.

property statementId

statementId?: pulumi.Input<string>;

A unique statement identifier. By default generated by Terraform.

property statementIdPrefix

statementIdPrefix?: pulumi.Input<string>;

A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with statement_id.

interface PermissionState

Input properties used for looking up and filtering Permission resources.

property action

action?: pulumi.Input<string>;

The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)

property eventSourceToken

eventSourceToken?: pulumi.Input<string>;

The Event Source Token to validate. Used with [Alexa Skills][1].

property function

function?: pulumi.Input<Function>;

Name of the Lambda function whose resource policy you are updating

property principal

principal?: pulumi.Input<string>;

The principal who is getting this permission. e.g. s3.amazonaws.com, an AWS account ID, or any valid AWS service principal such as events.amazonaws.com or sns.amazonaws.com.

property qualifier

qualifier?: pulumi.Input<string>;

Query parameter to specify function version or alias name. The permission will then apply to the specific qualified ARN. e.g. arn:aws:lambda:aws-region:acct-id:function:function-name:2

property sourceAccount

sourceAccount?: pulumi.Input<string>;

This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner.

property sourceArn

sourceArn?: pulumi.Input<string>;

When granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. API Gateway ARNs have a unique structure described here.

property statementId

statementId?: pulumi.Input<string>;

A unique statement identifier. By default generated by Terraform.

property statementIdPrefix

statementIdPrefix?: pulumi.Input<string>;

A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with statement_id.

let DotnetCore1d0Runtime

let DotnetCore1d0Runtime: Runtime = "dotnetcore1.0";

let DotnetCore2d0Runtime

let DotnetCore2d0Runtime: Runtime = "dotnetcore2.0";

let DotnetCore2d1Runtime

let DotnetCore2d1Runtime: Runtime = "dotnetcore2.1";

let Go1dxRuntime

let Go1dxRuntime: Runtime = "go1.x";

let Java8Runtime

let Java8Runtime: Runtime = "java8";

let NodeJS4d3EdgeRuntime

let NodeJS4d3EdgeRuntime: Runtime = "nodejs4.3-edge";

let NodeJS4d3Runtime

let NodeJS4d3Runtime: Runtime = "nodejs4.3";

let NodeJS6d10Runtime

let NodeJS6d10Runtime: Runtime = "nodejs6.10";

let NodeJS8d10Runtime

let NodeJS8d10Runtime: Runtime = "nodejs8.10";

let NodeJSRuntime

let NodeJSRuntime: Runtime = "nodejs";

let Python2d7Runtime

let Python2d7Runtime: Runtime = "python2.7";

let Python3d6Runtime

let Python3d6Runtime: Runtime = "python3.6";

type Callback

type Callback = { ... };

Callback is the signature for an AWS Lambda function entrypoint.

[event] is the data passed in by specific services calling the Lambda (like s3, or kinesis). The shape of it will be specific to individual services.

[context] AWS Lambda uses this parameter to provide details of your Lambda function’s execution. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html

[callback] See https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html#nodejs-prog-model-handler-callback for details.

This function can be synchronous or asynchronous function, though async is only supported with an AWS Lambda runtime of 8.10 or higher. On those runtimes a Promise can be returned, ‘callback’ parameter can be ignored, and AWS will appropriately handle things. For AWS lambda pre-8.10, a synchronous function must be provided. The synchronous function should return nothing, and should instead invoke ‘callback’ when complete.

type CallbackFactory

type CallbackFactory = { ... };

CallbackFactory is the signature for a function that will be called once to produce the entrypoint function that AWS Lambda will invoke. It can be used to initialize expensive state once that can then be used across all invocations of the Lambda (as long as the Lambda is using the same warm node instance).

type CallbackFunctionArgs

type CallbackFunctionArgs = utils.Overwrite<FunctionArgs, { ... }>;

CallbackFunctionArgs provides configuration options for the serverless Function. It is effectively equivalent to [aws.lambda.FunctionArgs] except with a few important differences documented at the property level. For example, [role] is an actual iam.Role instance, and not an ARN. Properties like [runtime] are now optional. And some properties (like [code]) are entirely disallowed.

type EventHandler

type EventHandler = Callback<E, R> | LambdaFunction;

An EventHandler is either a JavaScript callback or an aws.lambda.Function that can be used to handle an event triggered by some resource. If just a JavaScript callback is provided the AWS Lambda will be created by calling [createCallbackFunction] on it. If more control over the resultant AWS Lambda is required, clients can call [createCallbackFunction] directly and pass the result of that to any code that needs an EventHandler.

type Runtime

type Runtime = dotnetcore1.0 | dotnetcore2.0 | dotnetcore2.1 | go1.x | java8 | nodejs4.3-edge | nodejs4.3 | nodejs6.10 | nodejs8.10 | nodejs | python2.7 | python3.6;

Runtime is a union type containing all available AWS Lambda runtimes.