/terraform-aws-lambda

A Terraform module to create AWS Lambda ressources.

Primary LanguageHCLMIT LicenseMIT

Requirements

Name Version
terraform >= 0.12

Providers

Name Version
aws 4.12.1

Modules

Name Source Version
lambda app.terraform.io/bankrate/lambda-function/aws ~> 4.0.0
lambda_cloudwatch_trigger app.terraform.io/bankrate/lambda-cloudwatch-trigger/aws ~> 4.0.0
lambda_ddb_trigger app.terraform.io/bankrate/lambda-event-source/aws 2.3.0
lambda_s3_trigger app.terraform.io/bankrate/lambda-s3-trigger/aws ~> 1.0.0

Resources

Name Type
aws_cloudwatch_log_group.lambda resource
aws_cloudwatch_log_subscription_filter.cloudwatch_logs_to_es resource
aws_iam_policy.kms_policy resource
aws_iam_policy.ssm_policy resource
aws_iam_role.lambda resource
aws_iam_role_policy_attachment.cloudwatch_logs resource
aws_iam_role_policy_attachment.kms_policy_attachment resource
aws_iam_role_policy_attachment.ssm_policy_attachment resource
aws_lambda_permission.cloudwatch_logs resource
aws_caller_identity.current data source
aws_iam_policy_document.assume_role_policy data source
aws_iam_policy_document.kms_policy_document data source
aws_iam_policy_document.ssm_policy_document data source
aws_region.current data source

Inputs

Name Description Type Default Required
architecture Triggers are not required. Chose one trigger, if any, to use with lambda. If one is true, all others must be false.
object({
cloudwatch_trigger = bool
s3_trigger = bool
ddb_trigger = bool
})
{
"cloudwatch_trigger": false,
"ddb_trigger": false,
"s3_trigger": false
}
no
bucket_arn value string "" no
bucket_id value string "" no
create_default_sg By default creates a security group that's unique to your lambda, meaning that every lambda you create with this module will use its own set of ENIs bool false no
create_in_vpc By default this is set to true. If you don't want to create the lambda in a VPC then this should be set to false bool true no
description Description of what your Lambda Function does. string "" no
enable is a trigger enables true or false bool true no
enable_newrelic (optional) describe your variable bool false no
env_vars Environment variables in map(map(string)) map(map(string)) {} no
environment Environment for the resouces string n/a yes
event_source_arn value string "" no
filename The path to the function's deployment package within the local filesystem. Default is an empty string to satisfy the underlying interface. any "" no
handler The function entrypoint in your code. any n/a yes
kms_key_arn The Amazon Resource Name (ARN) of the KMS key to decrypt AWS Systems Manager parameters. string "" no
layers List of Lambda Layer Version ARNs (maximum of 5) to attach to your Lambda Function. See Lambda Layers list(string) [] no
log_retention_in_days Specifies the number of days you want to retain log events in the specified log group. Defaults to 14. number 14 no
logfilter_destination_arn The ARN of the destination to deliver matching log events to. Kinesis stream or Lambda function ARN. string "" no
memory_size Amount of memory in MB your Lambda Function can use at runtime. Defaults to 128. number 128 no
name A unique name for your Lambda Function. any n/a yes
owner Name of the owner or vertical this belongs to. any n/a yes
project Name of the project this falls under. any n/a yes
publish Whether to publish creation/change as new Lambda Function Version. Defaults to true. bool true no
reserved_concurrent_executions The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1. string "-1" no
resource_allocation Name of the project this falls under. string "low" no
runtime The runtime environment for the Lambda function you are uploading. Defaults to go1.x string "go1.x" no
schedule_expression value string "rate(1 minute)" no
security_groups security groups list(string) [] no
service Name of the service this is used in. any n/a yes
ssm_parameter_names List of AWS Systems Manager Parameter Store parameters this Lambda will have access to. In order to decrypt secure parameters, a kms_key_arn needs to be provided as well. list [] no
table_name value string "" no
tags A mapping of tags to assign to the Lambda function. map(string) {} no
team_name Name of the team this belongs to. any n/a yes
timeout The amount of time your Lambda Function has to run in seconds. Defaults to 3. number 3 no
vpc_tag_key_override override of vpc tag string "PrimaryVPC" no

Outputs

Name Description
arn The Amazon Resource Name (ARN) identifying your Lambda Function.