diff --git a/image_basic/main.tf b/image_basic/main.tf index 176c6889..ad7288ca 100644 --- a/image_basic/main.tf +++ b/image_basic/main.tf @@ -1,7 +1,18 @@ +data "google_compute_image" "debian" { + family = "debian-12" + project = "debian-cloud" +} + +resource "google_compute_disk" "persistent" { + name = "example-disk-${local.name_suffix}" + image = data.google_compute_image.debian.self_link + size = 10 + type = "pd-ssd" + zone = "us-central1-a" +} + resource "google_compute_image" "example" { name = "example-image-${local.name_suffix}" - raw_disk { - source = "https://storage.googleapis.com/bosh-gce-raw-stemcells/bosh-stemcell-97.98-google-kvm-ubuntu-xenial-go_agent-raw-1557960142.tar.gz" - } + source_disk = google_compute_disk.persistent.id } diff --git a/image_basic_storage_location/main.tf b/image_basic_storage_location/main.tf index 3923d1b6..d1350ffe 100644 --- a/image_basic_storage_location/main.tf +++ b/image_basic_storage_location/main.tf @@ -1,8 +1,19 @@ +data "google_compute_image" "debian" { + family = "debian-12" + project = "debian-cloud" +} + +resource "google_compute_disk" "persistent" { + name = "example-disk-${local.name_suffix}" + image = data.google_compute_image.debian.self_link + size = 10 + type = "pd-ssd" + zone = "us-central1-a" +} + resource "google_compute_image" "example" { name = "example-sl-image-${local.name_suffix}" - raw_disk { - source = "https://storage.googleapis.com/bosh-gce-raw-stemcells/bosh-stemcell-97.98-google-kvm-ubuntu-xenial-go_agent-raw-1557960142.tar.gz" - } + source_disk = google_compute_disk.persistent.id storage_locations = ["us-central1"] } diff --git a/image_guest_os/main.tf b/image_guest_os/main.tf index 124ef74b..d325fd74 100644 --- a/image_guest_os/main.tf +++ b/image_guest_os/main.tf @@ -1,15 +1,38 @@ +data "google_compute_image" "debian" { + family = "debian-12" + project = "debian-cloud" +} + +resource "google_compute_disk" "persistent" { + name = "example-disk-${local.name_suffix}" + image = data.google_compute_image.debian.self_link + size = 10 + type = "pd-ssd" + zone = "us-central1-a" +} + resource "google_compute_image" "example" { name = "example-image-${local.name_suffix}" - raw_disk { - source = "https://storage.googleapis.com/bosh-gce-raw-stemcells/bosh-stemcell-97.98-google-kvm-ubuntu-xenial-go_agent-raw-1557960142.tar.gz" + source_disk = google_compute_disk.persistent.id + + guest_os_features { + type = "UEFI_COMPATIBLE" + } + + guest_os_features { + type = "VIRTIO_SCSI_MULTIQUEUE" + } + + guest_os_features { + type = "GVNIC" } guest_os_features { - type = "SECURE_BOOT" + type = "SEV_CAPABLE" } guest_os_features { - type = "MULTI_IP_SUBNET" + type = "SEV_LIVE_MIGRATABLE_V2" } }