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

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.

class pulumi_aws.lambda_.Alias(resource_name, opts=None, description=None, function_name=None, function_version=None, name=None, routing_config=None, __props__=None, __name__=None, __opts__=None)

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

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

import pulumi
import pulumi_aws as aws

test_lambda_alias = aws.lambda_.Alias("testLambdaAlias",
    description="a sample description",
    function_name=aws_lambda_function["lambda_function_test"]["arn"],
    function_version="1",
    routing_config={
        "additionalVersionWeights": {
            "2": 0.5,
        },
    })
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • description (pulumi.Input[str]) – Description of the alias.

  • function_name (pulumi.Input[str]) – The function ARN of the Lambda function for which you want to create an alias.

  • function*version (pulumi.Input[str]) –

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

  • name (pulumi.Input[str]) – Name for the alias you are creating. Pattern: (?!^[0-9]+$)([a-zA-Z0-9-*]+)

  • routing_config (pulumi.Input[dict]) – The Lambda alias’ route configuration settings. Fields documented below

The routing_config object supports the following:

  • additionalVersionWeights (pulumi.Input[dict]) - A map that defines the proportion of events that should be sent to different versions of a lambda function.

arn: pulumi.Output[str] = None

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

description: pulumi.Output[str] = None

Description of the alias.

function_name: pulumi.Output[str] = None

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

function_version: pulumi.Output[str] = None

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

invoke_arn: pulumi.Output[str] = None

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

name: pulumi.Output[str] = None

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

routing_config: pulumi.Output[dict] = None

The Lambda alias’ route configuration settings. Fields documented below

  • additionalVersionWeights (dict) - A map that defines the proportion of events that should be sent to different versions of a lambda function.

static get(resource_name, id, opts=None, arn=None, description=None, function_name=None, function_version=None, invoke_arn=None, name=None, routing_config=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) identifying your Lambda function alias.

  • description (pulumi.Input[str]) – Description of the alias.

  • function_name (pulumi.Input[str]) – The function ARN of the Lambda function for which you want to create an alias.

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

  • invoke*arn (pulumi.Input[str]) –

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

  • name (pulumi.Input[str]) – Name for the alias you are creating. Pattern: (?!^[0-9]+$)([a-zA-Z0-9-*]+)

  • routing_config (pulumi.Input[dict]) – The Lambda alias’ route configuration settings. Fields documented below

The routing_config object supports the following:

  • additionalVersionWeights (pulumi.Input[dict]) - A map that defines the proportion of events that should be sent to different versions of a lambda function.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.AwaitableGetAliasResult(arn=None, description=None, function_name=None, function_version=None, id=None, invoke_arn=None, name=None)
class pulumi_aws.lambda_.AwaitableGetFunctionResult(arn=None, dead_letter_config=None, description=None, environment=None, file_system_configs=None, function_name=None, handler=None, id=None, invoke_arn=None, kms_key_arn=None, last_modified=None, layers=None, memory_size=None, qualified_arn=None, qualifier=None, reserved_concurrent_executions=None, role=None, runtime=None, source_code_hash=None, source_code_size=None, tags=None, timeout=None, tracing_config=None, version=None, vpc_config=None)
class pulumi_aws.lambda_.AwaitableGetInvocationResult(function_name=None, id=None, input=None, qualifier=None, result=None, result_map=None)
class pulumi_aws.lambda_.AwaitableGetLayerVersionResult(arn=None, compatible_runtime=None, compatible_runtimes=None, created_date=None, description=None, id=None, layer_arn=None, layer_name=None, license_info=None, source_code_hash=None, source_code_size=None, version=None)
class pulumi_aws.lambda_.EventSourceMapping(resource_name, opts=None, batch_size=None, bisect_batch_on_function_error=None, destination_config=None, enabled=None, event_source_arn=None, function_name=None, maximum_batching_window_in_seconds=None, maximum_record_age_in_seconds=None, maximum_retry_attempts=None, parallelization_factor=None, starting_position=None, starting_position_timestamp=None, __props__=None, __name__=None, __opts__=None)

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

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

import pulumi
import pulumi_aws as aws

example = aws.lambda_.EventSourceMapping("example",
    event_source_arn=aws_dynamodb_table["example"]["stream_arn"],
    function_name=aws_lambda_function["example"]["arn"],
    starting_position="LATEST")
import pulumi
import pulumi_aws as aws

example = aws.lambda_.EventSourceMapping("example",
    event_source_arn=aws_kinesis_stream["example"]["arn"],
    function_name=aws_lambda_function["example"]["arn"],
    starting_position="LATEST")
import pulumi
import pulumi_aws as aws

example = aws.lambda_.EventSourceMapping("example",
    event_source_arn=aws_sqs_queue["sqs_queue_test"]["arn"],
    function_name=aws_lambda_function["example"]["arn"])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • batch_size (pulumi.Input[float]) – 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.

  • enabled (pulumi.Input[bool]) – Determines if the mapping will be enabled on creation. Defaults to true.

  • event_source_arn (pulumi.Input[str]) – The event source ARN - can be a Kinesis stream, DynamoDB stream, or SQS queue.

  • function_name (pulumi.Input[str]) – The name or the ARN of the Lambda function that will be subscribing to events.

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

  • starting_position (pulumi.Input[str]) – 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.

  • starting_position_timestamp (pulumi.Input[str]) – A timestamp in RFC3339 format of the data record which to start reading when using starting_position set to AT_TIMESTAMP. If a record with this exact timestamp does not exist, the next later record is chosen. If the timestamp is older than the current trim horizon, the oldest available record is chosen.

* `parallelization_factor`: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10.
* `maximum_retry_attempts`: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum of 0, maximum and default of 10000.
* `maximum_record_age_in_seconds`: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Minimum of 60, maximum and default of 604800.
* `bisect_batch_on_function_error`: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`.
* `destination_config`: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.

The destination_config object supports the following:

  • on_failure (pulumi.Input[dict]) - The destination configuration for failed invocations. Detailed below.

    • destination_arn (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the destination resource.

batch_size: pulumi.Output[float] = None

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.

enabled: pulumi.Output[bool] = None

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

event_source_arn: pulumi.Output[str] = None

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

function_arn: pulumi.Output[str] = None

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

function_name: pulumi.Output[str] = None

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

last_modified: pulumi.Output[str] = None

The date this resource was last modified.

last_processing_result: pulumi.Output[str] = None

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

maximum_batching_window_in_seconds: pulumi.Output[float] = None

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

starting_position: pulumi.Output[str] = None

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.

starting_position_timestamp: pulumi.Output[str] = None

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

  • parallelization_factor: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10.

  • maximum_retry_attempts: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum of 0, maximum and default of 10000.

  • maximum_record_age_in_seconds: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Minimum of 60, maximum and default of 604800.

  • bisect_batch_on_function_error: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to false.

  • destination_config: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.

state: pulumi.Output[str] = None

The state of the event source mapping.

state_transition_reason: pulumi.Output[str] = None

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

uuid: pulumi.Output[str] = None

The UUID of the created event source mapping.

static get(resource_name, id, opts=None, batch_size=None, bisect_batch_on_function_error=None, destination_config=None, enabled=None, event_source_arn=None, function_arn=None, function_name=None, last_modified=None, last_processing_result=None, maximum_batching_window_in_seconds=None, maximum_record_age_in_seconds=None, maximum_retry_attempts=None, parallelization_factor=None, starting_position=None, starting_position_timestamp=None, state=None, state_transition_reason=None, uuid=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • batch_size (pulumi.Input[float]) – 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.

  • enabled (pulumi.Input[bool]) – Determines if the mapping will be enabled on creation. Defaults to true.

  • event_source_arn (pulumi.Input[str]) – The event source ARN - can be a Kinesis stream, DynamoDB stream, or SQS queue.

  • function_arn (pulumi.Input[str]) – The the ARN of the Lambda function the event source mapping is sending events to. (Note: this is a computed value that differs from function_name above.)

  • function_name (pulumi.Input[str]) – The name or the ARN of the Lambda function that will be subscribing to events.

  • last_modified (pulumi.Input[str]) – The date this resource was last modified.

  • last_processing_result (pulumi.Input[str]) – The result of the last AWS Lambda invocation of your Lambda function.

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

  • starting_position (pulumi.Input[str]) –

    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.

  • starting_position_timestamp (pulumi.Input[str]) –

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

* `parallelization_factor`: - (Optional) The number of batches to process from each shard concurrently. Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10.
* `maximum_retry_attempts`: - (Optional) The maximum number of times to retry when the function returns an error. Only available for stream sources (DynamoDB and Kinesis). Minimum of 0, maximum and default of 10000.
* `maximum_record_age_in_seconds`: - (Optional) The maximum age of a record that Lambda sends to a function for processing. Only available for stream sources (DynamoDB and Kinesis). Minimum of 60, maximum and default of 604800.
* `bisect_batch_on_function_error`: - (Optional) If the function returns an error, split the batch in two and retry. Only available for stream sources (DynamoDB and Kinesis). Defaults to `false`.
* `destination_config`: - (Optional) An Amazon SQS queue or Amazon SNS topic destination for failed records. Only available for stream sources (DynamoDB and Kinesis). Detailed below.
Parameters
  • state (pulumi.Input[str]) – The state of the event source mapping.

  • state_transition_reason (pulumi.Input[str]) – The reason the event source mapping is in its current state.

  • uuid (pulumi.Input[str]) – The UUID of the created event source mapping.

The destination_config object supports the following:

  • on_failure (pulumi.Input[dict]) - The destination configuration for failed invocations. Detailed below.

    • destination_arn (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the destination resource.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.Function(resource_name, opts=None, code=None, dead_letter_config=None, description=None, environment=None, file_system_config=None, handler=None, kms_key_arn=None, layers=None, memory_size=None, name=None, publish=None, reserved_concurrent_executions=None, role=None, runtime=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_code_hash=None, tags=None, timeout=None, tracing_config=None, vpc_config=None, __props__=None, __name__=None, __opts__=None)

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

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

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

import pulumi
import pulumi_aws as aws

example_layer_version = aws.lambda_.LayerVersion("exampleLayerVersion")
example_function = aws.lambda_.Function("exampleFunction", layers=[example_layer_version.arn])
import pulumi
import pulumi_aws as aws

# EFS file system
efs_for_lambda = aws.efs.FileSystem("efsForLambda", tags={
    "Name": "efs_for_lambda",
})
# Mount target connects the file system to the subnet
alpha = aws.efs.MountTarget("alpha",
    file_system_id=efs_for_lambda.id,
    subnet_id=aws_subnet["subnet_for_lambda"]["id"],
    security_groups=[aws_security_group["sg_for_lambda"]["id"]])
# EFS access point used by lambda file system
access_point_for_lambda = aws.efs.AccessPoint("accessPointForLambda",
    file_system_id=efs_for_lambda.id,
    root_directory={
        "path": "/lambda",
        "creation_info": {
            "ownerGid": 1000,
            "ownerUid": 1000,
            "permissions": "777",
        },
    },
    posix_user={
        "gid": 1000,
        "uid": 1000,
    })
# A lambda function connected to an EFS file system
# ... other configuration ...
example = aws.lambda_.Function("example",
    file_system_config={
        "arn": access_point_for_lambda.arn,
        "localMountPath": "/mnt/efs",
    },
    vpc_config={
        "subnet_ids": [aws_subnet["subnet_for_lambda"]["id"]],
        "security_group_ids": [aws_security_group["sg_for_lambda"]["id"]],
    })
import pulumi
import pulumi_aws as aws

test_lambda = aws.lambda_.Function("testLambda")
# This is to optionally manage the CloudWatch Log Group for the Lambda Function.
# If skipping this resource configuration, also add "logs:CreateLogGroup" to the IAM policy below.
example = aws.cloudwatch.LogGroup("example", retention_in_days=14)
# See also the following AWS managed policy: AWSLambdaBasicExecutionRole
lambda_logging = aws.iam.Policy("lambdaLogging",
    description="IAM policy for logging from a lambda",
    path="/",
    policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*",
      "Effect": "Allow"
    }
  ]
}

""")
lambda_logs = aws.iam.RolePolicyAttachment("lambdaLogs",
    policy_arn=lambda_logging.arn,
    role=aws_iam_role["iam_for_lambda"]["name"])

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

Once you have created your deployment package you can specify it either directly as a local file (using the filename argument) or indirectly via Amazon S3 (using the s3_bucket, s3_key and s3_object_version arguments). When providing the deployment package via S3 it may be useful to use the 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.

Parameters
  • resource*name (str) –

    The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • code (pulumi.Input[pulumi.Archive]) – The path to the function’s deployment package within the local filesystem. If defined, The s3*`-prefixed options cannot be used.

  • dead_letter_config (pulumi.Input[dict]) – Nested block to configure the function’s dead letter queue. See details below.

  • description (pulumi.Input[str]) – Description of what your Lambda Function does.

  • environment (pulumi.Input[dict]) – The Lambda environment’s configuration settings. Fields documented below.

  • file_system_config (pulumi.Input[dict]) – The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with``file_system_config, EFS mount targets much be in available lifecycle state. Usedepends_on``to explicitly declare this dependency. See [Using Amazon EFS with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/services-efs.html).

  • handler (pulumi.Input[str]) – The function [entrypoint](https://docs.aws.amazon.com/lambda/latest/dg/walkthrough-custom-events-create-test-function.html) in your code.

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

  • layers (pulumi.Input[list]) – List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See [Lambda Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)

  • memory_size (pulumi.Input[float]) – Amount of memory in MB your Lambda Function can use at runtime. Defaults to``128``. See [Limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)

  • name (pulumi.Input[str]) – A unique name for your Lambda Function.

  • publish (pulumi.Input[bool]) – Whether to publish creation/change as new Lambda Function Version. Defaults to``false``.

  • reserved_concurrent_executions (pulumi.Input[float]) – The amount of reserved concurrent executions for this lambda function. A value of``0disables lambda from being triggered and-1removes any concurrency limitations. Defaults to Unreserved Concurrency Limits-1``. See [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)

  • role (pulumi.Input[str]) – 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](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html) for more details.

  • runtime (pulumi.Input[str]) – See [Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime) for valid values.

  • s3_bucket (pulumi.Input[str]) – 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.

  • s3_key (pulumi.Input[str]) – The S3 key of an object containing the function’s deployment package. Conflicts with``filename``.

  • s3_object_version (pulumi.Input[str]) – The object version containing the function’s deployment package. Conflicts with``filename``.

  • source_code_hash (pulumi.Input[str]) – Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either``filenameors3_key. The usual way to set this isfilebase64sha256(“file.zip”)(this provider 0.11.12 and later) orbase64sha256(file(“file.zip”))``(this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda function source archive.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the object.

  • timeout (pulumi.Input[float]) – The amount of time your Lambda Function has to run in seconds. Defaults to``3`. See Limits

  • vpc_config (pulumi.Input[dict]) – Provide this to allow your function to access your VPC. Fields documented below. See Lambda in VPC

The dead_letter_config object supports the following:

  • target_arn (pulumi.Input[str]) - The ARN of an SNS topic or SQS queue to notify when an invocation fails. If this option is used, the function’s IAM role must be granted suitable access to write to the target object, which means allowing either the sns:Publish or sqs:SendMessage action on this ARN, depending on which service is targeted.

The environment object supports the following:

  • variables (pulumi.Input[dict]) - A map that defines environment variables for the Lambda function.

The file_system_config object supports the following:

  • arn (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system.

  • localMountPath (pulumi.Input[str]) - The path where the function can access the file system, starting with /mnt/.

The tracing_config object supports the following:

  • mode (pulumi.Input[str]) - Can be either PassThrough or Active. If PassThrough, Lambda will only trace the request from an upstream service if it contains a tracing header with “sampled=1”. If Active, Lambda will respect any tracing header it receives from an upstream service. If no tracing header is received, Lambda will call X-Ray for a tracing decision.

The vpc_config object supports the following:

  • security_group_ids (pulumi.Input[list]) - A list of security group IDs associated with the Lambda function.

  • subnet_ids (pulumi.Input[list]) - A list of subnet IDs associated with the Lambda function.

  • vpc_id (pulumi.Input[str])

arn: pulumi.Output[str] = None

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

code: pulumi.Output[pulumi.Archive] = None

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

dead_letter_config: pulumi.Output[dict] = None

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

  • target_arn (str) - The ARN of an SNS topic or SQS queue to notify when an invocation fails. If this option is used, the function’s IAM role must be granted suitable access to write to the target object, which means allowing either the sns:Publish or sqs:SendMessage action on this ARN, depending on which service is targeted.

description: pulumi.Output[str] = None

Description of what your Lambda Function does.

environment: pulumi.Output[dict] = None

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

  • variables (dict) - A map that defines environment variables for the Lambda function.

file_system_config: pulumi.Output[dict] = None

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

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

  • localMountPath (str) - The path where the function can access the file system, starting with /mnt/.

handler: pulumi.Output[str] = None

The function entrypoint in your code.

invoke_arn: pulumi.Output[str] = None

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

kms_key_arn: pulumi.Output[str] = None

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

last_modified: pulumi.Output[str] = None

The date this resource was last modified.

layers: pulumi.Output[list] = None

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

memory_size: pulumi.Output[float] = None

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

name: pulumi.Output[str] = None

A unique name for your Lambda Function.

publish: pulumi.Output[bool] = None

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

qualified_arn: pulumi.Output[str] = None

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

reserved_concurrent_executions: pulumi.Output[float] = None

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

role: pulumi.Output[str] = None

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

runtime: pulumi.Output[str] = None

See Runtimes for valid values.

s3_bucket: pulumi.Output[str] = None

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.

s3_key: pulumi.Output[str] = None

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

s3_object_version: pulumi.Output[str] = None

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

source_code_hash: pulumi.Output[str] = None

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is 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.

source_code_size: pulumi.Output[float] = None

The size in bytes of the function .zip file.

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the object.

timeout: pulumi.Output[float] = None

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

version: pulumi.Output[str] = None

Latest published version of your Lambda Function.

vpc_config: pulumi.Output[dict] = None

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

  • security_group_ids (list) - A list of security group IDs associated with the Lambda function.

  • subnet_ids (list) - A list of subnet IDs associated with the Lambda function.

  • vpc_id (str)

static get(resource_name, id, opts=None, arn=None, code=None, dead_letter_config=None, description=None, environment=None, file_system_config=None, handler=None, invoke_arn=None, kms_key_arn=None, last_modified=None, layers=None, memory_size=None, name=None, publish=None, qualified_arn=None, reserved_concurrent_executions=None, role=None, runtime=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_code_hash=None, source_code_size=None, tags=None, timeout=None, tracing_config=None, version=None, vpc_config=None)

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

Parameters
  • resource*name (str) –

    The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system.

  • code (pulumi.Input[pulumi.Archive]) – The path to the function’s deployment package within the local filesystem. If defined, The s3*`-prefixed options cannot be used.

  • dead_letter_config (pulumi.Input[dict]) – Nested block to configure the function’s dead letter queue. See details below.

  • description (pulumi.Input[str]) – Description of what your Lambda Function does.

  • environment (pulumi.Input[dict]) – The Lambda environment’s configuration settings. Fields documented below.

  • file_system_config (pulumi.Input[dict]) – The connection settings for an EFS file system. Fields documented below. Before creating or updating Lambda functions with``file_system_config, EFS mount targets much be in available lifecycle state. Usedepends_on``to explicitly declare this dependency. See [Using Amazon EFS with Lambda](https://docs.aws.amazon.com/lambda/latest/dg/services-efs.html).

  • handler (pulumi.Input[str]) – The function [entrypoint](https://docs.aws.amazon.com/lambda/latest/dg/walkthrough-custom-events-create-test-function.html) in your code.

  • invoke_arn (pulumi.Input[str]) – The ARN to be used for invoking Lambda Function from API Gateway - to be used in``apigateway.Integration'suri``:param pulumi.Input[str] kms_key_arn: Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is used to encrypt environment variables. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key. If this configuration is provided when environment variables are not in use, the AWS Lambda API does not save this configuration and this provider will show a perpetual difference of adding the key. To fix the perpetual difference, remove this configuration.

  • last_modified (pulumi.Input[str]) – The date this resource was last modified.

  • layers (pulumi.Input[list]) – List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See [Lambda Layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)

  • memory_size (pulumi.Input[float]) – Amount of memory in MB your Lambda Function can use at runtime. Defaults to``128``. See [Limits](https://docs.aws.amazon.com/lambda/latest/dg/limits.html)

  • name (pulumi.Input[str]) – A unique name for your Lambda Function.

  • publish (pulumi.Input[bool]) – Whether to publish creation/change as new Lambda Function Version. Defaults to``false``.

  • qualified_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) identifying your Lambda Function Version (if versioning is enabled via``publish = true``).

  • reserved_concurrent_executions (pulumi.Input[float]) – The amount of reserved concurrent executions for this lambda function. A value of``0disables lambda from being triggered and-1removes any concurrency limitations. Defaults to Unreserved Concurrency Limits-1``. See [Managing Concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html)

  • role (pulumi.Input[str]) – 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](https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html) for more details.

  • runtime (pulumi.Input[str]) – See [Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/API_CreateFunction.html#SSS-CreateFunction-request-Runtime) for valid values.

  • s3_bucket (pulumi.Input[str]) – 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.

  • s3_key (pulumi.Input[str]) – The S3 key of an object containing the function’s deployment package. Conflicts with``filename``.

  • s3_object_version (pulumi.Input[str]) – The object version containing the function’s deployment package. Conflicts with``filename``.

  • source_code_hash (pulumi.Input[str]) – Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either``filenameors3_key. The usual way to set this isfilebase64sha256(“file.zip”)(this provider 0.11.12 and later) orbase64sha256(file(“file.zip”))``(this provider 0.11.11 and earlier), where “file.zip” is the local filename of the lambda function source archive.

  • source_code_size (pulumi.Input[float]) – The size in bytes of the function .zip file.

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the object.

  • timeout (pulumi.Input[float]) –

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

  • version (pulumi.Input[str]) – Latest published version of your Lambda Function.

  • vpc_config (pulumi.Input[dict]) –

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

The dead_letter_config object supports the following:

  • target_arn (pulumi.Input[str]) - The ARN of an SNS topic or SQS queue to notify when an invocation fails. If this option is used, the function’s IAM role must be granted suitable access to write to the target object, which means allowing either the sns:Publish or sqs:SendMessage action on this ARN, depending on which service is targeted.

The environment object supports the following:

  • variables (pulumi.Input[dict]) - A map that defines environment variables for the Lambda function.

The file_system_config object supports the following:

  • arn (pulumi.Input[str]) - The Amazon Resource Name (ARN) of the Amazon EFS Access Point that provides access to the file system.

  • localMountPath (pulumi.Input[str]) - The path where the function can access the file system, starting with /mnt/.

The tracing_config object supports the following:

  • mode (pulumi.Input[str]) - Can be either PassThrough or Active. If PassThrough, Lambda will only trace the request from an upstream service if it contains a tracing header with “sampled=1”. If Active, Lambda will respect any tracing header it receives from an upstream service. If no tracing header is received, Lambda will call X-Ray for a tracing decision.

The vpc_config object supports the following:

  • security_group_ids (pulumi.Input[list]) - A list of security group IDs associated with the Lambda function.

  • subnet_ids (pulumi.Input[list]) - A list of subnet IDs associated with the Lambda function.

  • vpc_id (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.FunctionEventInvokeConfig(resource_name, opts=None, destination_config=None, function_name=None, maximum_event_age_in_seconds=None, maximum_retry_attempts=None, qualifier=None, __props__=None, __name__=None, __opts__=None)

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

import pulumi
import pulumi_aws as aws

example = aws.lambda_.FunctionEventInvokeConfig("example",
    function_name=aws_lambda_alias["example"]["function_name"],
    destination_config={
        "on_failure": {
            "destination": aws_sqs_queue["example"]["arn"],
        },
        "on_success": {
            "destination": aws_sns_topic["example"]["arn"],
        },
    })
import pulumi
import pulumi_aws as aws

example = aws.lambda_.FunctionEventInvokeConfig("example",
    function_name=aws_lambda_alias["example"]["function_name"],
    maximum_event_age_in_seconds=60,
    maximum_retry_attempts=0)
import pulumi
import pulumi_aws as aws

example = aws.lambda_.FunctionEventInvokeConfig("example",
    function_name=aws_lambda_alias["example"]["function_name"],
    qualifier=aws_lambda_alias["example"]["name"])
# ... other configuration ...
import pulumi
import pulumi_aws as aws

example = aws.lambda_.FunctionEventInvokeConfig("example",
    function_name=aws_lambda_function["example"]["function_name"],
    qualifier="$LATEST")
# ... other configuration ...
import pulumi
import pulumi_aws as aws

example = aws.lambda_.FunctionEventInvokeConfig("example",
    function_name=aws_lambda_function["example"]["function_name"],
    qualifier=aws_lambda_function["example"]["version"])
# ... other configuration ...
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • destination_config (pulumi.Input[dict]) – Configuration block with destination configuration. See below for details.

  • function_name (pulumi.Input[str]) – Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier.

  • maximum_event_age_in_seconds (pulumi.Input[float]) – Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600.

  • maximum_retry_attempts (pulumi.Input[float]) – Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2.

  • qualifier (pulumi.Input[str]) – Lambda Function published version, $LATEST, or Lambda Alias name.

The destination_config object supports the following:

  • on_failure (pulumi.Input[dict]) - Configuration block with destination configuration for failed asynchronous invocations. See below for details.

    • destination (pulumi.Input[str]) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

  • onSuccess (pulumi.Input[dict]) - Configuration block with destination configuration for successful asynchronous invocations. See below for details.

    • destination (pulumi.Input[str]) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

destination_config: pulumi.Output[dict] = None

Configuration block with destination configuration. See below for details.

  • on_failure (dict) - Configuration block with destination configuration for failed asynchronous invocations. See below for details.

    • destination (str) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

  • onSuccess (dict) - Configuration block with destination configuration for successful asynchronous invocations. See below for details.

    • destination (str) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

function_name: pulumi.Output[str] = None

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

maximum_event_age_in_seconds: pulumi.Output[float] = None

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

maximum_retry_attempts: pulumi.Output[float] = None

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

qualifier: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, destination_config=None, function_name=None, maximum_event_age_in_seconds=None, maximum_retry_attempts=None, qualifier=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • destination_config (pulumi.Input[dict]) – Configuration block with destination configuration. See below for details.

  • function_name (pulumi.Input[str]) – Name or Amazon Resource Name (ARN) of the Lambda Function, omitting any version or alias qualifier.

  • maximum_event_age_in_seconds (pulumi.Input[float]) – Maximum age of a request that Lambda sends to a function for processing in seconds. Valid values between 60 and 21600.

  • maximum_retry_attempts (pulumi.Input[float]) – Maximum number of times to retry when the function returns an error. Valid values between 0 and 2. Defaults to 2.

  • qualifier (pulumi.Input[str]) – Lambda Function published version, $LATEST, or Lambda Alias name.

The destination_config object supports the following:

  • on_failure (pulumi.Input[dict]) - Configuration block with destination configuration for failed asynchronous invocations. See below for details.

    • destination (pulumi.Input[str]) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

  • onSuccess (pulumi.Input[dict]) - Configuration block with destination configuration for successful asynchronous invocations. See below for details.

    • destination (pulumi.Input[str]) - Amazon Resource Name (ARN) of the destination resource. See the Lambda Developer Guide for acceptable resource types and associated IAM permissions.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.GetAliasResult(arn=None, description=None, function_name=None, function_version=None, id=None, invoke_arn=None, name=None)

A collection of values returned by getAlias.

arn = None

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

description = None

Description of alias.

function_version = None

Lambda function version which the alias uses.

id = None

The provider-assigned unique ID for this managed resource.

invoke_arn = None

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

class pulumi_aws.lambda_.GetFunctionResult(arn=None, dead_letter_config=None, description=None, environment=None, file_system_configs=None, function_name=None, handler=None, id=None, invoke_arn=None, kms_key_arn=None, last_modified=None, layers=None, memory_size=None, qualified_arn=None, qualifier=None, reserved_concurrent_executions=None, role=None, runtime=None, source_code_hash=None, source_code_size=None, tags=None, timeout=None, tracing_config=None, version=None, vpc_config=None)

A collection of values returned by getFunction.

arn = None

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

dead_letter_config = None

Configure the function’s dead letter queue.

description = None

Description of what your Lambda Function does.

environment = None

The Lambda environment’s configuration settings.

file_system_configs = None

The connection settings for an Amazon EFS file system.

handler = None

The function entrypoint in your code.

id = None

The provider-assigned unique ID for this managed resource.

invoke_arn = None

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

kms_key_arn = None

The ARN for the KMS encryption key.

last_modified = None

The date this resource was last modified.

layers = None

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

memory_size = None

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

qualified_arn = None

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

reserved_concurrent_executions = None

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

role = None

IAM role attached to the Lambda Function.

runtime = None

The runtime environment for the Lambda function..

source_code_hash = None

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

source_code_size = None

The size in bytes of the function .zip file.

timeout = None

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

tracing_config = None

Tracing settings of the function.

version = None

The version of the Lambda function.

vpc_config = None

VPC configuration associated with your Lambda function.

class pulumi_aws.lambda_.GetInvocationResult(function_name=None, id=None, input=None, qualifier=None, result=None, result_map=None)

A collection of values returned by getInvocation.

id = None

The provider-assigned unique ID for this managed resource.

result = None

String result of the lambda function invocation.

result_map = None

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

class pulumi_aws.lambda_.GetLayerVersionResult(arn=None, compatible_runtime=None, compatible_runtimes=None, created_date=None, description=None, id=None, layer_arn=None, layer_name=None, license_info=None, source_code_hash=None, source_code_size=None, version=None)

A collection of values returned by getLayerVersion.

arn = None

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

compatible_runtimes = None

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

created_date = None

The date this resource was created.

description = None

Description of the specific Lambda Layer version.

id = None

The provider-assigned unique ID for this managed resource.

layer_arn = None

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

license_info = None

License info associated with the specific Lambda Layer version.

source_code_hash = None

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

source_code_size = None

The size in bytes of the function .zip file.

version = None

This Lamba Layer version.

class pulumi_aws.lambda_.LayerVersion(resource_name, opts=None, code=None, compatible_runtimes=None, description=None, layer_name=None, license_info=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_code_hash=None, __props__=None, __name__=None, __opts__=None)

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

import pulumi
import pulumi_aws as aws

lambda_layer = aws.lambda_.LayerVersion("lambdaLayer",
    compatible_runtimes=["nodejs8.10"],
    code=pulumi.FileArchive("lambda_layer_payload.zip"),
    layer_name="lambda_layer_name")

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

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 s3_bucket, s3_key and s3_object_version arguments). When providing the deployment package via S3 it may be useful to use the 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.

Parameters
  • resource*name (str) –

    The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • code (pulumi.Input[pulumi.Archive]) – The path to the function’s deployment package within the local filesystem. If defined, The s3*`-prefixed options cannot be used.

  • compatible_runtimes (pulumi.Input[list]) – A list of [Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleRuntimes) this layer is compatible with. Up to 5 runtimes can be specified.

  • description (pulumi.Input[str]) – Description of what your Lambda Layer does.

  • layer_name (pulumi.Input[str]) – A unique name for your Lambda Layer

  • license_info (pulumi.Input[str]) – License info for your Lambda Layer. See [License Info](https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-LicenseInfo).

  • s3_bucket (pulumi.Input[str]) – 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.

  • s3_key (pulumi.Input[str]) – The S3 key of an object containing the function’s deployment package. Conflicts with``filename``.

  • s3_object_version (pulumi.Input[str]) – The object version containing the function’s deployment package. Conflicts with``filename``.

  • source_code_hash (pulumi.Input[str]) – Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either``filenameors3_key. 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.

arn: pulumi.Output[str] = None

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

code: pulumi.Output[pulumi.Archive] = None

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

compatible_runtimes: pulumi.Output[list] = None

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

created_date: pulumi.Output[str] = None

The date this resource was created.

description: pulumi.Output[str] = None

Description of what your Lambda Layer does.

layer_arn: pulumi.Output[str] = None

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

layer_name: pulumi.Output[str] = None

A unique name for your Lambda Layer

license_info: pulumi.Output[str] = None

License info for your Lambda Layer. See License Info.

s3_bucket: pulumi.Output[str] = None

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.

s3_key: pulumi.Output[str] = None

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

s3_object_version: pulumi.Output[str] = None

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

source_code_hash: pulumi.Output[str] = None

Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key. The usual way to set this is ${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.

source_code_size: pulumi.Output[float] = None

The size in bytes of the function .zip file.

version: pulumi.Output[str] = None

This Lamba Layer version.

static get(resource_name, id, opts=None, arn=None, code=None, compatible_runtimes=None, created_date=None, description=None, layer_arn=None, layer_name=None, license_info=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_code_hash=None, source_code_size=None, version=None)

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

Parameters
  • resource*name (str) –

    The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the Lambda Layer with version.

  • code (pulumi.Input[pulumi.Archive]) – The path to the function’s deployment package within the local filesystem. If defined, The s3*`-prefixed options cannot be used.

  • compatible_runtimes (pulumi.Input[list]) – A list of [Runtimes](https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-CompatibleRuntimes) this layer is compatible with. Up to 5 runtimes can be specified.

  • created_date (pulumi.Input[str]) – The date this resource was created.

  • description (pulumi.Input[str]) – Description of what your Lambda Layer does.

  • layer_arn (pulumi.Input[str]) – The Amazon Resource Name (ARN) of the Lambda Layer without version.

  • layer_name (pulumi.Input[str]) – A unique name for your Lambda Layer

  • license_info (pulumi.Input[str]) – License info for your Lambda Layer. See [License Info](https://docs.aws.amazon.com/lambda/latest/dg/API_PublishLayerVersion.html#SSS-PublishLayerVersion-request-LicenseInfo).

  • s3_bucket (pulumi.Input[str]) – 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.

  • s3_key (pulumi.Input[str]) – The S3 key of an object containing the function’s deployment package. Conflicts with``filename``.

  • s3_object_version (pulumi.Input[str]) – The object version containing the function’s deployment package. Conflicts with``filename``.

  • source_code_hash (pulumi.Input[str]) – Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either``filenameors3_key. 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.

  • source_code_size (pulumi.Input[float]) – The size in bytes of the function .zip file.

  • version (pulumi.Input[str]) – This Lamba Layer version.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.Permission(resource_name, opts=None, action=None, event_source_token=None, function=None, principal=None, qualifier=None, source_account=None, source_arn=None, statement_id=None, statement_id_prefix=None, __props__=None, __name__=None, __opts__=None)

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

import pulumi
import pulumi_aws as aws

iam_for_lambda = aws.iam.Role("iamForLambda", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}

""")
test_lambda = aws.lambda_.Function("testLambda",
    code=pulumi.FileArchive("lambdatest.zip"),
    handler="exports.handler",
    role=iam_for_lambda.arn,
    runtime="nodejs8.10")
test_alias = aws.lambda_.Alias("testAlias",
    description="a sample description",
    function_name=test_lambda.name,
    function_version="$LATEST")
allow_cloudwatch = aws.lambda_.Permission("allowCloudwatch",
    action="lambda:InvokeFunction",
    function=test_lambda.name,
    principal="events.amazonaws.com",
    qualifier=test_alias.name,
    source_arn="arn:aws:events:eu-west-1:111122223333:rule/RunDaily")
import pulumi
import pulumi_aws as aws

default_topic = aws.sns.Topic("defaultTopic")
default_role = aws.iam.Role("defaultRole", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}

""")
func = aws.lambda_.Function("func",
    code=pulumi.FileArchive("lambdatest.zip"),
    handler="exports.handler",
    role=default_role.arn,
    runtime="python2.7")
with_sns = aws.lambda_.Permission("withSns",
    action="lambda:InvokeFunction",
    function=func.name,
    principal="sns.amazonaws.com",
    source_arn=default_topic.arn)
lambda_ = aws.sns.TopicSubscription("lambda",
    endpoint=func.arn,
    protocol="lambda",
    topic=default_topic.arn)
import pulumi
import pulumi_aws as aws

my_demo_api = aws.apigateway.RestApi("myDemoAPI", description="This is my API for demonstration purposes")
lambda_permission = aws.lambda_.Permission("lambdaPermission",
    action="lambda:InvokeFunction",
    function="MyDemoFunction",
    principal="apigateway.amazonaws.com",
    source_arn=my_demo_api.execution_arn.apply(lambda execution_arn: f"{execution_arn}/*/*/*"))
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • action (pulumi.Input[str]) – The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)

  • event_source_token (pulumi.Input[str]) – The Event Source Token to validate. Used with Alexa Skills.

  • function (pulumi.Input[dict]) – Name of the Lambda function whose resource policy you are updating

  • principal (pulumi.Input[str]) – 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.

  • qualifier (pulumi.Input[str]) – 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

  • source_account (pulumi.Input[str]) – This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner.

  • source_arn (pulumi.Input[str]) – When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. Without this, any resource from principal will be granted permission – even if that resource is from another account. For S3, this should be the ARN of the S3 Bucket. For CloudWatch Events, this should be the ARN of the CloudWatch Events Rule. For API Gateway, this should be the ARN of the API, as described here.

  • statement_id (pulumi.Input[str]) – A unique statement identifier. By default generated by this provider.

  • statement_id_prefix (pulumi.Input[str]) – A statement identifier prefix. This provider will generate a unique suffix. Conflicts with statement_id.

action: pulumi.Output[str] = None

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

event_source_token: pulumi.Output[str] = None

The Event Source Token to validate. Used with Alexa Skills.

function: pulumi.Output[str] = None

Name of the Lambda function whose resource policy you are updating

principal: pulumi.Output[str] = None

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.

qualifier: pulumi.Output[str] = None

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

source_account: pulumi.Output[str] = None

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

source_arn: pulumi.Output[str] = None

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

statement_id: pulumi.Output[str] = None

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

statement_id_prefix: pulumi.Output[str] = None

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

static get(resource_name, id, opts=None, action=None, event_source_token=None, function=None, principal=None, qualifier=None, source_account=None, source_arn=None, statement_id=None, statement_id_prefix=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • action (pulumi.Input[str]) – The AWS Lambda action you want to allow in this statement. (e.g. lambda:InvokeFunction)

  • event_source_token (pulumi.Input[str]) –

    The Event Source Token to validate. Used with Alexa Skills.

  • function (pulumi.Input[dict]) – Name of the Lambda function whose resource policy you are updating

  • principal (pulumi.Input[str]) – 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.

  • qualifier (pulumi.Input[str]) – 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

  • source_account (pulumi.Input[str]) – This parameter is used for S3 and SES. The AWS account ID (without a hyphen) of the source owner.

  • source_arn (pulumi.Input[str]) –

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

  • statement_id (pulumi.Input[str]) – A unique statement identifier. By default generated by this provider.

  • statement_id_prefix (pulumi.Input[str]) – A statement identifier prefix. This provider will generate a unique suffix. Conflicts with statement_id.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_aws.lambda_.ProvisionedConcurrencyConfig(resource_name, opts=None, function_name=None, provisioned_concurrent_executions=None, qualifier=None, __props__=None, __name__=None, __opts__=None)

Manages a Lambda Provisioned Concurrency Configuration.

import pulumi
import pulumi_aws as aws

example = aws.lambda_.ProvisionedConcurrencyConfig("example",
    function_name=aws_lambda_alias["example"]["function_name"],
    provisioned_concurrent_executions=1,
    qualifier=aws_lambda_alias["example"]["name"])
import pulumi
import pulumi_aws as aws

example = aws.lambda_.ProvisionedConcurrencyConfig("example",
    function_name=aws_lambda_function["example"]["function_name"],
    provisioned_concurrent_executions=1,
    qualifier=aws_lambda_function["example"]["version"])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • function_name (pulumi.Input[str]) – Name or Amazon Resource Name (ARN) of the Lambda Function.

  • provisioned_concurrent_executions (pulumi.Input[float]) – Amount of capacity to allocate. Must be greater than or equal to 1.

  • qualifier (pulumi.Input[str]) – Lambda Function version or Lambda Alias name.

function_name: pulumi.Output[str] = None

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

provisioned_concurrent_executions: pulumi.Output[float] = None

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

qualifier: pulumi.Output[str] = None

Lambda Function version or Lambda Alias name.

static get(resource_name, id, opts=None, function_name=None, provisioned_concurrent_executions=None, qualifier=None)

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

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • function_name (pulumi.Input[str]) – Name or Amazon Resource Name (ARN) of the Lambda Function.

  • provisioned_concurrent_executions (pulumi.Input[float]) – Amount of capacity to allocate. Must be greater than or equal to 1.

  • qualifier (pulumi.Input[str]) – Lambda Function version or Lambda Alias name.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

pulumi_aws.lambda_.get_alias(function_name=None, name=None, opts=None)

Provides information about a Lambda Alias.

import pulumi
import pulumi_aws as aws

production = aws.lambda.get_alias(function_name="my-lambda-func",
    name="production")
Parameters
  • function_name (str) – Name of the aliased Lambda function.

  • name (str) – Name of the Lambda alias.

pulumi_aws.lambda_.get_function(function_name=None, qualifier=None, tags=None, opts=None)

Provides information about a Lambda Function.

import pulumi
import pulumi_aws as aws

config = pulumi.Config()
function_name = config.require_object("functionName")
existing = aws.lambda.get_function(function_name=function_name)
Parameters
  • function_name (str) – Name of the lambda function.

  • qualifier (str) – Alias name or version number of the lambda function. e.g. $LATEST, my-alias, or 1

pulumi_aws.lambda_.get_invocation(function_name=None, input=None, qualifier=None, opts=None)

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

Parameters
  • function_name (str) – The name of the lambda function.

  • input (str) – A string in JSON format that is passed as payload to the lambda function.

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

pulumi_aws.lambda_.get_layer_version(compatible_runtime=None, layer_name=None, version=None, opts=None)

Provides information about a Lambda Layer Version.

import pulumi
import pulumi_aws as aws

config = pulumi.Config()
layer_name = config.require_object("layerName")
existing = aws.lambda.get_layer_version(layer_name=layer_name)
Parameters
  • compatible_runtime (str) – Specific runtime the layer version must support. Conflicts with version. If specified, the latest available layer version supporting the provided runtime will be used.

  • layer_name (str) – Name of the lambda layer.

  • version (float) – Specific layer version. Conflicts with compatible_runtime. If omitted, the latest available layer version will be used.