Skip to content

Commit d1ca163

Browse files
authored
feat: Add support for local-ssd disks (#150)
1 parent 04ac846 commit d1ca163

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/instance_template/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ resource "google_compute_instance_template" "tpl" {
7171
boot = lookup(disk.value, "boot", null)
7272
device_name = lookup(disk.value, "device_name", null)
7373
disk_name = lookup(disk.value, "disk_name", null)
74-
disk_size_gb = lookup(disk.value, "disk_size_gb", null)
74+
disk_size_gb = lookup(disk.value, "disk_size_gb", lookup(disk.value, "disk_type", null) == "local-ssd" ? "375" : null)
7575
disk_type = lookup(disk.value, "disk_type", null)
76-
interface = lookup(disk.value, "interface", null)
76+
interface = lookup(disk.value, "interface", lookup(disk.value, "disk_type", null) == "local-ssd" ? "NVME" : null)
7777
mode = lookup(disk.value, "mode", null)
7878
source = lookup(disk.value, "source", null)
7979
source_image = lookup(disk.value, "source_image", null)
80-
type = lookup(disk.value, "type", null)
80+
type = lookup(disk.value, "disk_type", null) == "local-ssd" ? "SCRATCH" : "PERSISTENT"
8181

8282
dynamic "disk_encryption_key" {
8383
for_each = lookup(disk.value, "disk_encryption_key", [])

0 commit comments

Comments
 (0)