Skip to content

Instantly share code, notes, and snippets.

@alfredlucero
Created August 14, 2020 22:01
Show Gist options
  • Save alfredlucero/22a6e2e694a4b62df2368f2bc53c9ff7 to your computer and use it in GitHub Desktop.
Save alfredlucero/22a6e2e694a4b62df2368f2bc53c9ff7 to your computer and use it in GitHub Desktop.
Security Headers Terraform - Lambda Zip Module
# In each of our development and production folders we have a main.tf, backend.tf,
# and lambas folder holding the environment's lambdas
# We intend on zipping up the files within the lambdas folder for us to eventually upload for our lambda function resource
# We pass in variables such as source_dir_path and zip_filename for flexibility when instantiating this module for different environments
data "archive_file" "lambda_zip" {
type = "zip"
source_dir = "./lambdas/${var.source_dir_path}"
output_path = "./lambdas/${var.zip_filename}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment