lambda

class pulumi_aws.lambda_.Alias(resource_name, opts=None, description=None, function_name=None, function_version=None, name=None, routing_config=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?][1] For information about function aliases, see [CreateAlias][2] and [AliasRoutingConfiguration][3] in the API docs.

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
arn = None

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

description = None

Description of the alias.

function_name = None

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

function_version = None

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

invoke_arn = None

The ARN to be used for invoking Lambda Function from API Gateway - to be used in ``aws_api_gateway_integration` <https://www.terraform.io/docs/providers/aws/r/api_gateway_integration.html>`_’s uri

name = None

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

routing_config = None

The Lambda alias’ route configuration settings. Fields documented below

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_.EventSourceMapping(resource_name, opts=None, batch_size=None, enabled=None, event_source_arn=None, function_name=None, starting_position=None, starting_position_timestamp=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?][1]. For information about event source mappings, see [CreateEventSourceMapping][2] in the API docs.

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 either be a Kinesis or DynamoDB stream.
  • function_name (pulumi.Input[str]) – The name or the ARN of the Lambda function that will be subscribing to events.
  • 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.
batch_size = 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 = None

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

event_source_arn = None

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

function_arn = 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 = None

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

last_modified = None

The date this resource was last modified.

last_processing_result = None

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

starting_position = 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 = 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.

state = None

The state of the event source mapping.

state_transition_reason = None

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

uuid = None

The UUID of the created event source mapping.

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, dead_letter_config=None, description=None, environment=None, code=None, name=None, handler=None, kms_key_arn=None, layers=None, memory_size=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, __name__=None, __opts__=None)

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

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

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

Once you have created your deployment package you can specify it either directly as a local file (using the filename argument) or indirectly via Amazon S3 (using the s3_bucket, s3_key and s3_object_version arguments). When providing the deployment package via S3 it may be useful to use the aws_s3_bucket_object 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.
  • 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.
  • 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.
  • name (pulumi.Input[str]) – A unique name for your Lambda Function.
  • handler (pulumi.Input[str]) – The function [entrypoint][3] in your code.
  • kms_key_arn (pulumi.Input[str]) – The ARN for the KMS encryption key.
  • layers (pulumi.Input[list]) – List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See [Lambda Layers][10]
  • memory_size (pulumi.Input[float]) – Amount of memory in MB your Lambda Function can use at runtime. Defaults to``128``. See [Limits][5]
  • 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][9]
  • 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][4] for more details.
  • runtime (pulumi.Input[str]) – See [Runtimes][6] 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 is${base64sha256(file(“file.zip”))}``, 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][5]
  • vpc_config (pulumi.Input[dict]) – Provide this to allow your function to access your VPC. Fields documented below. See [Lambda in VPC][7]
arn = None

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

dead_letter_config = None

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

description = None

Description of what your Lambda Function does.

environment = None

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

code = None

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

name = None

A unique name for your Lambda Function.

handler = None

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

invoke_arn = None

The ARN to be used for invoking Lambda Function from API Gateway - to be used in ``aws_api_gateway_integration` <https://www.terraform.io/docs/providers/aws/r/api_gateway_integration.html>`_’s uri

kms_key_arn = None

The ARN for the KMS encryption key.

last_modified = None

The date this resource was last modified.

layers = None

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

memory_size = None

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

publish = None

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

qualified_arn = None

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

reserved_concurrent_executions = 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][9]

role = 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][4] for more details.

runtime = None

See [Runtimes][6] for valid values.

s3_bucket = 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 = None

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

s3_object_version = None

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

source_code_hash = 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 ${base64sha256(file("file.zip"))}, where “file.zip” is the local filename of the lambda function source archive.

source_code_size = None

The size in bytes of the function .zip file.

tags = None

A mapping of tags to assign to the object.

timeout = None

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

version = None

Latest published version of your Lambda Function.

vpc_config = None

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

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_.GetFunctionResult(arn=None, dead_letter_config=None, description=None, environment=None, function_name=None, handler=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, id=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.

handler = None

The function entrypoint in your code.

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.

id = None

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

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

A collection of values returned by getInvocation.

result = None

A result of the lambda function invocation.

result_map = None

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

id = None

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

class pulumi_aws.lambda_.GetLayerVersionResult(arn=None, compatible_runtime=None, compatible_runtimes=None, created_date=None, description=None, layer_arn=None, layer_name=None, license_info=None, source_code_hash=None, source_code_size=None, version=None, id=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][1] 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.

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.

id = None

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

class pulumi_aws.lambda_.LayerVersion(resource_name, opts=None, compatible_runtimes=None, description=None, filename=None, layer_name=None, license_info=None, s3_bucket=None, s3_key=None, s3_object_version=None, source_code_hash=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][1]

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][2] 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 aws_s3_bucket_object 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.
  • compatible*runtimes (pulumi.Input[list]) –

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

  • description (pulumi.Input[str]) – Description of what your Lambda Layer does.
  • filename (pulumi.Input[str]) – The path to the function’s deployment package within the local filesystem. If defined, The s3*`-prefixed options cannot be used.
  • 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][3].
  • 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”)}(Terraform 0.11.12 or later) or${base64sha256(file(“file.zip”))}` (Terraform 0.11.11 and earlier), where “file.zip” is the local filename of the lambda layer source archive.
arn = None

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

compatible_runtimes = None

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

created_date = None

The date this resource was created.

description = None

Description of what your Lambda Layer does.

filename = None

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

layer_arn = None

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

layer_name = None

A unique name for your Lambda Layer

license_info = None

License info for your Lambda Layer. See [License Info][3].

s3_bucket = 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 = None

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

s3_object_version = None

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

source_code_hash = 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")} (Terraform 0.11.12 or later) or ${base64sha256(file("file.zip"))} (Terraform 0.11.11 and earlier), where “file.zip” is the local filename of the lambda layer source archive.

source_code_size = None

The size in bytes of the function .zip file.

version = None

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, __name__=None, __opts__=None)

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

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][1].
  • function (pulumi.Input[str]) – 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 granting Amazon S3 or CloudWatch Events permission to invoke your function, you should specify this field with the Amazon Resource Name (ARN) for the S3 Bucket or CloudWatch Events Rule as its value. This ensures that only events generated from the specified bucket or rule can invoke the function. API Gateway ARNs have a unique structure described here.
  • statement_id (pulumi.Input[str]) – A unique statement identifier. By default generated by Terraform.
  • statement_id_prefix (pulumi.Input[str]) – A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with statement_id.
action = None

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

event_source_token = None

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

function = None

Name of the Lambda function whose resource policy you are updating

principal = 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 = 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 = None

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

source_arn = None

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

statement_id = None

A unique statement identifier. By default generated by Terraform.

statement_id_prefix = None

A statement identifier prefix. Terraform 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
pulumi_aws.lambda_.get_function(function_name=None, qualifier=None, tags=None, opts=None)

Provides information about a Lambda Function.

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.

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

Provides information about a Lambda Layer Version.