Skip to content

Instantly share code, notes, and snippets.

@albertogeniola
Created October 29, 2023 10:46
Show Gist options
  • Select an option

  • Save albertogeniola/f66396fb351cc9d07da30128765d19cc to your computer and use it in GitHub Desktop.

Select an option

Save albertogeniola/f66396fb351cc9d07da30128765d19cc to your computer and use it in GitHub Desktop.
locals {
# Let's calculate the hash of all the contents of the packer directory.
# We'll use this hash to determine if anything changed in the packer directory.
packer_contents_hash = md5(join(",", [for f in fileset("${path.module}/packer", "**") : filemd5("${path.module}/packer/${f}") if f != ".manifest.json"]))
image_source_build_params = var.source_image != null ? "-var source_image=${var.source_image}}" : "-var source_image_family=${var.source_image_family}"
image_target_build_params = "-var image_name=${var.target_image_name} -var target_image_family=${var.target_image_family}"
builder_network_project_id = var.builder_network_project_id == null ? var.builder_project_id : var.builder_network_project_id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment