Skip to content

Instantly share code, notes, and snippets.

@isaiahtaylor
Created July 8, 2021 18:43
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 isaiahtaylor/e1902c8dc71e3802198c7bb9bf5e9e26 to your computer and use it in GitHub Desktop.
Save isaiahtaylor/e1902c8dc71e3802198c7bb9bf5e9e26 to your computer and use it in GitHub Desktop.
Watch a directory with archive_file (don't do this)
data "archive_file" "lambda_source" {
type = "zip"
source_dir = "${path.module}/lambdas/mylambda/"
output_path = "lambda_source.zip"
}
resource "null_resource" "lambda_deploy" {
triggers = {
lambda_hash = "${data.archive_file.lambda_source.output_sha}"
}
provisioner "local-exec" {
# deploy code
# probably upload lambda code to S3
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment