Define and customize Blueprints to set what infrastructure configuration options are available to developers.
---
constants:
__name: "{{ name }}_{{ __guid }}"
variables:
name:
desc: "Name of the Lambda function."
required: true
group: Lambda Function Details
runtime:
desc: "Runtime environment for the Lambda function (e.g., 'python3.8')."
required: true
group: Lambda Function Details
default: "python3.8"
handler:
desc: "Function handler in the code (e.g., 'index.handler')."
required: true
group: Lambda Function Details
default: "lambda_function.lambda_handler"
filename:
desc: "Path to the deployment package within the local filesystem."
required: true
group: Code
source_code_hash:
desc: "Base64-encoded SHA256 hash of the package file specified by filename."
required: false
group: Code
advanced: true
role:
desc: "IAM role ARN that the Lambda function assumes."
required: true
group: Permissions
links_to: resource.aws_iam_role.arn
memory_size:
desc: "Amount of memory in MB your Lambda Function can use at runtime."
required: false
group: Lambda Function Details
default: 128
timeout:
desc: "The amount of time your Lambda Function has to run in seconds."
required: false
group: Lambda Function Details
default: 3
environment_variables:
group: Environment Variables
required: false
tags:
group: Tags
required: false
groups:
Lambda Function Details:
order: 1
desc: "Basic settings for the Lambda function."
Code:
order: 2
desc: "Code deployment settings."
Permissions:
order: 3
desc: "Permissions for the Lambda function."
Environment Variables:
order: 4
desc: "Environment variables for the Lambda function."
Tags:
order: 5
desc: "Tags to assign to the Lambda function."
---
resource "aws_lambda_function" "__name" {
function_name = {{ name }}
runtime = {{ runtime }}
handler = {{ handler }}
filename = {{ filename }}
source_code_hash = {{ source_code_hash | required: false | advanced: true }}
role = {{ role }}
memory_size = {{ memory_size }}
timeout = {{ timeout }}
{{# environment_variables }}
environment {
variables = {
{{ environment_variables.key | required: false }} = {{ environment_variables.value | required: false }}
}
}
{{/ environment_variables }}
tags = {
Name = {{ name }}
{{# tags }}
{{ tags.key | required: false }} = {{ tags.value | required: false }}
{{/ tags }}
}
}
// The Lambda function is configured with a default runtime of Python 3.8 and default handler.
// Memory size and timeout are set to default values but can be customized.
// Tags are encouraged for resource identification and management.
// Environment variables can be specified as needed.
// The IAM role is required and should have the necessary permissions.
//
A form is created automatically that accepts inputs that you defined in the Blueprint.
After filling out the Blueprint form, Terraform is generated and a PR is automatically submitted.