aws-native logo
AWS Native v0.55.0, Mar 28 23

aws-native.lambda.Function

Resource Type definition for AWS::Lambda::Function

Example Usage

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var primer = new AwsNative.Lambda.Function("primer", new()
    {
        Runtime = "nodejs12.x",
        Role = "arn:aws:iam::123456789012:role/lambda-role",
        Handler = "index.handler",
        Code = new AwsNative.Lambda.Inputs.FunctionCodeArgs
        {
            ZipFile = @"var aws = require('aws-sdk')
var response = require('cfn-response')
exports.handler = function(event, context) {
    console.log(""REQUEST RECEIVED:\n"" + JSON.stringify(event))
    // For Delete requests, immediately send a SUCCESS response.
    if (event.RequestType == ""Delete"") {
        response.send(event, context, ""SUCCESS"")
        return
    }
    var responseStatus = ""FAILED""
    var responseData = {}
    var functionName = event.ResourceProperties.FunctionName
    var lambda = new aws.Lambda()
    lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) {
        if (err) {
            responseData = {Error: ""Invoke call failed""}
            console.log(responseData.Error + "":\n"", err)
        }
        else responseStatus = ""SUCCESS""
        response.send(event, context, responseStatus, responseData)
    })
}
",
        },
        Description = "Invoke a function during stack creation.",
        TracingConfig = new AwsNative.Lambda.Inputs.FunctionTracingConfigArgs
        {
            Mode = AwsNative.Lambda.FunctionTracingConfigMode.Active,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/lambda"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := lambda.NewFunction(ctx, "primer", &lambda.FunctionArgs{
			Runtime: pulumi.String("nodejs12.x"),
			Role:    pulumi.String("arn:aws:iam::123456789012:role/lambda-role"),
			Handler: pulumi.String("index.handler"),
			Code: &lambda.FunctionCodeArgs{
				ZipFile: pulumi.String("var aws = require('aws-sdk')\nvar response = require('cfn-response')\nexports.handler = function(event, context) {\n    console.log(\"REQUEST RECEIVED:\\n\" + JSON.stringify(event))\n    // For Delete requests, immediately send a SUCCESS response.\n    if (event.RequestType == \"Delete\") {\n        response.send(event, context, \"SUCCESS\")\n        return\n    }\n    var responseStatus = \"FAILED\"\n    var responseData = {}\n    var functionName = event.ResourceProperties.FunctionName\n    var lambda = new aws.Lambda()\n    lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) {\n        if (err) {\n            responseData = {Error: \"Invoke call failed\"}\n            console.log(responseData.Error + \":\\n\", err)\n        }\n        else responseStatus = \"SUCCESS\"\n        response.send(event, context, responseStatus, responseData)\n    })\n}\n"),
			},
			Description: pulumi.String("Invoke a function during stack creation."),
			TracingConfig: &lambda.FunctionTracingConfigArgs{
				Mode: lambda.FunctionTracingConfigModeActive,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

primer = aws_native.lambda_.Function("primer",
    runtime="nodejs12.x",
    role="arn:aws:iam::123456789012:role/lambda-role",
    handler="index.handler",
    code=aws_native.lambda_.FunctionCodeArgs(
        zip_file="""var aws = require('aws-sdk')
var response = require('cfn-response')
exports.handler = function(event, context) {
    console.log("REQUEST RECEIVED:\n" + JSON.stringify(event))
    // For Delete requests, immediately send a SUCCESS response.
    if (event.RequestType == "Delete") {
        response.send(event, context, "SUCCESS")
        return
    }
    var responseStatus = "FAILED"
    var responseData = {}
    var functionName = event.ResourceProperties.FunctionName
    var lambda = new aws.Lambda()
    lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) {
        if (err) {
            responseData = {Error: "Invoke call failed"}
            console.log(responseData.Error + ":\n", err)
        }
        else responseStatus = "SUCCESS"
        response.send(event, context, responseStatus, responseData)
    })
}
""",
    ),
    description="Invoke a function during stack creation.",
    tracing_config=aws_native.lambda_.FunctionTracingConfigArgs(
        mode=aws_native.lambda_.FunctionTracingConfigMode.ACTIVE,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const primer = new aws_native.lambda.Function("primer", {
    runtime: "nodejs12.x",
    role: "arn:aws:iam::123456789012:role/lambda-role",
    handler: "index.handler",
    code: {
        zipFile: `var aws = require('aws-sdk')
var response = require('cfn-response')
exports.handler = function(event, context) {
    console.log("REQUEST RECEIVED:\\n" + JSON.stringify(event))
    // For Delete requests, immediately send a SUCCESS response.
    if (event.RequestType == "Delete") {
        response.send(event, context, "SUCCESS")
        return
    }
    var responseStatus = "FAILED"
    var responseData = {}
    var functionName = event.ResourceProperties.FunctionName
    var lambda = new aws.Lambda()
    lambda.invoke({ FunctionName: functionName }, function(err, invokeResult) {
        if (err) {
            responseData = {Error: "Invoke call failed"}
            console.log(responseData.Error + ":\\n", err)
        }
        else responseStatus = "SUCCESS"
        response.send(event, context, responseStatus, responseData)
    })
}
`,
    },
    description: "Invoke a function during stack creation.",
    tracingConfig: {
        mode: aws_native.lambda.FunctionTracingConfigMode.Active,
    },
});

Coming soon!

Example

using System.Collections.Generic;
using Pulumi;
using AwsNative = Pulumi.AwsNative;

return await Deployment.RunAsync(() => 
{
    var function = new AwsNative.Lambda.Function("function", new()
    {
        Handler = "index.handler",
        Role = "arn:aws:iam::123456789012:role/lambda-role",
        Code = new AwsNative.Lambda.Inputs.FunctionCodeArgs
        {
            S3Bucket = "my-bucket",
            S3Key = "function.zip",
        },
        Runtime = "nodejs12.x",
        Timeout = 5,
        TracingConfig = new AwsNative.Lambda.Inputs.FunctionTracingConfigArgs
        {
            Mode = AwsNative.Lambda.FunctionTracingConfigMode.Active,
        },
        VpcConfig = new AwsNative.Lambda.Inputs.FunctionVpcConfigArgs
        {
            SecurityGroupIds = new[]
            {
                "sg-085912345678492fb",
            },
            SubnetIds = new[]
            {
                "subnet-071f712345678e7c8",
                "subnet-07fd123456788a036",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/lambda"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := lambda.NewFunction(ctx, "function", &lambda.FunctionArgs{
			Handler: pulumi.String("index.handler"),
			Role:    pulumi.String("arn:aws:iam::123456789012:role/lambda-role"),
			Code: &lambda.FunctionCodeArgs{
				S3Bucket: pulumi.String("my-bucket"),
				S3Key:    pulumi.String("function.zip"),
			},
			Runtime: pulumi.String("nodejs12.x"),
			Timeout: pulumi.Int(5),
			TracingConfig: &lambda.FunctionTracingConfigArgs{
				Mode: lambda.FunctionTracingConfigModeActive,
			},
			VpcConfig: &lambda.FunctionVpcConfigArgs{
				SecurityGroupIds: pulumi.StringArray{
					pulumi.String("sg-085912345678492fb"),
				},
				SubnetIds: pulumi.StringArray{
					pulumi.String("subnet-071f712345678e7c8"),
					pulumi.String("subnet-07fd123456788a036"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

function = aws_native.lambda_.Function("function",
    handler="index.handler",
    role="arn:aws:iam::123456789012:role/lambda-role",
    code=aws_native.lambda_.FunctionCodeArgs(
        s3_bucket="my-bucket",
        s3_key="function.zip",
    ),
    runtime="nodejs12.x",
    timeout=5,
    tracing_config=aws_native.lambda_.FunctionTracingConfigArgs(
        mode=aws_native.lambda_.FunctionTracingConfigMode.ACTIVE,
    ),
    vpc_config=aws_native.lambda_.FunctionVpcConfigArgs(
        security_group_ids=["sg-085912345678492fb"],
        subnet_ids=[
            "subnet-071f712345678e7c8",
            "subnet-07fd123456788a036",
        ],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const _function = new aws_native.lambda.Function("function", {
    handler: "index.handler",
    role: "arn:aws:iam::123456789012:role/lambda-role",
    code: {
        s3Bucket: "my-bucket",
        s3Key: "function.zip",
    },
    runtime: "nodejs12.x",
    timeout: 5,
    tracingConfig: {
        mode: aws_native.lambda.FunctionTracingConfigMode.Active,
    },
    vpcConfig: {
        securityGroupIds: ["sg-085912345678492fb"],
        subnetIds: [
            "subnet-071f712345678e7c8",
            "subnet-07fd123456788a036",
        ],
    },
});

Coming soon!

Create Function Resource

new Function(name: string, args: FunctionArgs, opts?: CustomResourceOptions);
@overload
def Function(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             architectures: Optional[Sequence[_lambda_.FunctionArchitecturesItem]] = None,
             code: Optional[_lambda_.FunctionCodeArgs] = None,
             code_signing_config_arn: Optional[str] = None,
             dead_letter_config: Optional[_lambda_.FunctionDeadLetterConfigArgs] = None,
             description: Optional[str] = None,
             environment: Optional[_lambda_.FunctionEnvironmentArgs] = None,
             ephemeral_storage: Optional[_lambda_.FunctionEphemeralStorageArgs] = None,
             file_system_configs: Optional[Sequence[_lambda_.FunctionFileSystemConfigArgs]] = None,
             function_name: Optional[str] = None,
             handler: Optional[str] = None,
             image_config: Optional[_lambda_.FunctionImageConfigArgs] = None,
             kms_key_arn: Optional[str] = None,
             layers: Optional[Sequence[str]] = None,
             memory_size: Optional[int] = None,
             package_type: Optional[_lambda_.FunctionPackageType] = None,
             reserved_concurrent_executions: Optional[int] = None,
             role: Optional[str] = None,
             runtime: Optional[str] = None,
             runtime_management_config: Optional[_lambda_.FunctionRuntimeManagementConfigArgs] = None,
             snap_start: Optional[_lambda_.FunctionSnapStartArgs] = None,
             tags: Optional[Sequence[_lambda_.FunctionTagArgs]] = None,
             timeout: Optional[int] = None,
             tracing_config: Optional[_lambda_.FunctionTracingConfigArgs] = None,
             vpc_config: Optional[_lambda_.FunctionVpcConfigArgs] = None)
@overload
def Function(resource_name: str,
             args: FunctionArgs,
             opts: Optional[ResourceOptions] = None)
func NewFunction(ctx *Context, name string, args FunctionArgs, opts ...ResourceOption) (*Function, error)
public Function(string name, FunctionArgs args, CustomResourceOptions? opts = null)
public Function(String name, FunctionArgs args)
public Function(String name, FunctionArgs args, CustomResourceOptions options)
type: aws-native:lambda:Function
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FunctionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Function Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Function resource accepts the following input properties:

Code Pulumi.AwsNative.Lambda.Inputs.FunctionCodeArgs

The code for the function.

Role string

The Amazon Resource Name (ARN) of the function's execution role.

Architectures List<Pulumi.AwsNative.Lambda.FunctionArchitecturesItem>
CodeSigningConfigArn string

A unique Arn for CodeSigningConfig resource

DeadLetterConfig Pulumi.AwsNative.Lambda.Inputs.FunctionDeadLetterConfigArgs

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

Description string

A description of the function.

Environment Pulumi.AwsNative.Lambda.Inputs.FunctionEnvironmentArgs

Environment variables that are accessible from function code during execution.

EphemeralStorage Pulumi.AwsNative.Lambda.Inputs.FunctionEphemeralStorageArgs

A function's ephemeral storage settings.

FileSystemConfigs List<Pulumi.AwsNative.Lambda.Inputs.FunctionFileSystemConfigArgs>

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

FunctionName string

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

Handler string

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

ImageConfig Pulumi.AwsNative.Lambda.Inputs.FunctionImageConfigArgs

ImageConfig

KmsKeyArn string

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

Layers List<string>

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

MemorySize int

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

PackageType Pulumi.AwsNative.Lambda.FunctionPackageType

PackageType.

ReservedConcurrentExecutions int

The number of simultaneous executions to reserve for the function.

Runtime string

The identifier of the function's runtime.

RuntimeManagementConfig Pulumi.AwsNative.Lambda.Inputs.FunctionRuntimeManagementConfigArgs

RuntimeManagementConfig

SnapStart Pulumi.AwsNative.Lambda.Inputs.FunctionSnapStartArgs

The SnapStart setting of your function

Tags List<Pulumi.AwsNative.Lambda.Inputs.FunctionTagArgs>

A list of tags to apply to the function.

Timeout int

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

TracingConfig Pulumi.AwsNative.Lambda.Inputs.FunctionTracingConfigArgs

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

VpcConfig Pulumi.AwsNative.Lambda.Inputs.FunctionVpcConfigArgs

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

Code FunctionCodeArgs

The code for the function.

Role string

The Amazon Resource Name (ARN) of the function's execution role.

Architectures []FunctionArchitecturesItem
CodeSigningConfigArn string

A unique Arn for CodeSigningConfig resource

DeadLetterConfig FunctionDeadLetterConfigArgs

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

Description string

A description of the function.

Environment FunctionEnvironmentArgs

Environment variables that are accessible from function code during execution.

EphemeralStorage FunctionEphemeralStorageArgs

A function's ephemeral storage settings.

FileSystemConfigs []FunctionFileSystemConfigArgs

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

FunctionName string

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

Handler string

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

ImageConfig FunctionImageConfigArgs

ImageConfig

KmsKeyArn string

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

Layers []string

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

MemorySize int

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

PackageType FunctionPackageType

PackageType.

ReservedConcurrentExecutions int

The number of simultaneous executions to reserve for the function.

Runtime string

The identifier of the function's runtime.

RuntimeManagementConfig FunctionRuntimeManagementConfigArgs

RuntimeManagementConfig

SnapStart FunctionSnapStartArgs

The SnapStart setting of your function

Tags []FunctionTagArgs

A list of tags to apply to the function.

Timeout int

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

TracingConfig FunctionTracingConfigArgs

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

VpcConfig FunctionVpcConfigArgs

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

code FunctionCodeArgs

The code for the function.

role String

The Amazon Resource Name (ARN) of the function's execution role.

architectures List<FunctionArchitecturesItem>
codeSigningConfigArn String

A unique Arn for CodeSigningConfig resource

deadLetterConfig FunctionDeadLetterConfigArgs

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

description String

A description of the function.

environment FunctionEnvironmentArgs

Environment variables that are accessible from function code during execution.

ephemeralStorage FunctionEphemeralStorageArgs

A function's ephemeral storage settings.

fileSystemConfigs List<FunctionFileSystemConfigArgs>

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

functionName String

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

handler String

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

imageConfig FunctionImageConfigArgs

ImageConfig

kmsKeyArn String

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

layers List<String>

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

memorySize Integer

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

packageType FunctionPackageType

PackageType.

reservedConcurrentExecutions Integer

The number of simultaneous executions to reserve for the function.

runtime String

The identifier of the function's runtime.

runtimeManagementConfig FunctionRuntimeManagementConfigArgs

RuntimeManagementConfig

snapStart FunctionSnapStartArgs

The SnapStart setting of your function

tags List<FunctionTagArgs>

A list of tags to apply to the function.

timeout Integer

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

tracingConfig FunctionTracingConfigArgs

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

vpcConfig FunctionVpcConfigArgs

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

code FunctionCodeArgs

The code for the function.

role string

The Amazon Resource Name (ARN) of the function's execution role.

architectures FunctionArchitecturesItem[]
codeSigningConfigArn string

A unique Arn for CodeSigningConfig resource

deadLetterConfig FunctionDeadLetterConfigArgs

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

description string

A description of the function.

environment FunctionEnvironmentArgs

Environment variables that are accessible from function code during execution.

ephemeralStorage FunctionEphemeralStorageArgs

A function's ephemeral storage settings.

fileSystemConfigs FunctionFileSystemConfigArgs[]

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

functionName string

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

handler string

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

imageConfig FunctionImageConfigArgs

ImageConfig

kmsKeyArn string

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

layers string[]

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

memorySize number

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

packageType FunctionPackageType

PackageType.

reservedConcurrentExecutions number

The number of simultaneous executions to reserve for the function.

runtime string

The identifier of the function's runtime.

runtimeManagementConfig FunctionRuntimeManagementConfigArgs

RuntimeManagementConfig

snapStart FunctionSnapStartArgs

The SnapStart setting of your function

tags FunctionTagArgs[]

A list of tags to apply to the function.

timeout number

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

tracingConfig FunctionTracingConfigArgs

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

vpcConfig FunctionVpcConfigArgs

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

code FunctionCodeArgs

The code for the function.

role str

The Amazon Resource Name (ARN) of the function's execution role.

architectures FunctionArchitecturesItem]
code_signing_config_arn str

A unique Arn for CodeSigningConfig resource

dead_letter_config FunctionDeadLetterConfigArgs

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

description str

A description of the function.

environment FunctionEnvironmentArgs

Environment variables that are accessible from function code during execution.

ephemeral_storage FunctionEphemeralStorageArgs

A function's ephemeral storage settings.

file_system_configs FunctionFileSystemConfigArgs]

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

function_name str

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

handler str

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

image_config FunctionImageConfigArgs

ImageConfig

kms_key_arn str

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

layers Sequence[str]

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

memory_size int

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

package_type FunctionPackageType

PackageType.

reserved_concurrent_executions int

The number of simultaneous executions to reserve for the function.

runtime str

The identifier of the function's runtime.

runtime_management_config FunctionRuntimeManagementConfigArgs

RuntimeManagementConfig

snap_start FunctionSnapStartArgs

The SnapStart setting of your function

tags FunctionTagArgs]

A list of tags to apply to the function.

timeout int

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

tracing_config FunctionTracingConfigArgs

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

vpc_config FunctionVpcConfigArgs

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

code Property Map

The code for the function.

role String

The Amazon Resource Name (ARN) of the function's execution role.

architectures List<"x86_64" | "arm64">
codeSigningConfigArn String

A unique Arn for CodeSigningConfig resource

deadLetterConfig Property Map

A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.

description String

A description of the function.

environment Property Map

Environment variables that are accessible from function code during execution.

ephemeralStorage Property Map

A function's ephemeral storage settings.

fileSystemConfigs List<Property Map>

Connection settings for an Amazon EFS file system. To connect a function to a file system, a mount target must be available in every Availability Zone that your function connects to. If your template contains an AWS::EFS::MountTarget resource, you must also specify a DependsOn attribute to ensure that the mount target is created or updated before the function.

functionName String

The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one.

handler String

The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime

imageConfig Property Map

ImageConfig

kmsKeyArn String

The ARN of the AWS Key Management Service (AWS KMS) key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key.

layers List<String>

A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

memorySize Number

The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

packageType "Image" | "Zip"

PackageType.

reservedConcurrentExecutions Number

The number of simultaneous executions to reserve for the function.

runtime String

The identifier of the function's runtime.

runtimeManagementConfig Property Map

RuntimeManagementConfig

snapStart Property Map

The SnapStart setting of your function

tags List<Property Map>

A list of tags to apply to the function.

timeout Number

The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

tracingConfig Property Map

Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.

vpcConfig Property Map

For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.

Outputs

All input properties are implicitly available as output properties. Additionally, the Function resource produces the following output properties:

Arn string

Unique identifier for function resources

Id string

The provider-assigned unique ID for this managed resource.

SnapStartResponse Pulumi.AwsNative.Lambda.Outputs.FunctionSnapStartResponse

The SnapStart response of your function

Arn string

Unique identifier for function resources

Id string

The provider-assigned unique ID for this managed resource.

SnapStartResponse FunctionSnapStartResponse

The SnapStart response of your function

arn String

Unique identifier for function resources

id String

The provider-assigned unique ID for this managed resource.

snapStartResponse FunctionSnapStartResponse

The SnapStart response of your function

arn string

Unique identifier for function resources

id string

The provider-assigned unique ID for this managed resource.

snapStartResponse FunctionSnapStartResponse

The SnapStart response of your function

arn str

Unique identifier for function resources

id str

The provider-assigned unique ID for this managed resource.

snap_start_response FunctionSnapStartResponse

The SnapStart response of your function

arn String

Unique identifier for function resources

id String

The provider-assigned unique ID for this managed resource.

snapStartResponse Property Map

The SnapStart response of your function

Supporting Types

FunctionArchitecturesItem

X8664
x86_64
Arm64
arm64
FunctionArchitecturesItemX8664
x86_64
FunctionArchitecturesItemArm64
arm64
X8664
x86_64
Arm64
arm64
X8664
x86_64
Arm64
arm64
X8664
x86_64
ARM64
arm64
"x86_64"
x86_64
"arm64"
arm64

FunctionCode

ImageUri string

ImageUri.

S3Bucket string

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

S3Key string

The Amazon S3 key of the deployment package.

S3ObjectVersion string

For versioned objects, the version of the deployment package object to use.

ZipFile string

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

ImageUri string

ImageUri.

S3Bucket string

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

S3Key string

The Amazon S3 key of the deployment package.

S3ObjectVersion string

For versioned objects, the version of the deployment package object to use.

ZipFile string

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

imageUri String

ImageUri.

s3Bucket String

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

s3Key String

The Amazon S3 key of the deployment package.

s3ObjectVersion String

For versioned objects, the version of the deployment package object to use.

zipFile String

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

imageUri string

ImageUri.

s3Bucket string

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

s3Key string

The Amazon S3 key of the deployment package.

s3ObjectVersion string

For versioned objects, the version of the deployment package object to use.

zipFile string

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

image_uri str

ImageUri.

s3_bucket str

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

s3_key str

The Amazon S3 key of the deployment package.

s3_object_version str

For versioned objects, the version of the deployment package object to use.

zip_file str

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

imageUri String

ImageUri.

s3Bucket String

An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account.

s3Key String

The Amazon S3 key of the deployment package.

s3ObjectVersion String

For versioned objects, the version of the deployment package object to use.

zipFile String

The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package..

FunctionDeadLetterConfig

TargetArn string

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

TargetArn string

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

targetArn String

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

targetArn string

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

target_arn str

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

targetArn String

The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.

FunctionEnvironment

Variables object

Environment variable key-value pairs.

Variables interface{}

Environment variable key-value pairs.

variables Object

Environment variable key-value pairs.

variables any

Environment variable key-value pairs.

variables Any

Environment variable key-value pairs.

variables Any

Environment variable key-value pairs.

FunctionEphemeralStorage

Size int

The amount of ephemeral storage that your function has access to.

Size int

The amount of ephemeral storage that your function has access to.

size Integer

The amount of ephemeral storage that your function has access to.

size number

The amount of ephemeral storage that your function has access to.

size int

The amount of ephemeral storage that your function has access to.

size Number

The amount of ephemeral storage that your function has access to.

FunctionFileSystemConfig

Arn string

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

LocalMountPath string

The path where the function can access the file system, starting with /mnt/.

Arn string

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

LocalMountPath string

The path where the function can access the file system, starting with /mnt/.

arn String

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

localMountPath String

The path where the function can access the file system, starting with /mnt/.

arn string

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

localMountPath string

The path where the function can access the file system, starting with /mnt/.

arn str

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

local_mount_path str

The path where the function can access the file system, starting with /mnt/.

arn String

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

localMountPath String

The path where the function can access the file system, starting with /mnt/.

FunctionImageConfig

Command List<string>

Command.

EntryPoint List<string>

EntryPoint.

WorkingDirectory string

WorkingDirectory.

Command []string

Command.

EntryPoint []string

EntryPoint.

WorkingDirectory string

WorkingDirectory.

command List<String>

Command.

entryPoint List<String>

EntryPoint.

workingDirectory String

WorkingDirectory.

command string[]

Command.

entryPoint string[]

EntryPoint.

workingDirectory string

WorkingDirectory.

command Sequence[str]

Command.

entry_point Sequence[str]

EntryPoint.

working_directory str

WorkingDirectory.

command List<String>

Command.

entryPoint List<String>

EntryPoint.

workingDirectory String

WorkingDirectory.

FunctionPackageType

Image
Image
Zip
Zip
FunctionPackageTypeImage
Image
FunctionPackageTypeZip
Zip
Image
Image
Zip
Zip
Image
Image
Zip
Zip
IMAGE
Image
ZIP
Zip
"Image"
Image
"Zip"
Zip

FunctionRuntimeManagementConfig

UpdateRuntimeOn Pulumi.AwsNative.Lambda.FunctionRuntimeManagementConfigUpdateRuntimeOn

Trigger for runtime update

RuntimeVersionArn string

Unique identifier for a runtime version arn

UpdateRuntimeOn FunctionRuntimeManagementConfigUpdateRuntimeOn

Trigger for runtime update

RuntimeVersionArn string

Unique identifier for a runtime version arn

updateRuntimeOn FunctionRuntimeManagementConfigUpdateRuntimeOn

Trigger for runtime update

runtimeVersionArn String

Unique identifier for a runtime version arn

updateRuntimeOn FunctionRuntimeManagementConfigUpdateRuntimeOn

Trigger for runtime update

runtimeVersionArn string

Unique identifier for a runtime version arn

update_runtime_on FunctionRuntimeManagementConfigUpdateRuntimeOn

Trigger for runtime update

runtime_version_arn str

Unique identifier for a runtime version arn

updateRuntimeOn "Auto" | "FunctionUpdate" | "Manual"

Trigger for runtime update

runtimeVersionArn String

Unique identifier for a runtime version arn

FunctionRuntimeManagementConfigUpdateRuntimeOn

Auto
Auto
FunctionUpdate
FunctionUpdate
Manual
Manual
FunctionRuntimeManagementConfigUpdateRuntimeOnAuto
Auto
FunctionRuntimeManagementConfigUpdateRuntimeOnFunctionUpdate
FunctionUpdate
FunctionRuntimeManagementConfigUpdateRuntimeOnManual
Manual
Auto
Auto
FunctionUpdate
FunctionUpdate
Manual
Manual
Auto
Auto
FunctionUpdate
FunctionUpdate
Manual
Manual
AUTO
Auto
FUNCTION_UPDATE
FunctionUpdate
MANUAL
Manual
"Auto"
Auto
"FunctionUpdate"
FunctionUpdate
"Manual"
Manual

FunctionSnapStart

ApplyOn Pulumi.AwsNative.Lambda.FunctionSnapStartApplyOn

Applying SnapStart setting on function resource type.

ApplyOn FunctionSnapStartApplyOn

Applying SnapStart setting on function resource type.

applyOn FunctionSnapStartApplyOn

Applying SnapStart setting on function resource type.

applyOn FunctionSnapStartApplyOn

Applying SnapStart setting on function resource type.

apply_on FunctionSnapStartApplyOn

Applying SnapStart setting on function resource type.

applyOn "PublishedVersions" | "None"

Applying SnapStart setting on function resource type.

FunctionSnapStartApplyOn

PublishedVersions
PublishedVersions
None
None
FunctionSnapStartApplyOnPublishedVersions
PublishedVersions
FunctionSnapStartApplyOnNone
None
PublishedVersions
PublishedVersions
None
None
PublishedVersions
PublishedVersions
None
None
PUBLISHED_VERSIONS
PublishedVersions
NONE
None
"PublishedVersions"
PublishedVersions
"None"
None

FunctionSnapStartResponse

ApplyOn Pulumi.AwsNative.Lambda.FunctionSnapStartResponseApplyOn

Applying SnapStart setting on function resource type.

OptimizationStatus Pulumi.AwsNative.Lambda.FunctionSnapStartResponseOptimizationStatus

Indicates whether SnapStart is activated for the specified function version.

ApplyOn FunctionSnapStartResponseApplyOn

Applying SnapStart setting on function resource type.

OptimizationStatus FunctionSnapStartResponseOptimizationStatus

Indicates whether SnapStart is activated for the specified function version.

applyOn FunctionSnapStartResponseApplyOn

Applying SnapStart setting on function resource type.

optimizationStatus FunctionSnapStartResponseOptimizationStatus

Indicates whether SnapStart is activated for the specified function version.

applyOn FunctionSnapStartResponseApplyOn

Applying SnapStart setting on function resource type.

optimizationStatus FunctionSnapStartResponseOptimizationStatus

Indicates whether SnapStart is activated for the specified function version.

apply_on FunctionSnapStartResponseApplyOn

Applying SnapStart setting on function resource type.

optimization_status FunctionSnapStartResponseOptimizationStatus

Indicates whether SnapStart is activated for the specified function version.

applyOn "PublishedVersions" | "None"

Applying SnapStart setting on function resource type.

optimizationStatus "On" | "Off"

Indicates whether SnapStart is activated for the specified function version.

FunctionSnapStartResponseApplyOn

PublishedVersions
PublishedVersions
None
None
FunctionSnapStartResponseApplyOnPublishedVersions
PublishedVersions
FunctionSnapStartResponseApplyOnNone
None
PublishedVersions
PublishedVersions
None
None
PublishedVersions
PublishedVersions
None
None
PUBLISHED_VERSIONS
PublishedVersions
NONE
None
"PublishedVersions"
PublishedVersions
"None"
None

FunctionSnapStartResponseOptimizationStatus

On
On
Off
Off
FunctionSnapStartResponseOptimizationStatusOn
On
FunctionSnapStartResponseOptimizationStatusOff
Off
On
On
Off
Off
On
On
Off
Off
ON
On
OFF
Off
"On"
On
"Off"
Off

FunctionTag

Key string

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

Value string

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

Key string

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

Value string

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

key String

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

value String

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

key string

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

value string

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

key str

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

value str

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

key String

The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

value String

The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

FunctionTracingConfig

FunctionTracingConfigMode

Active
Active
PassThrough
PassThrough
FunctionTracingConfigModeActive
Active
FunctionTracingConfigModePassThrough
PassThrough
Active
Active
PassThrough
PassThrough
Active
Active
PassThrough
PassThrough
ACTIVE
Active
PASS_THROUGH
PassThrough
"Active"
Active
"PassThrough"
PassThrough

FunctionVpcConfig

SecurityGroupIds List<string>

A list of VPC security groups IDs.

SubnetIds List<string>

A list of VPC subnet IDs.

SecurityGroupIds []string

A list of VPC security groups IDs.

SubnetIds []string

A list of VPC subnet IDs.

securityGroupIds List<String>

A list of VPC security groups IDs.

subnetIds List<String>

A list of VPC subnet IDs.

securityGroupIds string[]

A list of VPC security groups IDs.

subnetIds string[]

A list of VPC subnet IDs.

security_group_ids Sequence[str]

A list of VPC security groups IDs.

subnet_ids Sequence[str]

A list of VPC subnet IDs.

securityGroupIds List<String>

A list of VPC security groups IDs.

subnetIds List<String>

A list of VPC subnet IDs.

Package Details

Repository
AWS Native pulumi/pulumi-aws-native
License
Apache-2.0