lambda-function
dod-iac/lambda-function/aws
AWS Lambda Function
Install
README
Usage Creates an AWS Lambda Function. ``hcl module "lambda_function" { source = "dod-iac/lambda-function/aws" execution_role_name = format( "app-%s-func-lambda-execution-role-%s", var.application, var.environment ) function_name = format( "app-%s-func-%s-%s", var.application, var.environment, data.aws_region.current.name ) function_description = "Function description." filename = format("../../lambda/%s-func.zip", var.application) handler = "index.handler" runtime = "nodejs12.x" environment_variables = var.environment_variables tags = { Application = var.application Environment = var.environment Automation = "Terraform" } } ` Use the optional execution_role_policy_document variable to override the IAM policy document for the IAM role. Use the optional cloudwatch_schedule_expression variabl
Inputs (21)
| Name | Type | Description | Default |
|---|---|---|---|
| execution_role_name | string | required | |
| handler | string | The function entrypoint in your code. | required |
| function_name | string | A unique name for your Lambda Function. | required |
| filename | string | The path to the function's deployment package within the local filesystem. If d | required |
| runtime | string | The identifier of the function's runtime. | required |
| memory_size | number | Amount of memory in MB your Lambda Function can use at runtime. | 128 |
| cloudwatch_rule_description | string | The description of the CloudWatch Events rule used to schedule the execution of | "" |
| cloudwatch_target_id | string | The id of the CloudWatch Events target. Defaults to the name of the Lambda func | "" |
| environment_variables | map(string) | A map that defines environment variables for the Lambda function. | {} |
| cloudwatch_rule_name | string | The name of the CloudWatch Events rule used to schedule the execution of the Lam | "" |
| execution_role_policy_document | string | The contents of the IAM policy attached to the IAM Execution role used by the La | "" |
| function_description | string | Description of what your Lambda Function does. | "" |
| kms_key_arn | string | The ARN of the KMS key used to encrypt environment variables. | "" |
| event_sources | list(object({ event_source | A list of event sources | [] |
| execution_role_policy_name | string | The name of the IAM policy attached to the IAM Execution role used by the Lambda | "" |
| layers | list(string) | List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Functi | [] |
| tags | map(string) | A mapping of tags to assign to the Lambda Function. | {
"Automation": "Terraform"
} |
| timeout | number | The amount of time your Lambda Function has to run in seconds. | 3 |
| cloudwatch_schedule_expression | string | The cron or rate expression for the CloudWatch Events rule that triggers the exe | "" |
| security_group_ids | list(string) | List of security group IDs associated with the Lambda function. | [] |
| subnet_ids | list(string) | List of subnet IDs associated with the Lambda function. | [] |
Outputs (5)
lambda_execution_role_arn — The Amazon Resource Name (ARN) identifying the IAM Role used to execute this Lambda.lambda_function_arn — The Amazon Resource Name (ARN) identifying your Lambda Function.lambda_function_name — A unique name for your Lambda Function.lambda_function_qualified_arn — The Amazon Resource Name (ARN) identifying your Lambda Function Version.lambda_invoke_arn — The ARN to be used for invoking Lambda Function from API Gateway - to be used in aws_api_gateway_intResources (8)
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,