Skip to main content

Module: lambda-function

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.

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.

module "lambda" {
source = "cloudposse/lambda-function/aws"
version = "xxxx"

filename = "lambda.zip"
function_name = "my-function"
handler = "handler.handler"
runtime = "nodejs14.x"
}

Examples