Come join Pulumi for the industry's first Cloud Engineering Summit! October 7–8. Save Your Spot

Module lambda

This page documents the language specification for the aws package. If you're looking for help working with the inputs, outputs, or functions of aws resources in a Pulumi program, please see the resource documentation for examples and API reference.

Resources

Functions

Others

Resources

Resource Alias

class Alias extends CustomResource

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? For information about function aliases, see CreateAlias and AliasRoutingConfiguration in the API docs.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testLambdaAlias = new aws.lambda.Alias("testLambdaAlias", {
    description: "a sample description",
    functionName: aws_lambda_function.lambda_function_test.arn,
    functionVersion: "1",
    routingConfig: {
        additionalVersionWeights: {
            "2": 0.5,
        },
    },
});

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, opts?: pulumi.CustomResourceOptions): 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

public static isInstance(obj: any): obj is Alias

Returns true if the given object is an instance of Alias. 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>;

Lambda Function name or ARN.

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 invokeArn

public invokeArn: pulumi.Output<string>;

The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws.apigateway.Integration’s uri

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

Resource EventSourceMapping

class EventSourceMapping extends CustomResource

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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.EventSourceMapping("example", {
    eventSourceArn: aws_dynamodb_table.example.stream_arn,
    functionName: aws_lambda_function.example.arn,
    startingPosition: "LATEST",
});
Kinesis
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.EventSourceMapping("example", {
    eventSourceArn: aws_kinesis_stream.example.arn,
    functionName: aws_lambda_function.example.arn,
    startingPosition: "LATEST",
});
SQS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.EventSourceMapping("example", {
    eventSourceArn: aws_sqs_queue.sqs_queue_test.arn,
    functionName: aws_lambda_function.example.arn,
});

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, opts?: pulumi.CustomResourceOptions): 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

public static isInstance(obj: any): obj is 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.

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 bisectBatchOnFunctionError

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

property destinationConfig

public destinationConfig: pulumi.Output<EventSourceMappingDestinationConfig | undefined>;

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 be a Kinesis stream, DynamoDB stream, or SQS queue.

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 functionName 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 maximumBatchingWindowInSeconds

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

The maximum amount of time to gather records before invoking the function, in seconds. Records will continue to buffer until either maximumBatchingWindowInSeconds expires or batchSize 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.

property maximumRecordAgeInSeconds

public maximumRecordAgeInSeconds: pulumi.Output<number>;

property maximumRetryAttempts

public maximumRetryAttempts: pulumi.Output<number>;

property parallelizationFactor

public parallelizationFactor: pulumi.Output<number>;

property startingPosition

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

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.

property startingPositionTimestamp

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

A timestamp in RFC3339 format of the data record which to start reading when using startingPosition 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. * parallelizationFactor: - (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. * maximumRetryAttempts: - (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. * maximumRecordAgeInSeconds: - (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. * bisectBatchOnFunctionError: - (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. * destinationConfig: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.

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.

Resource EventSubscription

class EventSubscription extends ComponentResource

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

constructor

public new EventSubscription(type: string, name: string, opts?: pulumi.ComponentResourceOptions)

method getData

protected getData(): Promise<TData>

Retrieves the data produces by [initialize]. The data is immediately available in a derived class’s constructor after the super(...) call to ComponentResource.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method initialize

protected initialize(args: Inputs): Promise<TData>

Can be overridden by a subclass to asynchronously initialize data for this Component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use .getData.

method isInstance

static isInstance(obj: any): obj is ComponentResource

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.

method registerOutputs

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

registerOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

ComponentResources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.

property func

public func: LambdaFunction;

property permission

public permission: Permission;

property urn

urn: Output<URN>;

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

Resource Function

class Function extends CustomResource

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

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

NOTE: Due to AWS Lambda improved VPC networking changes that began deploying in September 2019, EC2 subnets and security groups associated with Lambda Functions can take up to 45 minutes to successfully delete.

Example Usage

Lambda Layers
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleLayerVersion = new aws.lambda.LayerVersion("exampleLayerVersion", {});
// ... other configuration ...
const exampleFunction = new aws.lambda.Function("exampleFunction", {layers: [exampleLayerVersion.arn]});
Lambda File Systems

Lambda File Systems allow you to connect an Amazon Elastic File System (EFS) file system to a Lambda function to share data across function invocations, access existing data including large files, and save function state.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// EFS file system
const efsForLambda = new aws.efs.FileSystem("efsForLambda", {tags: {
    Name: "efs_for_lambda",
}});
// Mount target connects the file system to the subnet
const alpha = new aws.efs.MountTarget("alpha", {
    fileSystemId: efsForLambda.id,
    subnetId: aws_subnet.subnet_for_lambda.id,
    securityGroups: [aws_security_group.sg_for_lambda.id],
});
// EFS access point used by lambda file system
const accessPointForLambda = new aws.efs.AccessPoint("accessPointForLambda", {
    fileSystemId: efsForLambda.id,
    rootDirectory: {
        path: "/lambda",
        creationInfo: {
            ownerGid: 1000,
            ownerUid: 1000,
            permissions: "777",
        },
    },
    posixUser: {
        gid: 1000,
        uid: 1000,
    },
});
// A lambda function connected to an EFS file system
// ... other configuration ...
const example = new aws.lambda.Function("example", {
    fileSystemConfig: {
        arn: accessPointForLambda.arn,
        localMountPath: "/mnt/efs",
    },
    vpcConfig: {
        subnetIds: [aws_subnet.subnet_for_lambda.id],
        securityGroupIds: [aws_security_group.sg_for_lambda.id],
    },
}, {
    dependsOn: [alpha],
});

Specifying the Deployment Package

AWS Lambda expects source code to be provided as a deployment package whose structure varies depending on which runtime is in use. See Runtimes for the valid values of runtime. The expected structure of the deployment package can be found in the AWS Lambda documentation for each runtime.

Once you have created your deployment package you can specify it either directly as a local file (using the filename argument) or indirectly via Amazon S3 (using the s3Bucket, s3Key and s3ObjectVersion arguments). When providing the deployment package via S3 it may be useful to use the aws.s3.BucketObject resource to upload it.

For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently.

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, opts?: pulumi.CustomResourceOptions): 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

public static isInstance(obj: any): obj is Function

Returns true if the given object is an instance of Function. 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) of the Amazon EFS Access Point that provides access to the file system.

property code

public code: pulumi.Output<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<FunctionDeadLetterConfig | 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<FunctionEnvironment | undefined>;

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

property fileSystemConfig

public fileSystemConfig: pulumi.Output<FunctionFileSystemConfig | undefined>;

The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with fileSystemConfig, EFS mount targets much be in available lifecycle state. Use dependsOn to explicitly declare this dependency. See Using Amazon EFS with Lambda.

property handler

public handler: pulumi.Output<string>;

The function entrypoint 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.apigateway.Integration’s uri

property kmsKeyArn

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

Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and this provider will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property layers

public layers: pulumi.Output<string[] | undefined>;

List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See Lambda Layers

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

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. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See Managing Concurrency

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 for more details.

property roleInstance

roleInstance?: iam.Role;

Actual Role instance value for this Function. Will only be set if this function was created from [createFunction]

property runtime

public runtime: pulumi.Output<string>;

See Runtimes 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 s3Key. The usual way to set this is filebase64sha256("file.zip") (this provider 0.11.12 and later) or base64sha256(file("file.zip")) (this provider 0.11.11 and earlier), 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<{[key: string]: string} | 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

property tracingConfig

public tracingConfig: pulumi.Output<FunctionTracingConfig>;

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<FunctionVpcConfig | undefined>;

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

Resource FunctionEventInvokeConfig

class FunctionEventInvokeConfig extends CustomResource

Manages an asynchronous invocation configuration for a Lambda Function or Alias. More information about asynchronous invocations and the configurable values can be found in the Lambda Developer Guide.

Example Usage

Destination Configuration

NOTE: Ensure the Lambda Function IAM Role has necessary permissions for the destination, such as sqs:SendMessage or sns:Publish, otherwise the API will return a generic InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid. error.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.FunctionEventInvokeConfig("example", {
    functionName: aws_lambda_alias.example.function_name,
    destinationConfig: {
        onFailure: {
            destination: aws_sqs_queue.example.arn,
        },
        onSuccess: {
            destination: aws_sns_topic.example.arn,
        },
    },
});
Error Handling Configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.FunctionEventInvokeConfig("example", {
    functionName: aws_lambda_alias.example.function_name,
    maximumEventAgeInSeconds: 60,
    maximumRetryAttempts: 0,
});
Configuration for Alias Name
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.FunctionEventInvokeConfig("example", {
    functionName: aws_lambda_alias.example.function_name,
    qualifier: aws_lambda_alias.example.name,
});
// ... other configuration ...
Configuration for Function Latest Unpublished Version
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.FunctionEventInvokeConfig("example", {
    functionName: aws_lambda_function.example.function_name,
    qualifier: `$LATEST`,
});
// ... other configuration ...
Configuration for Function Published Version
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.FunctionEventInvokeConfig("example", {
    functionName: aws_lambda_function.example.function_name,
    qualifier: aws_lambda_function.example.version,
});
// ... other configuration ...

constructor

new FunctionEventInvokeConfig(name: string, args: FunctionEventInvokeConfigArgs, opts?: pulumi.CustomResourceOptions)

Create a FunctionEventInvokeConfig 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?: FunctionEventInvokeConfigState, opts?: pulumi.CustomResourceOptions): FunctionEventInvokeConfig

Get an existing FunctionEventInvokeConfig 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

public static isInstance(obj: any): obj is FunctionEventInvokeConfig

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

property destinationConfig

public destinationConfig: pulumi.Output<FunctionEventInvokeConfigDestinationConfig | undefined>;

Configuration block with destination configuration. See below for details.

property functionName

public functionName: pulumi.Output<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier.

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 maximumEventAgeInSeconds

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

Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600.

property maximumRetryAttempts

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

Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2.

property qualifier

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

Lambda Function published version, $LATEST, or Lambda Alias name.

property urn

urn: Output<URN>;

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

Resource LayerVersion

class LayerVersion extends CustomResource

Provides a Lambda Layer Version resource. Lambda Layers allow you to reuse shared bits of code across multiple lambda functions.

For information about Lambda Layers and how to use them, see AWS Lambda Layers

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const lambdaLayer = new aws.lambda.LayerVersion("lambda_layer", {
    compatibleRuntimes: ["nodejs12.x"],
    code: new pulumi.asset.FileArchive("lambda_layer_payload.zip"),
    layerName: "lambda_layer_name",
});

Specifying the Deployment Package

AWS Lambda Layers expect source code to be provided as a deployment package whose structure varies depending on which compatibleRuntimes this layer specifies. See Runtimes for the valid values of compatibleRuntimes.

Once you have created your deployment package you can specify it either directly as a local file (using the filename argument) or indirectly via Amazon S3 (using the s3Bucket, s3Key and s3ObjectVersion arguments). When providing the deployment package via S3 it may be useful to use the aws.s3.BucketObject resource to upload it.

For larger deployment packages it is recommended by Amazon to upload via S3, since the S3 API has better support for uploading large files efficiently.

constructor

new LayerVersion(name: string, args: LayerVersionArgs, opts?: pulumi.CustomResourceOptions)

Create a LayerVersion 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?: LayerVersionState, opts?: pulumi.CustomResourceOptions): LayerVersion

Get an existing LayerVersion 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

public static isInstance(obj: any): obj is LayerVersion

Returns true if the given object is an instance of LayerVersion. 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) of the Lambda Layer with version.

property code

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

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

property compatibleRuntimes

public compatibleRuntimes: pulumi.Output<string[] | undefined>;

A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified.

property createdDate

public createdDate: pulumi.Output<string>;

The date this resource was created.

property description

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

Description of what your Lambda Layer does.

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 layerArn

public layerArn: pulumi.Output<string>;

The Amazon Resource Name (ARN) of the Lambda Layer without version.

property layerName

public layerName: pulumi.Output<string>;

A unique name for your Lambda Layer

property licenseInfo

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

License info for your Lambda Layer. See License Info.

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 s3Key. The usual way to set this is ${filebase64sha256("file.zip")} (this provider 0.11.12 or later) or ${base64sha256(file("file.zip"))} (this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda layer source archive.

property sourceCodeSize

public sourceCodeSize: pulumi.Output<number>;

The size in bytes of the function .zip file.

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>;

This Lamba Layer version.

Resource Permission

class Permission extends CustomResource

Gives an external source (like a CloudWatch Event Rule, SNS, or S3) permission to access the Lambda function.

Example Usage

Basic Example
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const iamForLambda = new aws.iam.Role("iamForLambda", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`});
const testLambda = new aws.lambda.Function("testLambda", {
    code: new pulumi.asset.FileArchive("lambdatest.zip"),
    role: iamForLambda.arn,
    handler: "exports.handler",
    runtime: "nodejs12.x",
});
const testAlias = new aws.lambda.Alias("testAlias", {
    description: "a sample description",
    functionName: testLambda.name,
    functionVersion: `$LATEST`,
});
const allowCloudwatch = new aws.lambda.Permission("allowCloudwatch", {
    action: "lambda:InvokeFunction",
    "function": testLambda.name,
    principal: "events.amazonaws.com",
    sourceArn: "arn:aws:events:eu-west-1:111122223333:rule/RunDaily",
    qualifier: testAlias.name,
});
Usage with SNS
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultTopic = new aws.sns.Topic("defaultTopic", {});
const defaultRole = new aws.iam.Role("defaultRole", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`});
const func = new aws.lambda.Function("func", {
    code: new pulumi.asset.FileArchive("lambdatest.zip"),
    role: defaultRole.arn,
    handler: "exports.handler",
    runtime: "python2.7",
});
const withSns = new aws.lambda.Permission("withSns", {
    action: "lambda:InvokeFunction",
    "function": func.name,
    principal: "sns.amazonaws.com",
    sourceArn: defaultTopic.arn,
});
const lambda = new aws.sns.TopicSubscription("lambda", {
    topic: defaultTopic.arn,
    protocol: "lambda",
    endpoint: func.arn,
});
Specify Lambda permissions for API Gateway REST API
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const myDemoAPI = new aws.apigateway.RestApi("MyDemoAPI", {
    description: "This is my API for demonstration purposes",
});
const lambdaPermission = new aws.lambda.Permission("lambda_permission", {
    action: "lambda:InvokeFunction",
    function: "MyDemoFunction",
    principal: "apigateway.amazonaws.com",
    sourceArn: pulumi.interpolate`${myDemoAPI.executionArn}/*&#47;*&#47;*`,
});

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, opts?: pulumi.CustomResourceOptions): 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

public static isInstance(obj: any): obj is Permission

Returns true if the given object is an instance of Permission. 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.

property function

public function: pulumi.Output<string>;

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 the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. Without this, any resource from principal will be granted permission – even if that resource is from another account. For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API, as described here.

property statementId

public statementId: pulumi.Output<string>;

A unique statement identifier. By default generated by this provider.

property statementIdPrefix

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

A statement identifier prefix. This provider will generate a unique suffix. Conflicts with statementId.

property urn

urn: Output<URN>;

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

Resource ProvisionedConcurrencyConfig

class ProvisionedConcurrencyConfig extends CustomResource

Manages a Lambda Provisioned Concurrency Configuration.

Example Usage

Alias Name
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.ProvisionedConcurrencyConfig("example", {
    functionName: aws_lambda_alias.example.function_name,
    provisionedConcurrentExecutions: 1,
    qualifier: aws_lambda_alias.example.name,
});
Function Version
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.lambda.ProvisionedConcurrencyConfig("example", {
    functionName: aws_lambda_function.example.function_name,
    provisionedConcurrentExecutions: 1,
    qualifier: aws_lambda_function.example.version,
});

constructor

new ProvisionedConcurrencyConfig(name: string, args: ProvisionedConcurrencyConfigArgs, opts?: pulumi.CustomResourceOptions)

Create a ProvisionedConcurrencyConfig 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?: ProvisionedConcurrencyConfigState, opts?: pulumi.CustomResourceOptions): ProvisionedConcurrencyConfig

Get an existing ProvisionedConcurrencyConfig 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

public static isInstance(obj: any): obj is ProvisionedConcurrencyConfig

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

property functionName

public functionName: pulumi.Output<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function.

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 provisionedConcurrentExecutions

public provisionedConcurrentExecutions: pulumi.Output<number>;

Amount of capacity to allocate. Must be greater than or equal to 1.

property qualifier

public qualifier: pulumi.Output<string>;

Lambda Function version or Lambda Alias name.

property urn

urn: Output<URN>;

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

Functions

Function getAlias

getAlias(args: GetAliasArgs, opts?: pulumi.InvokeOptions): Promise<GetAliasResult>

Provides information about a Lambda Alias.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const production = pulumi.output(aws.lambda.getAlias({
    functionName: "my-lambda-func",
    name: "production",
}, { async: true }));

Function getFunction

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

Provides information about a Lambda Function.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const functionName = config.require("functionName");
const existing = aws.lambda.getFunction({
    functionName: functionName,
});

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.

Function getLayerVersion

getLayerVersion(args: GetLayerVersionArgs, opts?: pulumi.InvokeOptions): Promise<GetLayerVersionResult>

Provides information about a Lambda Layer Version.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const config = new pulumi.Config();
const layerName = config.require("layerName");
const existing = aws.lambda.getLayerVersion({
    layerName: layerName,
});

Others

interface AliasArgs

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>;

Lambda Function name or ARN.

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<AliasRoutingConfig>;

The Lambda alias’ route configuration settings. Fields documented below

interface AliasState

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>;

Lambda Function name or ARN.

property functionVersion

functionVersion?: pulumi.Input<string>;

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

property invokeArn

invokeArn?: pulumi.Input<string>;

The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws.apigateway.Integration’s uri

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<AliasRoutingConfig>;

The Lambda alias’ route configuration settings. Fields documented below

type BaseCallbackFunctionArgs

type BaseCallbackFunctionArgs = utils.Overwrite<FunctionArgs, {
    code?: undefined;
    codePathOptions?: pulumi.runtime.CodePathOptions;
    handler?: undefined;
    policies?: arn.ARN[];
    role?: iam.Role;
    runtime?: runtime.Runtime;
}>;

BaseCallbackFunctionArgs 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 Callback

type Callback = (event: E, context: Context, callback: (error?: any, result?: R) => void) => Promise<R> | void;

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 = () => Callback<E, R>;

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

class CallbackFunction

class CallbackFunction extends Function

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://www.pulumi.com/docs/tutorials/aws/serializing-functions/ for additional details on this process.

constructor

public new CallbackFunction(name: string, args: CallbackFunctionArgs<E, R>, opts: CustomResourceOptions)

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FunctionState, opts?: pulumi.CustomResourceOptions): 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

public static isInstance(obj: any): obj is Function

Returns true if the given object is an instance of Function. 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) of the Amazon EFS Access Point that provides access to the file system.

property code

public code: pulumi.Output<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<FunctionDeadLetterConfig | 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<FunctionEnvironment | undefined>;

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

property fileSystemConfig

public fileSystemConfig: pulumi.Output<FunctionFileSystemConfig | undefined>;

The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with fileSystemConfig, EFS mount targets much be in available lifecycle state. Use dependsOn to explicitly declare this dependency. See Using Amazon EFS with Lambda.

property handler

public handler: pulumi.Output<string>;

The function entrypoint 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.apigateway.Integration’s uri

property kmsKeyArn

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

Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and this provider will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property layers

public layers: pulumi.Output<string[] | undefined>;

List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See Lambda Layers

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

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. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See Managing Concurrency

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 for more details.

property roleInstance

roleInstance?: iam.Role;

Actual Role instance value for this Function. Will only be set if this function was created from [createFunction]

property runtime

public runtime: pulumi.Output<string>;

See Runtimes 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 s3Key. The usual way to set this is filebase64sha256("file.zip") (this provider 0.11.12 and later) or base64sha256(file("file.zip")) (this provider 0.11.11 and earlier), 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<{[key: string]: string} | 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

property tracingConfig

public tracingConfig: pulumi.Output<FunctionTracingConfig>;

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<FunctionVpcConfig | undefined>;

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

interface CallbackFunctionArgs

interface CallbackFunctionArgs extends { ... } & {
    code?: undefined;
    codePathOptions?: pulumi.runtime.CodePathOptions;
    handler?: undefined;
    policies?: arn.ARN[];
    role?: iam.Role;
    runtime?: runtime.Runtime;
}

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.

property callback

callback?: Callback<E, R>;

The Javascript callback to use as the entrypoint for the AWS Lambda out of. Either [callback] or [callbackFactory] must be provided.

property callbackFactory

callbackFactory?: CallbackFactory<E, R>;

The Javascript function instance that will be called to produce the callback function that is the entrypoint for the AWS Lambda. Either [callback] or [callbackFactory] must be provided.

This form is useful when there is expensive initialization work that should only be executed once. The factory-function will be invoked once when the final AWS Lambda module is loaded. It can run whatever code it needs, and will end by returning the actual function that Lambda will call into each time the Lambda is invoked.

property code

code?: undefined;

Not allowed when creating an aws.serverless.Function. The [code] will be generated from the passed in JavaScript callback.

property codePathOptions

codePathOptions?: pulumi.runtime.CodePathOptions;

Options to control which paths/packages should be included or excluded in the zip file containing the code for the AWS lambda.

property handler

handler?: undefined;

Not allowed when creating an aws.serverless.Function. The [code] will be generated from the passed in JavaScript callback.

property policies

policies?: arn.ARN[];

A list of IAM policy ARNs to attach to the Function. Will be used if [role] is not provide. If neither [role] nor [policies] is provided, a default policy of [iam.AWSLambdaFullAccess] will be used instead.

property role

role?: iam.Role;

A pre-created role to use for the Function. If not provided, [policies] will be used.

property runtime

runtime?: runtime.Runtime;

The Lambda runtime to use. If not provided, will default to [NodeJS8d10Runtime]

interface Context

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.

function createFunctionFromEventHandler

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

let CustomRuntime

let CustomRuntime: Runtime = "provided";

let DotnetCore1d0Runtime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let DotnetCore1d0Runtime: Runtime = "dotnetcore1.0";

let DotnetCore2d0Runtime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let DotnetCore2d0Runtime: Runtime = "dotnetcore2.0";

let DotnetCore2d1Runtime

let DotnetCore2d1Runtime: Runtime = "dotnetcore2.1";

let DotnetCore3d1Runtime

let DotnetCore3d1Runtime: Runtime = "dotnetcore3.1";

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.

interface EventSourceMappingArgs

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 bisectBatchOnFunctionError

bisectBatchOnFunctionError?: pulumi.Input<boolean>;

property destinationConfig

destinationConfig?: pulumi.Input<EventSourceMappingDestinationConfig>;

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 be a Kinesis stream, DynamoDB stream, or SQS queue.

property functionName

functionName: pulumi.Input<string>;

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

property maximumBatchingWindowInSeconds

maximumBatchingWindowInSeconds?: pulumi.Input<number>;

The maximum amount of time to gather records before invoking the function, in seconds. Records will continue to buffer until either maximumBatchingWindowInSeconds expires or batchSize 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.

property maximumRecordAgeInSeconds

maximumRecordAgeInSeconds?: pulumi.Input<number>;

property maximumRetryAttempts

maximumRetryAttempts?: pulumi.Input<number>;

property parallelizationFactor

parallelizationFactor?: pulumi.Input<number>;

property startingPosition

startingPosition?: pulumi.Input<string>;

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.

property startingPositionTimestamp

startingPositionTimestamp?: pulumi.Input<string>;

A timestamp in RFC3339 format of the data record which to start reading when using startingPosition 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. * parallelizationFactor: - (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. * maximumRetryAttempts: - (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. * maximumRecordAgeInSeconds: - (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. * bisectBatchOnFunctionError: - (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. * destinationConfig: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.

interface EventSourceMappingState

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 bisectBatchOnFunctionError

bisectBatchOnFunctionError?: pulumi.Input<boolean>;

property destinationConfig

destinationConfig?: pulumi.Input<EventSourceMappingDestinationConfig>;

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 be a Kinesis stream, DynamoDB stream, or SQS queue.

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 functionName 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 maximumBatchingWindowInSeconds

maximumBatchingWindowInSeconds?: pulumi.Input<number>;

The maximum amount of time to gather records before invoking the function, in seconds. Records will continue to buffer until either maximumBatchingWindowInSeconds expires or batchSize 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.

property maximumRecordAgeInSeconds

maximumRecordAgeInSeconds?: pulumi.Input<number>;

property maximumRetryAttempts

maximumRetryAttempts?: pulumi.Input<number>;

property parallelizationFactor

parallelizationFactor?: pulumi.Input<number>;

property startingPosition

startingPosition?: pulumi.Input<string>;

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.

property startingPositionTimestamp

startingPositionTimestamp?: pulumi.Input<string>;

A timestamp in RFC3339 format of the data record which to start reading when using startingPosition 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. * parallelizationFactor: - (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. * maximumRetryAttempts: - (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. * maximumRecordAgeInSeconds: - (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. * bisectBatchOnFunctionError: - (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. * destinationConfig: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.

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

interface FunctionArgs

The set of arguments for constructing a Function resource.

property code

code?: pulumi.Input<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<FunctionDeadLetterConfig>;

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<FunctionEnvironment>;

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

property fileSystemConfig

fileSystemConfig?: pulumi.Input<FunctionFileSystemConfig>;

The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with fileSystemConfig, EFS mount targets much be in available lifecycle state. Use dependsOn to explicitly declare this dependency. See Using Amazon EFS with Lambda.

property handler

handler: pulumi.Input<string>;

The function entrypoint in your code.

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and this provider will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration.

property layers

layers?: pulumi.Input<pulumi.Input<string>[]>;

List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See Lambda Layers

property memorySize

memorySize?: pulumi.Input<number>;

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

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. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See Managing Concurrency

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 for more details.

property runtime

runtime: pulumi.Input<string>;

See Runtimes 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 s3Key. The usual way to set this is filebase64sha256("file.zip") (this provider 0.11.12 and later) or base64sha256(file("file.zip")) (this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda function source archive.

property tags

tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

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

property tracingConfig

tracingConfig?: pulumi.Input<FunctionTracingConfig>;

property vpcConfig

vpcConfig?: pulumi.Input<FunctionVpcConfig>;

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

interface FunctionEventInvokeConfigArgs

interface FunctionEventInvokeConfigArgs

The set of arguments for constructing a FunctionEventInvokeConfig resource.

property destinationConfig

destinationConfig?: pulumi.Input<FunctionEventInvokeConfigDestinationConfig>;

Configuration block with destination configuration. See below for details.

property functionName

functionName: pulumi.Input<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier.

property maximumEventAgeInSeconds

maximumEventAgeInSeconds?: pulumi.Input<number>;

Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600.

property maximumRetryAttempts

maximumRetryAttempts?: pulumi.Input<number>;

Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2.

property qualifier

qualifier?: pulumi.Input<string>;

Lambda Function published version, $LATEST, or Lambda Alias name.

interface FunctionEventInvokeConfigState

interface FunctionEventInvokeConfigState

Input properties used for looking up and filtering FunctionEventInvokeConfig resources.

property destinationConfig

destinationConfig?: pulumi.Input<FunctionEventInvokeConfigDestinationConfig>;

Configuration block with destination configuration. See below for details.

property functionName

functionName?: pulumi.Input<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier.

property maximumEventAgeInSeconds

maximumEventAgeInSeconds?: pulumi.Input<number>;

Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600.

property maximumRetryAttempts

maximumRetryAttempts?: pulumi.Input<number>;

Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2.

property qualifier

qualifier?: pulumi.Input<string>;

Lambda Function published version, $LATEST, or Lambda Alias name.

interface FunctionState

interface FunctionState

Input properties used for looking up and filtering Function resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system.

property code

code?: pulumi.Input<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<FunctionDeadLetterConfig>;

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<FunctionEnvironment>;

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

property fileSystemConfig

fileSystemConfig?: pulumi.Input<FunctionFileSystemConfig>;

The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with fileSystemConfig, EFS mount targets much be in available lifecycle state. Use dependsOn to explicitly declare this dependency. See Using Amazon EFS with Lambda.

property handler

handler?: pulumi.Input<string>;

The function entrypoint 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.apigateway.Integration’s uri

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and this provider will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration.

property lastModified

lastModified?: pulumi.Input<string>;

The date this resource was last modified.

property layers

layers?: pulumi.Input<pulumi.Input<string>[]>;

List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See Lambda Layers

property memorySize

memorySize?: pulumi.Input<number>;

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

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. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See Managing Concurrency

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 for more details.

property runtime

runtime?: pulumi.Input<string>;

See Runtimes 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 s3Key. The usual way to set this is filebase64sha256("file.zip") (this provider 0.11.12 and later) or base64sha256(file("file.zip")) (this provider 0.11.11 and earlier), 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<{[key: string]: pulumi.Input<string>}>;

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

property tracingConfig

tracingConfig?: pulumi.Input<FunctionTracingConfig>;

property version

version?: pulumi.Input<string>;

Latest published version of your Lambda Function.

property vpcConfig

vpcConfig?: pulumi.Input<FunctionVpcConfig>;

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

interface GetAliasArgs

interface GetAliasArgs

A collection of arguments for invoking getAlias.

property functionName

functionName: string;

Name of the aliased Lambda function.

property name

name: string;

Name of the Lambda alias.

interface GetAliasResult

interface GetAliasResult

A collection of values returned by getAlias.

property arn

arn: string;

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

property description

description: string;

Description of alias.

property functionName

functionName: string;

property functionVersion

functionVersion: string;

Lambda function version which the alias uses.

property id

id: string;

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 - to be used in aws_api_gateway_integration’s uri.

property name

name: string;

interface GetFunctionArgs

interface GetFunctionArgs

A collection of arguments for invoking getFunction.

property functionName

functionName: string;

Name of the lambda function.

property qualifier

qualifier?: undefined | string;

Alias name or version number of the lambda function. e.g. $LATEST, my-alias, or 1

property tags

tags?: undefined | {[key: string]: string};

interface GetFunctionResult

interface GetFunctionResult

A collection of values returned by getFunction.

property arn

arn: string;

Unqualified (no :QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also qualifiedArn.

property deadLetterConfig

deadLetterConfig: GetFunctionDeadLetterConfig;

Configure the function’s dead letter queue.

property description

description: string;

Description of what your Lambda Function does.

property environment

environment: GetFunctionEnvironment;

The Lambda environment’s configuration settings.

property fileSystemConfigs

fileSystemConfigs: GetFunctionFileSystemConfig[];

The connection settings for an Amazon EFS file system.

property functionName

functionName: string;

property handler

handler: string;

The function entrypoint in your code.

property id

id: string;

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 layers

layers: string[];

A list of Lambda Layer ARNs attached to your Lambda Function.

property memorySize

memorySize: number;

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

property qualifiedArn

qualifiedArn: string;

Qualified (:QUALIFIER or :VERSION suffix) Amazon Resource Name (ARN) identifying your Lambda Function. See also arn.

property qualifier

qualifier?: undefined | string;

property reservedConcurrentExecutions

reservedConcurrentExecutions: number;

The amount of reserved concurrent executions for this lambda function or -1 if unreserved.

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 tags

tags: {[key: string]: string};

property timeout

timeout: number;

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

property tracingConfig

tracingConfig: GetFunctionTracingConfig;

Tracing settings of the function.

property version

version: string;

The version of the Lambda function.

property vpcConfig

vpcConfig: GetFunctionVpcConfig;

VPC configuration associated with your Lambda function.

interface GetInvocationArgs

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?: undefined | string;

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

interface GetInvocationResult

interface GetInvocationResult

A collection of values returned by getInvocation.

property functionName

functionName: string;

property id

id: string;

The provider-assigned unique ID for this managed resource.

property input

input: string;

property qualifier

qualifier?: undefined | string;

property result

result: string;

String result of the lambda function invocation.

interface GetLayerVersionArgs

interface GetLayerVersionArgs

A collection of arguments for invoking getLayerVersion.

property compatibleRuntime

compatibleRuntime?: undefined | string;

Specific runtime the layer version must support. Conflicts with version. If specified, the latest available layer version supporting the provided runtime will be used.

property layerName

layerName: string;

Name of the lambda layer.

property version

version?: undefined | number;

Specific layer version. Conflicts with compatibleRuntime. If omitted, the latest available layer version will be used.

interface GetLayerVersionResult

interface GetLayerVersionResult

A collection of values returned by getLayerVersion.

property arn

arn: string;

The Amazon Resource Name (ARN) of the Lambda Layer with version.

property compatibleRuntime

compatibleRuntime?: undefined | string;

property compatibleRuntimes

compatibleRuntimes: string[];

A list of Runtimes the specific Lambda Layer version is compatible with.

property createdDate

createdDate: string;

The date this resource was created.

property description

description: string;

Description of the specific Lambda Layer version.

property id

id: string;

The provider-assigned unique ID for this managed resource.

property layerArn

layerArn: string;

The Amazon Resource Name (ARN) of the Lambda Layer without version.

property layerName

layerName: string;

property licenseInfo

licenseInfo: string;

License info associated with the specific Lambda Layer version.

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 version

version: number;

This Lamba Layer version.

let Go1dxRuntime

let Go1dxRuntime: Runtime = "go1.x";

function isEventHandler

isEventHandler(obj: any): obj is EventHandler<any, any>

let Java11Runtime

let Java11Runtime: Runtime = "java11";

let Java8Runtime

let Java8Runtime: Runtime = "java8";

interface LayerVersionArgs

interface LayerVersionArgs

The set of arguments for constructing a LayerVersion resource.

property code

code?: pulumi.Input<Archive>;

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

property compatibleRuntimes

compatibleRuntimes?: pulumi.Input<pulumi.Input<string>[]>;

A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified.

property description

description?: pulumi.Input<string>;

Description of what your Lambda Layer does.

property layerName

layerName: pulumi.Input<string>;

A unique name for your Lambda Layer

property licenseInfo

licenseInfo?: pulumi.Input<string>;

License info for your Lambda Layer. See License Info.

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 s3Key. The usual way to set this is ${filebase64sha256("file.zip")} (this provider 0.11.12 or later) or ${base64sha256(file("file.zip"))} (this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda layer source archive.

interface LayerVersionState

interface LayerVersionState

Input properties used for looking up and filtering LayerVersion resources.

property arn

arn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the Lambda Layer with version.

property code

code?: pulumi.Input<Archive>;

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

property compatibleRuntimes

compatibleRuntimes?: pulumi.Input<pulumi.Input<string>[]>;

A list of Runtimes this layer is compatible with. Up to 5 runtimes can be specified.

property createdDate

createdDate?: pulumi.Input<string>;

The date this resource was created.

property description

description?: pulumi.Input<string>;

Description of what your Lambda Layer does.

property layerArn

layerArn?: pulumi.Input<string>;

The Amazon Resource Name (ARN) of the Lambda Layer without version.

property layerName

layerName?: pulumi.Input<string>;

A unique name for your Lambda Layer

property licenseInfo

licenseInfo?: pulumi.Input<string>;

License info for your Lambda Layer. See License Info.

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 s3Key. The usual way to set this is ${filebase64sha256("file.zip")} (this provider 0.11.12 or later) or ${base64sha256(file("file.zip"))} (this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda layer source archive.

property sourceCodeSize

sourceCodeSize?: pulumi.Input<number>;

The size in bytes of the function .zip file.

property version

version?: pulumi.Input<string>;

This Lamba Layer version.

let NodeJS10dXRuntime

let NodeJS10dXRuntime: Runtime = "nodejs10.x";

let NodeJS12dXRuntime

let NodeJS12dXRuntime: Runtime = "nodejs12.x";

let NodeJS4d3EdgeRuntime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let NodeJS4d3EdgeRuntime: Runtime = "nodejs4.3-edge";

let NodeJS4d3Runtime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let NodeJS4d3Runtime: Runtime = "nodejs4.3";

let NodeJS6d10Runtime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let NodeJS6d10Runtime: Runtime = "nodejs6.10";

let NodeJS8d10Runtime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let NodeJS8d10Runtime: Runtime = "nodejs8.10";

let NodeJSRuntime

DEPRECATED No longer supported. New lambda functions created using this runtime will fail
let NodeJSRuntime: Runtime = "nodejs";

interface PermissionArgs

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.

property function

function: pulumi.Input<string | 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 the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. Without this, any resource from principal will be granted permission – even if that resource is from another account. For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API, as described here.

property statementId

statementId?: pulumi.Input<string>;

A unique statement identifier. By default generated by this provider.

property statementIdPrefix

statementIdPrefix?: pulumi.Input<string>;

A statement identifier prefix. This provider will generate a unique suffix. Conflicts with statementId.

interface PermissionState

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.

property function

function?: pulumi.Input<string | 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 the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. Without this, any resource from principal will be granted permission – even if that resource is from another account. For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API, as described here.

property statementId

statementId?: pulumi.Input<string>;

A unique statement identifier. By default generated by this provider.

property statementIdPrefix

statementIdPrefix?: pulumi.Input<string>;

A statement identifier prefix. This provider will generate a unique suffix. Conflicts with statementId.

interface ProvisionedConcurrencyConfigArgs

interface ProvisionedConcurrencyConfigArgs

The set of arguments for constructing a ProvisionedConcurrencyConfig resource.

property functionName

functionName: pulumi.Input<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function.

property provisionedConcurrentExecutions

provisionedConcurrentExecutions: pulumi.Input<number>;

Amount of capacity to allocate. Must be greater than or equal to 1.

property qualifier

qualifier: pulumi.Input<string>;

Lambda Function version or Lambda Alias name.

interface ProvisionedConcurrencyConfigState

interface ProvisionedConcurrencyConfigState

Input properties used for looking up and filtering ProvisionedConcurrencyConfig resources.

property functionName

functionName?: pulumi.Input<string>;

Name or Amazon Resource Name (ARN) of the Lambda Function.

property provisionedConcurrentExecutions

provisionedConcurrentExecutions?: pulumi.Input<number>;

Amount of capacity to allocate. Must be greater than or equal to 1.

property qualifier

qualifier?: pulumi.Input<string>;

Lambda Function version or Lambda Alias name.

let Python2d7Runtime

let Python2d7Runtime: Runtime = "python2.7";

let Python3d6Runtime

let Python3d6Runtime: Runtime = "python3.6";

let Python3d7Runtime

let Python3d7Runtime: Runtime = "python3.7";

let Python3d8Runtime

let Python3d8Runtime: Runtime = "python3.8";

let Ruby2d5Runtime

let Ruby2d5Runtime: Runtime = "ruby2.5";

let Ruby2d7Runtime

let Ruby2d7Runtime: Runtime = "ruby2.7";

type Runtime

type Runtime = "dotnetcore1.0" | "dotnetcore2.0" | "dotnetcore2.1" | "dotnetcore3.1" | "go1.x" | "java8" | "java11" | "ruby2.5" | "ruby2.7" | "nodejs4.3-edge" | "nodejs4.3" | "nodejs6.10" | "nodejs8.10" | "nodejs10.x" | "nodejs12.x" | "nodejs" | "python2.7" | "python3.6" | "python3.7" | "python3.8" | "provided";

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