From 0858d1ddaa9df19d8fdfffe790489a69881390c6 Mon Sep 17 00:00:00 2001 From: Jan David Date: Tue, 6 Feb 2024 14:32:01 +0100 Subject: [PATCH] Ensure package hash is stable Fastly added metadata collection[^1] to the CLI in version 10.6.0. The metadata includes the heap size during the build, which is not stable over time. Because of that, Terraform always detected a change to the compute package, even though no code had changed. Disabling the metadata collection ensures that the package hash is stable between builds, thus reducing the noise in Terraform. [^1]: https://developer.fastly.com/learning/tools/cli/#metadata-collection --- .../crates-io/compute-static/bin/terraform-external-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terragrunt/modules/crates-io/compute-static/bin/terraform-external-build.sh b/terragrunt/modules/crates-io/compute-static/bin/terraform-external-build.sh index 1c5e2fd18..e2d7c668e 100755 --- a/terragrunt/modules/crates-io/compute-static/bin/terraform-external-build.sh +++ b/terragrunt/modules/crates-io/compute-static/bin/terraform-external-build.sh @@ -19,7 +19,7 @@ script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd) project_path=$(cd "${script_path}" && cd ".." && pwd) project_name="${project_path##*/}" -cd "${project_path}" && fastly compute build &>/dev/null +cd "${project_path}" && fastly compute build --metadata-disable &>/dev/null # Return a valid JSON object that Terraform can consume echo "{\"path\": \"./${project_name}/pkg/compute-static.tar.gz\"}"