Skip to content

Instantly share code, notes, and snippets.

@albertogeniola
Last active October 13, 2024 17:32
Show Gist options
  • Select an option

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

Select an option

Save albertogeniola/0214205c3d43cbfddc2015f9930b3a1e to your computer and use it in GitHub Desktop.
variable project_id {}
variable region {}
variable zone {}
variable network_project_id {}
variable network_name {}
variable subnet_name {}
variable image_name {}
variable target_image_family {}
variable source_image_family {default = null}
variable source_image {default = null}
source "googlecompute" "packed_image" {
source_image_family = var.source_image_family
source_image = var.source_image
image_name = "${var.image_name}-{{timestamp}}"
image_family = var.target_image_family
image_storage_locations = [var.region]
instance_name = "packer-image-builder"
project_id = var.project_id
network = var.network_name
subnetwork = var.subnet_name
zone = var.zone
network_project_id = var.network_project_id
use_internal_ip = true
omit_external_ip = true
use_iap = true
use_os_login = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment