Skip to content

Instantly share code, notes, and snippets.

@isaiahtaylor
Created July 8, 2021 18:31
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/8534f1970339c2a6f06d61765c69fa5e to your computer and use it in GitHub Desktop.
Save isaiahtaylor/8534f1970339c2a6f06d61765c69fa5e to your computer and use it in GitHub Desktop.
Depend on a source directory for terraform deployments
data "external" "lambda_source_trigger" {
program = ["${path.module}/gethash.sh"]
query = {
directory = "${path.module}/lambdas/mylambda"
}
}
resource "null_resource" "deploy_lambda" {
triggers = {
go_source_hash = "${data.external.lambda_source_trigger.result["checksum"]}"
}
provisioner "local-exec" {
# Your deploy code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment