lambda-with-inline-code
babbel/lambda-with-inline-code/aws
Terraform module creating a Lambda function with inline code
Install
README
Lambda Function with Inline Code This module creates a Lambda function, as well as its IAM role and CloudWatch Logs group with inline code, i.e. the code of the Lambda function is uploaded by Terraform. Usage ``tf module "lambda" { source = "babbel/lambda-with-inline-code/aws" version = "~> 1.2" function_name = "example" description = "This is an example" runtime = "nodejs12.x" handler = "index.handler" memory_size = 128 timeout = 3 reserved_concurrent_executions = 1 environment_variables = { NODE_ENV = "production" } source_dir = "lambda/src" } ``
Inputs (20)
| Name | Type | Description | Default |
|---|---|---|---|
| memory_size | number | The amount of memory (in MB) available to the function at runtime. Increasing th | required |
| reserved_concurrent_executions | number | The number of simultaneous executions to reserve for the Lambda function. | required |
| function_name | string | Name of the Lambda function. | required |
| timeout | number | The amount of time (in seconds) per execution before stopping it. | required |
| description | string | Description of the Lambda function. | required |
| handler | string | The name of the method within your code that Lambda calls to execute your functi | required |
| runtime | string | The identifier of the Lambda function [runtime](https://docs.aws.amazon.com/lamb | required |
| source_dir | string | Path of the directory which shall be packed as code of the Lambda function. Conf | null |
| region | string | Region where the resource(s) will be managed. Defaults to the region set in the | null |
| cloudwatch_log_group_retention_in_days | number | The number of days to retain the log of the Lambda function. | 3 |
| security_group_tags | map(string) | Map of tags assigned to the security group used by the Lambda function (if place | {} |
| iam_role_tags | map(string) | Map of tags assigned to the IAM role used by the Lambda function created by this | {} |
| lambda_function_tags | map(string) | Map of tags assigned to the Lambda function created by this module. Tags in this | {} |
| secret_environment_variables | map(string) | Map of environment variable names to ARNs of AWS Secret Manager secrets. Each A | {} |
| archive_file | object({ output_path | An instance of the `archive_file` data source containing the code of the Lambda | null |
| cloudwatch_log_group_tags | map(string) | Map of tags assigned to the CloudWatch log group used by the Lambda function cre | {} |
| default_tags | map(string) | Map of tags assigned to all AWS resources created by this module. | {} |
| vpc_config | object({ subnets = list( | VPC configuration of the Lambda function: * `subnets`: List of subnets in which | null |
| environment_variables | map(string) | Environment variable key-value pairs. | null |
| layers | list(string) | List of up to five Lambda layer ARNs. | [] |
Outputs (4)
this — The Lambda function.cloudwatch_log_group — The CloudWatch Logs group the Lambda function use for its logs.iam_role — The IAM role the Lambda function will assume.security_group — The VPC security group the Lambda function will use if `var.vpc_config` is specified; `null` otherwiResources (7)
Topics & Tags
Details
Similar packages
Azure landing zones Terraform module
Terraform supermodule for the Terraform platform engineering for Azure
Terraform module to deploy landing zone subscriptions (and much more) in Azure
Terraform Module to define a consistent naming convention by (namespace, stage,