lambda-function
cloudposse/lambda-function/aws
A module for launching Lambda Fuctions
This module deploys an AWS Lambda function from a Zip file or from a Docker image. Additionally, it creates an IAM role for the Lambda function, which optionally attaches policies to allow for CloudWatch Logs, Cloudwatch Insights, VPC Access and X-Ray tracing. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage For a complete example, see examples/complete. For automated tests of the complete example using bats and Terratest (which tests and deploys the example on AWS), see test. ``hcl module "lambda" { source = "cloudposse/
| Name | Type | Description | Default |
|---|---|---|---|
| function_name | string | Unique name for the Lambda Function. | required |
| label_value_case | string | Controls the letter case of ID elements (labels) as included in `id`, set as tag | null |
| description | string | Description of what the Lambda Function does. | null |
| kms_key_arn | string | Amazon Resource Name (ARN) of the AWS Key Management Service (KMS) key that is | "" |
| memory_size | number | Amount of memory in MB the Lambda Function can use at runtime. | 128 |
| namespace | string | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp' | null |
| id_length_limit | number | Limit `id` to this many characters (minimum 6). Set to `0` for unlimited length. | null |
| permissions_boundary | string | ARN of the policy that is used to set the permissions boundary for the role | "" |
| role_name | string | The rolename used for the Lambda Function. If not provided, a default role name | null |
| invoke_function_permissions | list(object({ principal = | Defines which external source(s) can invoke this function (action 'lambda:Invoke | [] |
| tenant | string | ID element _(Rarely used, not included by default)_. A customer identifier, indi | null |
| labels_as_tags | set(string) | Set of labels (ID elements) to include as tags in the `tags` output. Default is | [
"default"
] |
| image_uri | string | The ECR image URI containing the function's deployment package. Conflicts with f | null |
| tracing_config_mode | string | Tracing config mode of the Lambda function. Can be either PassThrough or Active. | null |
| reserved_concurrent_executions | number | The amount of reserved concurrent executions for this lambda function. A value o | -1 |
| layers | list(string) | List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda Functio | [] |
| package_type | string | The Lambda deployment package type. Valid values are Zip and Image. | "Zip" |
| iam_policy_description | string | Description of the IAM policy for the Lambda IAM role | "Provides minimum SSM read permissions." |
| stage | string | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bu | null |
| cloudwatch_lambda_insights_enabled | bool | Enable CloudWatch Lambda Insights for the Lambda Function. | false |
| inline_iam_policy | string | Inline policy document (JSON) to attach to the lambda role | null |
| … and 10 more inputs | |||
cloudwatch_log_group_name — Name of Cloudwatch log grouparn — ARN of the lambda functioninvoke_arn — Invoke ARN of the lambda functionqualified_arn — ARN identifying your Lambda Function Version (if versioning is enabled via publish = true)function_name — Lambda function namerole_name — Lambda IAM role namerole_arn — Lambda IAM role ARN