lambda-function

dod-iac/lambda-function/aws

Terraform Module HCL AWS

AWS Lambda Function

Install
module "lambda-function" {
source = "dod-iac/lambda-function/aws"
version = "1.0.6"
}
plain text: /constructs/tfmod-dod-iac-lambda-function-aws/install.txt
⭐ Source on GitHub 📦 Registry page
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)
NameTypeDescriptionDefault
execution_role_namestring required
handlerstringThe function entrypoint in your code. required
function_namestringA unique name for your Lambda Function. required
filenamestringThe path to the function's deployment package within the local filesystem. If d required
runtimestringThe identifier of the function's runtime. required
memory_sizenumberAmount of memory in MB your Lambda Function can use at runtime.128
cloudwatch_rule_descriptionstringThe description of the CloudWatch Events rule used to schedule the execution of ""
cloudwatch_target_idstringThe id of the CloudWatch Events target. Defaults to the name of the Lambda func""
environment_variablesmap(string)A map that defines environment variables for the Lambda function.{}
cloudwatch_rule_namestringThe name of the CloudWatch Events rule used to schedule the execution of the Lam""
execution_role_policy_documentstringThe contents of the IAM policy attached to the IAM Execution role used by the La""
function_descriptionstringDescription of what your Lambda Function does.""
kms_key_arnstringThe ARN of the KMS key used to encrypt environment variables.""
event_sourceslist(object({ event_sourceA list of event sources[]
execution_role_policy_namestringThe name of the IAM policy attached to the IAM Execution role used by the Lambda""
layerslist(string)List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Functi[]
tagsmap(string)A mapping of tags to assign to the Lambda Function.{ "Automation": "Terraform" }
timeoutnumberThe amount of time your Lambda Function has to run in seconds.3
cloudwatch_schedule_expressionstringThe cron or rate expression for the CloudWatch Events rule that triggers the exe""
security_group_idslist(string)List of security group IDs associated with the Lambda function.[]
subnet_idslist(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_int
Resources (8)
aws_cloudwatch_event_ruleaws_cloudwatch_event_targetaws_iam_policyaws_iam_roleaws_iam_role_policy_attachmentaws_lambda_event_source_mappingaws_lambda_functionaws_lambda_permission
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.6
Cloud AWS
★ Stars1
Forks4
Total downloads6.9k
Inputs21
Outputs5
Resources8
Examples1
LicenseNOASSERTION
Namespacedod-iac
Updated