Skip to content

Instantly share code, notes, and snippets.

@timbaileyjones
Created May 22, 2020 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timbaileyjones/9f0d0057cf254419439e3922488e6406 to your computer and use it in GitHub Desktop.
Save timbaileyjones/9f0d0057cf254419439e3922488e6406 to your computer and use it in GitHub Desktop.
# from variables.tf
locals {
...
lambda_sourcepath = "../src"
lambda_zipfilename = "../dist/cloudwatch-dashboards-updater.zip"
}
# from data.tf, actually creates the zip file.
data "archive_file" "cloudwatch_dashboard_lambda_zipfile" {
type = "zip"
source_dir = local.lambda_sourcepath
output_path = local.lambda_zipfilename
}
# from lambda_function.tf
resource "aws_lambda_function" "lambda_function" {
depends_on = [data.archive_file.cloudwatch_dashboard_lambda_zipfile]
function_name = “func_name”
filename = local.lambda_zipfilename
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment