Skip to content

Commit 2a4a482

Browse files
committed
lambda trigger
1 parent 96c6f35 commit 2a4a482

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

terraform/redis_sync_lambda.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ resource "null_resource" "package_lambda" {
5353
}
5454
depends_on = [null_resource.chmod_package_lambda, null_resource.make_build_dir, null_resource.debug_script, null_resource.debug_dir]
5555
triggers = {
56-
build_hash = local.redis_sync_dir_sha
57-
src_hash = sha1(join("", fileset(local.redis_sync_dir, "**")))
58-
toml_hash = filesha1("${local.redis_sync_dir}/pyproject.toml")
59-
lock_hash = filesha1("${local.redis_sync_dir}/poetry.lock")
60-
bash_hash = filesha1("${local.build_script}")
56+
# Triggers when any of the Lambda source files change
57+
src_hash = sha1(join("", fileset(local.redis_sync_dir, "**")))
58+
59+
# Triggers when dependencies or build script change
60+
pyproject_hash = filesha1("${local.redis_sync_dir}/pyproject.toml")
61+
poetry_lock_hash = filesha1("${local.redis_sync_dir}/poetry.lock")
62+
build_script_hash = filesha1(local.build_script)
63+
64+
# Also trigger if the current archive_file's output hash changes
65+
archive_hash = data.archive_file.lambda_zip.output_base64sha256
6166
}
6267
}
6368

0 commit comments

Comments
 (0)