Skip to content

Terraform module for a Lambda function with a standard configuration

License

Notifications You must be signed in to change notification settings

highwingio/terraform-aws-lambda-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-lambda-function

Terraform module for a Lambda function with a standard configuration

Usage

module "my_lambda" {
  source             = "github.com/highwingio/terraform-aws-lambda-function?ref=master"
  # Other arguments here...
}

Updating the README

This repo uses terraform-docs to autogenerate its README.

To regenerate, run this command:

$ terraform-docs markdown table . > README.md

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_cloudwatch_log_group.lambda resource
aws_cloudwatch_metric_alarm.lambda_errors resource
aws_iam_role_policy_attachment.lambda_basic_execution resource
aws_iam_role_policy_attachment.lambda_insights resource
aws_iam_role_policy_attachment.lambda_networking resource
aws_iam_role_policy_attachment.lambda_xray resource
aws_lambda_function.lambda resource
aws_s3_bucket_object.lambda_deploy_object resource
aws_caller_identity.current data source
aws_ssm_parameter.deployment_bucket_id data source

Inputs

Name Description Type Default Required
deployment_bucket_id ID of S3 bucket that should store our deployment artifacts. Will use the /account/DEPLOYMENT_BUCKET_ID value from SSM unless specified otherwise. string null no
description Description of the Lambda Function string null no
environment Environment variables to be passed to the function map(string) {} no
error_rate_alarm_threshold Error rate (in percent, 1-100) at which to trigger an alarm notification number 25 no
git_sha Hash generated by git hash-object in source repo and used to determine whether a lambda needs to be updated string null no
handler Name of the handler function inside the artifact (https://docs.aws.amazon.com/lambda/latest/dg/configuration-console.html) string n/a yes
layer_arns List of ARNs for layers to use with the function list(string) [] no
log_retention_in_days Number of days to keep function logs in Cloudwatch number 365 no
memory_size Amount of memory (in MB) to allocate to the function number 128 no
name Name for the function string n/a yes
notifications_topic_arn SNS topic to send error notifications string n/a yes
path Local path to a zipped artifact containing the function code string n/a yes
reserved_concurrent_executions Reserved concurrent executions (none by default) number null no
role_name Name of the execution role for the function. It does not need to include logging/networking permissions - those policies will be added automatically. string n/a yes
runtime Language runtime for the function (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) string n/a yes
security_group_ids Security groups for the function (if run in a VPC) list(string) [] no
subnet_ids Subnets for the function (if run in a VPC) list(string) [] no
tags Tags to apply to created resources map(any) {} no
timeout Function timeout in seconds number 15 no

Outputs

Name Description
function_arn ARN of the created/updated Lambda function
function_invoke_arn ARN for invoking the created Lambda function
function_name Name of the created Lambda function
function_version Version of the created/updated Lambda function

About

Terraform module for a Lambda function with a standard configuration

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages