Skip to content

Commit ab4dd75

Browse files
committed
zip exist
1 parent 1bfc6ae commit ab4dd75

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

terraform/redis_sync_lambda.tf

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,12 @@ 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-
always_run = timestamp()
57-
# Triggers when any of the Lambda source files change
58-
src_hash = sha1(join("", fileset(local.redis_sync_dir, "**")))
56+
zip_exists_hash = fileexists("${local.build_dir}/${local.zip_file_name}") ? filesha1("${local.build_dir}/${local.zip_file_name}") : timestamp()
5957

60-
# Triggers when dependencies or build script change
61-
pyproject_hash = filesha1("${local.redis_sync_dir}/pyproject.toml")
62-
poetry_lock_hash = filesha1("${local.redis_sync_dir}/poetry.lock")
63-
build_script_hash = filesha1(local.build_script)
64-
65-
# Also trigger if the current archive_file's output hash changes
66-
archive_hash = data.archive_file.redis_sync_lambda_zip.output_base64sha256
58+
src_hash = sha1(join("", fileset(local.redis_sync_dir, "**")))
59+
pyproject_hash = filesha1("${local.redis_sync_dir}/pyproject.toml")
60+
poetry_lock_hash = filesha1("${local.redis_sync_dir}/poetry.lock")
61+
build_script_hash = filesha1(local.build_script)
6762
}
6863
}
6964

0 commit comments

Comments
 (0)