Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconlambda-build
file-type-iconlambda-dead-letter-queue
file-type-iconlambda-edge
file-type-iconlambda-keep-warm
file-type-iconlambda-s3-deployment-package
file-type-iconlambda-s3
file-type-iconlambda-vpc
file-type-iconjavascript
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconscheduled-lambda-job
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconowners.txt

Browse the Repo

file-type-icon.circleci
file-type-iconexamples
file-type-iconlambda-build
file-type-iconlambda-dead-letter-queue
file-type-iconlambda-edge
file-type-iconlambda-keep-warm
file-type-iconlambda-s3-deployment-package
file-type-iconlambda-s3
file-type-iconlambda-vpc
file-type-iconjavascript
file-type-iconREADME.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvars.tf
file-type-iconscheduled-lambda-job
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-icon.pre-commit-config.yaml
file-type-iconCODEOWNERS
file-type-iconLICENSE.txt
file-type-iconREADME.md
file-type-iconowners.txt
AWS Lambda

AWS Lambda

Deploy Lambda functions with Terraform. Supports uploading deployment packages, configuring environment variables, and scheduled functions.

Code Preview

Preview the Code

mobile file icon

README.md

down

Lambda VPC example

This folder shows an example of how to use the lambda module to create a Lambda function that can access a VPC.

How do you deploy this example?

To apply the Terraform templates:

  1. Install Terraform.
  2. Open vars.tf, set the environment variables specified at the top of the file, and fill in any other variables that don't have a default.
  3. Run terraform get.
  4. Run terraform plan.
  5. If the plan looks good, run terraform apply.

Known issues

Due to a bug in Terraform, if you configure a Lambda function with a security group and access to a VPC, terraform destroy will fail. The only available workaround at the moment is to go into the AWS Console, click on "Network Interfaces", and to manually detach and delete the Network Interface associated with the Lambda function. After that, terraform destroy will succeed.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?