Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Run `terraform apply` from within an AWS Lambda

License

Notifications You must be signed in to change notification settings

FitnessKeeper/terraform-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

terraform-apply-lambda

A way to run terraform apply inside an AWS Lambda function.

Motivation

We use Terraform to manage our infrastructure. Creating the plan files can be done anywhere -- we use Circle CI -- but actually applying the plan file requires powerful administrative permissions.

By running the apply step inside AWS itself, we don't have to create and manage keys for these permissions -- and so there's no risk of these keys being lost or leaked. With a Lambda function, we just use IAM roles, and never have to do explicit key management.

Installation

  1. In the Lambda section of your AWS Console, create a new, blank Lambda function.
  2. Add an S3 PUT trigger to your Lambda that fires whenever you upload a new Terraform plan file.
  3. Select the "Python 2.7" runtime, then copy and paste the code in service.py into the code editor.

License

MIT license.

About

Run `terraform apply` from within an AWS Lambda

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages