Module lambda

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

Resources

Data Sources

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

Example Usage

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

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

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/lambda_alias.html.markdown.

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): boolean

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

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

property functionVersion

public functionVersion: pulumi.Output<string>;

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

property id

id: Output<ID>;

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

property 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<outputs.lambda.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?][1]. For information about event source mappings, see [CreateEventSourceMapping][2] 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.streamArn,
    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,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/lambda_event_source_mapping.html.markdown.

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): boolean

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 enabled

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

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

property eventSourceArn

public eventSourceArn: pulumi.Output<string>;

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

property functionArn

public functionArn: pulumi.Output<string>;

The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from 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 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.

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 an 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 getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

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

method registerOutputs

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

property func

public func: LambdaFunction;

property permission

public permission: permission.Permission;

property urn

urn: Output<URN>;

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

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. The Lambda Function itself includes source code and runtime configuration.

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

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", {
    environment: {
        variables: {
            foo: "bar",
        },
    },
    code: new pulumi.asset.FileArchive("lambda_function_payload.zip"),
    handler: "exports.test",
    role: iamForLambda.arn,
    runtime: "nodejs8.10",
});
Lambda Layers

NOTE: The aws.lambda.LayerVersion attribute values for arn and layerArn were swapped in version 2.0.0 of the this provider AWS Provider. For version 1.x, use layerArn references. For version 2.x, use arn references.

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

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

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][6] for the valid values of runtime. The expected structure of the deployment package can be found in [the AWS Lambda documentation for each runtime][8].

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.

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/lambda_function.html.markdown.

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): boolean

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) identifying your Lambda Function.

property code

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

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

property deadLetterConfig

public deadLetterConfig: pulumi.Output<outputs.lambda.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<outputs.lambda.FunctionEnvironment | undefined>;

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

property handler

public handler: pulumi.Output<string>;

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

property id

id: Output<ID>;

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

property invokeArn

public invokeArn: pulumi.Output<string>;

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

property kmsKeyArn

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

The ARN for the KMS encryption key.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property 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][10]

property memorySize

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

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

property name

public name: pulumi.Output<string>;

A unique name for your Lambda Function.

property publish

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

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

property qualifiedArn

public qualifiedArn: pulumi.Output<string>;

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

property reservedConcurrentExecutions

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

The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See [Managing Concurrency][9]

property role

public role: pulumi.Output<ARN>;

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

property roleInstance

roleInstance?: iam.Role;

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][6] for valid values.

property s3Bucket

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

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

property s3Key

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

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

property s3ObjectVersion

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

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

property sourceCodeHash

public sourceCodeHash: pulumi.Output<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or 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]: any} | undefined>;

A mapping of tags to assign to the object.

property timeout

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

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

property tracingConfig

public tracingConfig: pulumi.Output<outputs.lambda.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<outputs.lambda.FunctionVpcConfig | undefined>;

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

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][1]

Example Usage

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

const lambdaLayer = new aws.lambda.LayerVersion("lambdaLayer", {
    compatibleRuntimes: ["nodejs8.10"],
    code: new pulumi.asset.FileArchive("lambda_layer_payload.zip"),
    layerName: "lambdaLayerName",
});

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][2] 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.

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/lambda_layer_version.html.markdown.

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): boolean

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<pulumi.asset.Archive | undefined>;

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

property compatibleRuntimes

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

A list of [Runtimes][2] 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][3].

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

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

Example Usage

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"),
    handler: "exports.handler",
    role: iamForLambda.arn,
    runtime: "nodejs8.10",
});
const testAlias = new aws.lambda.Alias("testAlias", {
    description: "a sample description",
    functionName: testLambda.functionName,
    functionVersion: "$LATEST",
});
const allowCloudwatch = new aws.lambda.Permission("allowCloudwatch", {
    action: "lambda:InvokeFunction",
    function: testLambda.functionName,
    principal: "events.amazonaws.com",
    qualifier: testAlias.name,
    sourceArn: "arn:aws:events:eu-west-1:111122223333:rule/RunDaily",
});

Usage with SNS

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

const defaultRole = new aws.iam.Role("default", {
    assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`,
});
const defaultTopic = new aws.sns.Topic("default", {});
const func = new aws.lambda.Function("func", {
    code: new pulumi.asset.FileArchive("lambdatest.zip"),
    handler: "exports.handler",
    role: defaultRole.arn,
    runtime: "python2.7",
});
const withSns = new aws.lambda.Permission("withSns", {
    action: "lambda:InvokeFunction",
    function: func.functionName,
    principal: "sns.amazonaws.com",
    sourceArn: defaultTopic.arn,
});
const lambda = new aws.sns.TopicSubscription("lambda", {
    endpoint: func.arn,
    protocol: "lambda",
    topic: defaultTopic.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("lambdaPermission", {
    action: "lambda:InvokeFunction",
    function: "MyDemoFunction",
    principal: "apigateway.amazonaws.com",
    sourceArn: pulumi.interpolate`${myDemoAPI.executionArn}/*&#47;*&#47;*`,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/lambda_permission.html.markdown.

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): boolean

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][1].

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

property statementId

public statementId: pulumi.Output<string>;

A unique statement identifier. By default generated by 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.

Data Sources

Data Source getFunction

getFunction(args: GetFunctionArgs, opts?: pulumi.InvokeOptions): Promise<GetFunctionResult> & 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,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/d/lambda_function.html.markdown.

Data Source getInvocation

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

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

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/d/lambda_invocation.html.markdown.

Data Source getLayerVersion

getLayerVersion(args: GetLayerVersionArgs, opts?: pulumi.InvokeOptions): Promise<GetLayerVersionResult> & 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,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/d/lambda_layer_version.html.markdown.

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

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

property functionVersion

functionVersion: pulumi.Input<string>;

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

property name

name?: pulumi.Input<string>;

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

property routingConfig

routingConfig?: pulumi.Input<inputs.lambda.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>;

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

property functionVersion

functionVersion?: pulumi.Input<string>;

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

property 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<inputs.lambda.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://github.com/pulumi/docs/blob/master/reference/serializing-functions.md for additional details on this process.

constructor

public new CallbackFunction(name: string, args: CallbackFunctionArgs<E, R>, opts?: pulumi.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): boolean

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) identifying your Lambda Function.

property code

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

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

property deadLetterConfig

public deadLetterConfig: pulumi.Output<outputs.lambda.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<outputs.lambda.FunctionEnvironment | undefined>;

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

property handler

public handler: pulumi.Output<string>;

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

property id

id: Output<ID>;

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

property invokeArn

public invokeArn: pulumi.Output<string>;

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

property kmsKeyArn

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

The ARN for the KMS encryption key.

property lastModified

public lastModified: pulumi.Output<string>;

The date this resource was last modified.

property 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][10]

property memorySize

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

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

property name

public name: pulumi.Output<string>;

A unique name for your Lambda Function.

property publish

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

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

property qualifiedArn

public qualifiedArn: pulumi.Output<string>;

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

property reservedConcurrentExecutions

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

The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See [Managing Concurrency][9]

property role

public role: pulumi.Output<ARN>;

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

property roleInstance

roleInstance?: iam.Role;

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][6] for valid values.

property s3Bucket

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

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

property s3Key

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

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

property s3ObjectVersion

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

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

property sourceCodeHash

public sourceCodeHash: pulumi.Output<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or 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]: any} | undefined>;

A mapping of tags to assign to the object.

property timeout

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

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

property tracingConfig

public tracingConfig: pulumi.Output<outputs.lambda.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<outputs.lambda.FunctionVpcConfig | undefined>;

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

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

let DotnetCore1d0Runtime: Runtime = "dotnetcore1.0";

let DotnetCore2d1Runtime

let DotnetCore2d1Runtime: Runtime = "dotnetcore2.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 enabled

enabled?: pulumi.Input<boolean>;

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

property eventSourceArn

eventSourceArn: pulumi.Input<string>;

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

property functionName

functionName: pulumi.Input<string>;

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

property startingPosition

startingPosition?: pulumi.Input<string>;

The position in the stream where AWS Lambda should start reading. Must be one of 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.

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 enabled

enabled?: pulumi.Input<boolean>;

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

property eventSourceArn

eventSourceArn?: pulumi.Input<string>;

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

property functionArn

functionArn?: pulumi.Input<string>;

The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from 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 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.

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<pulumi.asset.Archive>;

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

property deadLetterConfig

deadLetterConfig?: pulumi.Input<inputs.lambda.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<inputs.lambda.FunctionEnvironment>;

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

property handler

handler: pulumi.Input<string>;

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

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

The ARN for the KMS encryption key.

property 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][10]

property memorySize

memorySize?: pulumi.Input<number>;

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

property name

name?: pulumi.Input<string>;

A unique name for your Lambda Function.

property publish

publish?: pulumi.Input<boolean>;

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

property reservedConcurrentExecutions

reservedConcurrentExecutions?: pulumi.Input<number>;

The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See [Managing Concurrency][9]

property role

role: pulumi.Input<ARN>;

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

property runtime

runtime: pulumi.Input<string>;

See [Runtimes][6] for valid values.

property s3Bucket

s3Bucket?: pulumi.Input<string>;

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

property s3Key

s3Key?: pulumi.Input<string>;

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

property s3ObjectVersion

s3ObjectVersion?: pulumi.Input<string>;

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

property sourceCodeHash

sourceCodeHash?: pulumi.Input<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or 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]: any}>;

A mapping of tags to assign to the object.

property timeout

timeout?: pulumi.Input<number>;

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

property tracingConfig

tracingConfig?: pulumi.Input<inputs.lambda.FunctionTracingConfig>;

property vpcConfig

vpcConfig?: pulumi.Input<inputs.lambda.FunctionVpcConfig>;

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

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) identifying your Lambda Function.

property code

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

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

property deadLetterConfig

deadLetterConfig?: pulumi.Input<inputs.lambda.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<inputs.lambda.FunctionEnvironment>;

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

property handler

handler?: pulumi.Input<string>;

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

property invokeArn

invokeArn?: pulumi.Input<string>;

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

property kmsKeyArn

kmsKeyArn?: pulumi.Input<string>;

The ARN for the KMS encryption key.

property lastModified

lastModified?: pulumi.Input<string>;

The date this resource was last modified.

property 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][10]

property memorySize

memorySize?: pulumi.Input<number>;

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

property name

name?: pulumi.Input<string>;

A unique name for your Lambda Function.

property publish

publish?: pulumi.Input<boolean>;

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

property qualifiedArn

qualifiedArn?: pulumi.Input<string>;

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

property reservedConcurrentExecutions

reservedConcurrentExecutions?: pulumi.Input<number>;

The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. See [Managing Concurrency][9]

property role

role?: pulumi.Input<ARN>;

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

property runtime

runtime?: pulumi.Input<string>;

See [Runtimes][6] for valid values.

property s3Bucket

s3Bucket?: pulumi.Input<string>;

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

property s3Key

s3Key?: pulumi.Input<string>;

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

property s3ObjectVersion

s3ObjectVersion?: pulumi.Input<string>;

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

property sourceCodeHash

sourceCodeHash?: pulumi.Input<string>;

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or 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]: any}>;

A mapping of tags to assign to the object.

property timeout

timeout?: pulumi.Input<number>;

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

property tracingConfig

tracingConfig?: pulumi.Input<inputs.lambda.FunctionTracingConfig>;

property version

version?: pulumi.Input<string>;

Latest published version of your Lambda Function.

property vpcConfig

vpcConfig?: pulumi.Input<inputs.lambda.FunctionVpcConfig>;

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

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]: any};

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: outputs.lambda.GetFunctionDeadLetterConfig;

Configure the function’s dead letter queue.

property description

description: string;

Description of what your Lambda Function does.

property environment

environment: outputs.lambda.GetFunctionEnvironment;

The Lambda environment’s configuration settings.

property functionName

functionName: string;

property handler

handler: string;

The function entrypoint in your code.

property id

id: string;

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

property invokeArn

invokeArn: string;

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

property kmsKeyArn

kmsKeyArn: string;

The ARN for the KMS encryption key.

property lastModified

lastModified: string;

The date this resource was last modified.

property 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]: any};

property timeout

timeout: number;

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

property tracingConfig

tracingConfig: outputs.lambda.GetFunctionTracingConfig;

Tracing settings of the function.

property version

version: string;

The version of the Lambda function.

property vpcConfig

vpcConfig: outputs.lambda.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;

id is 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.

property resultMap

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

This field is set only if result is a map of primitive types, where the map is string keys and string values.

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][1] 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;

id is 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): boolean

let Java8Runtime

let Java8Runtime: Runtime = "java8";

interface LayerVersionArgs

interface LayerVersionArgs

The set of arguments for constructing a LayerVersion resource.

property code

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

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

property compatibleRuntimes

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

A list of [Runtimes][2] 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][3].

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<pulumi.asset.Archive>;

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

property compatibleRuntimes

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

A list of [Runtimes][2] 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][3].

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 NodeJS8d10Runtime

let NodeJS8d10Runtime: Runtime = "nodejs8.10";

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][1].

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

property statementId

statementId?: pulumi.Input<string>;

A unique statement identifier. By default generated by 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][1].

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

property statementId

statementId?: pulumi.Input<string>;

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

property statementIdPrefix

statementIdPrefix?: pulumi.Input<string>;

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

let Python2d7Runtime

let Python2d7Runtime: Runtime = "python2.7";

let Python3d6Runtime

let Python3d6Runtime: Runtime = "python3.6";

let Python3d7Runtime

let Python3d7Runtime: Runtime = "python3.7";

let Ruby2d5Runtime

let Ruby2d5Runtime: Runtime = "ruby2.5";

type Runtime

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

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