parent | title | nav_exclude |
---|---|---|
Infrastructure Components |
AWS Lambda-Python |
false |
AWS Lambda is a platform which enables serverless execution of arbitrary functions. This module specifically focuses on the Python implementatin of Lambda functions. Given a path to a folder of one or more python fyles, this module takes care of packaging the python code into a zip and uploading to a new Lambda Function in AWS. The module can also be configured with S3-based triggers, to run the function automatically whenever a file is landed in a specific S3 path.
No requirements.
The following providers are used by this module:
-
aws
-
random
-
null
-
archive
The following input variables are required:
Description: Standard name_prefix
module input. (Prefix counts towards 64-character max length for certain resource types.)
Type: string
Description: Standard environment
module input.
Type:
object({
vpc_id = string
aws_region = string
public_subnets = list(string)
private_subnets = list(string)
})
Description: Standard resource_tags
module input.
Type: map(string)
Description: True to upload source code to S3, False to upload inline with the Lambda function.
Type: bool
Description: A map of function names to create and an object with properties describing the function.
Example: functions = [ "fn_log" = { description = "Add an entry to the log whenever a file is created." handler = "main.lambda_handler" environment = {} secrets = {} } ]
Type:
map(object({
description = string
handler = string
environment = map(string)
secrets = map(string)
}))
The following input variables are optional (have default values):
Description: The python runtime, e.g. python3.8
.
Type: string
Default: "python3.8"
Description: The path to a local pip executable, used to package python dependencies.
Type: string
Default: "pip3"
Description: The amount of time which can pass before the function will timeout and fail execution.
Type: number
Default: 300
Description: Local path to a folder containing the lambda source code.
Type: string
Default: "resources/fn_log"
Description: S3 Path to where the source code zip should be uploaded.
Use in combination with: upload_to_s3 = true
Type: string
Default: null
Description: The name of an S3 bucket which will trigger this Lambda function.
Type: string
Default: null
Description: A list of objects describing the S3 trigger action.
Example: s3_triggers = [ { function_name = "fn_log" s3_bucket = "*" s3_path = "*" } ]
Type:
list(object({
function_name = string
s3_bucket = string
s3_path = string
}))
Default: null
The following outputs are exported:
Description: Full path to the local folder used to build the python package.
Description: A map of function names to the unique function ID (ARN).
Description: The IAM role used by the lambda function to access resources. Can be used to grant additional permissions to the role.
Source code for this module is available using the links below.
NOTE: This documentation was auto-generated using
terraform-docs
and s-infra
from slalom.dataops
.
Please do not attempt to manually update this file.