Module library

Lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations

Version
Submodules
aliasdeploydocker-build

Inputs

40 / 138
allowed_triggersoptionalmap(any)

Map of allowed triggers to create Lambda permissions

Default{}
architecturesoptionallist(string)

Instruction set architecture for your Lambda function. Valid values are ["x86_64"] and ["arm64"].

Defaultnull
artifacts_diroptionalstring

Directory name where artifacts should be stored

Defaultbuilds
assume_role_policy_statementsoptionalany

Map of dynamic policy statements for assuming Lambda Function role (trust relationship)

Default{}
attach_async_event_policyoptionalbool

Controls whether async event policy should be added to IAM role for Lambda Function

Defaultfalse
attach_cloudwatch_logs_policyoptionalbool

Controls whether CloudWatch Logs policy should be added to IAM role for Lambda Function

Defaulttrue
attach_create_log_group_permissionoptionalbool

Controls whether to add the create log group permission to the CloudWatch logs policy

Defaulttrue
attach_dead_letter_policyoptionalbool

Controls whether SNS/SQS dead letter notification policy should be added to IAM role for Lambda Function

Defaultfalse
attach_network_policyoptionalbool

Controls whether VPC/network policy should be added to IAM role for Lambda Function

Defaultfalse
attach_policiesoptionalbool

Controls whether list of policies should be added to IAM role for Lambda Function

Defaultfalse
attach_policyoptionalbool

Controls whether policy should be added to IAM role for Lambda Function

Defaultfalse
attach_policy_jsonoptionalbool

Controls whether policy_json should be added to IAM role for Lambda Function

Defaultfalse
attach_policy_jsonsoptionalbool

Controls whether policy_jsons should be added to IAM role for Lambda Function

Defaultfalse
attach_policy_statementsoptionalbool

Controls whether policy_statements should be added to IAM role for Lambda Function

Defaultfalse
attach_tracing_policyoptionalbool

Controls whether X-Ray tracing policy should be added to IAM role for Lambda Function

Defaultfalse
authorization_typeoptionalstring

The type of authentication that the Lambda Function URL uses. Set to 'AWS_IAM' to restrict access to authenticated IAM users only. Set to 'NONE' to bypass IAM authentication and create a public endpoint.

DefaultNONE
build_in_dockeroptionalbool

Whether to build dependencies in Docker

Defaultfalse
cloudwatch_logs_deletion_protection_enabledoptionalbool

Whether to enable deletion protection for the log group.

Defaultnull
cloudwatch_logs_kms_key_idoptionalstring

The ARN of the KMS Key to use when encrypting log data.

Defaultnull
cloudwatch_logs_log_group_classoptionalstring

Specified the log class of the log group. Possible values are: `STANDARD` or `INFREQUENT_ACCESS`

Defaultnull
cloudwatch_logs_retention_in_daysoptionalnumber

Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.

Defaultnull
cloudwatch_logs_skip_destroyoptionalbool

Whether to keep the log group (and any logs it may contain) at destroy time.

Defaultfalse
cloudwatch_logs_tagsoptionalmap(string)

A map of tags to assign to the resource.

Default{}
code_signing_config_arnoptionalstring

Amazon Resource Name (ARN) for a Code Signing Configuration

Defaultnull
compatible_architecturesoptionallist(string)

A list of Architectures Lambda layer is compatible with. Currently x86_64 and arm64 can be specified.

Defaultnull
compatible_runtimesoptionallist(string)

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

Default[]
corsoptionalany

CORS settings to be used by the Lambda Function URL

Default{}
createoptionalbool

Controls whether resources should be created

Defaulttrue
create_async_event_configoptionalbool

Controls whether async event configuration for Lambda Function/Alias should be created

Defaultfalse
create_current_version_allowed_triggersoptionalbool

Whether to allow triggers on current version of Lambda Function (this will revoke permissions from previous version because Terraform manages only current resources)

Defaulttrue
create_current_version_async_event_configoptionalbool

Whether to allow async event configuration on current version of Lambda Function (this will revoke permissions from previous version because Terraform manages only current resources)

Defaulttrue
create_functionoptionalbool

Controls whether Lambda Function resource should be created

Defaulttrue
create_lambda_function_urloptionalbool

Controls whether the Lambda Function URL resource should be created

Defaultfalse
create_layeroptionalbool

Controls whether Lambda Layer resource should be created

Defaultfalse
create_packageoptionalbool

Controls whether Lambda package should be created

Defaulttrue
create_roleoptionalbool

Controls whether IAM role for Lambda Function should be created

Defaulttrue
create_sam_metadataoptionalbool

Controls whether the SAM metadata null resource should be created

Defaultfalse
create_unqualified_alias_allowed_triggersoptionalbool

Whether to allow triggers on unqualified alias pointing to $LATEST version

Defaulttrue
create_unqualified_alias_async_event_configoptionalbool

Whether to allow async event configuration on unqualified alias pointing to $LATEST version

Defaulttrue
create_unqualified_alias_lambda_function_urloptionalbool

Whether to use unqualified alias pointing to $LATEST version in Lambda Function URL

Defaulttrue

All 138 are optional — the module deploys with none of them set. Showing 40, so the site stays a static download — the remaining 98 are in the source.

Outputs

35
lambda_cloudwatch_log_group_arn

The ARN of the Cloudwatch Log Group

lambda_cloudwatch_log_group_name

The name of the Cloudwatch Log Group

lambda_event_source_mapping_arn

The event source mapping ARN

lambda_event_source_mapping_function_arn

The the ARN of the Lambda function the event source mapping is sending events to

lambda_event_source_mapping_state

The state of the event source mapping

lambda_event_source_mapping_state_transition_reason

The reason the event source mapping is in its current state

lambda_event_source_mapping_uuid

The UUID of the created event source mapping

lambda_function_arn

The ARN of the Lambda Function

lambda_function_arn_static

The static ARN of the Lambda Function. Use this to avoid cycle errors between resources (e.g., Step Functions)

lambda_function_code_sha256

The base64-encoded representation of the source code package file

lambda_function_invoke_arn

The Invoke ARN of the Lambda Function

lambda_function_kms_key_arn

The ARN for the KMS encryption key of Lambda Function

lambda_function_last_modified

The date Lambda Function resource was last modified

lambda_function_name

The name of the Lambda Function

lambda_function_qualified_arn

The ARN identifying your Lambda Function Version

lambda_function_qualified_invoke_arn

The Invoke ARN identifying your Lambda Function Version

lambda_function_signing_job_arn

ARN of the signing job

lambda_function_signing_profile_version_arn

ARN of the signing profile version

lambda_function_source_code_hash

The user-defined hash of the source code package file

lambda_function_source_code_size

The size in bytes of the function .zip file

lambda_function_url

The URL of the Lambda Function URL

lambda_function_url_id

The Lambda Function URL generated id

lambda_function_version

Latest published version of Lambda Function

lambda_layer_arn

The ARN of the Lambda Layer with version

lambda_layer_code_sha256

The base64-encoded representation of the Lambda Layer source code package file

lambda_layer_created_date

The date Lambda Layer resource was created

lambda_layer_layer_arn

The ARN of the Lambda Layer without version

lambda_layer_source_code_hash

The user-defined hash of the Lambda Layer source code package file

lambda_layer_source_code_size

The size in bytes of the Lambda Layer .zip file

lambda_layer_version

The Lambda Layer version

lambda_role_arn

The ARN of the IAM role created for the Lambda Function

lambda_role_name

The name of the IAM role created for the Lambda Function

lambda_role_unique_id

The unique id of the IAM role created for the Lambda Function

local_filename

The filename of zip archive deployed (if deployment was from local)

s3_object

The map with S3 object data of zip archive deployed (if deployment was from S3)

What the agent wires into the next module. An edge on the architecture diagram is one of these consumed by something else.