Skip to content

Commit

Permalink
Introduce terraform vars 'disk_type' and 'disk_size_gb'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tereius committed Dec 23, 2024
1 parent 7479c7d commit 5001a86
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Have a look at the [variables.tf](./variables.tf) file how to further configure

#### Magic Labels

Each workflow job can select a different machine type than the configured default `machine_type`. This is done by the special label `@machine:c2d-standard-16`.
Each workflow job can select a different machine type than the configured default `machine_type`. This is done by the special label `@machine:c2d-standard-16`. Make sure that the configured `disk_type` is supported by the machine.

```
jobs:
Expand Down
4 changes: 2 additions & 2 deletions compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "google_compute_instance_template" "runner_instance" {
auto_delete = true
boot = true
source_image = var.machine_image
disk_type = "pd-standard"
disk_size_gb = 40
disk_type = var.disk_type
disk_size_gb = var.disk_size_gb
}

service_account {
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ variable "machine_type" {
default = "e2-micro"
}

variable "disk_type" {
type = string
description = "The VM instance disk type"
default = "pd-standard"
}

variable "disk_size_gb" {
type = number
description = "The VM disk size"
default = 40
}

variable "machine_image" {
type = string
description = "The VM instance boot image (gcloud compute images list --filter ubuntu-os). Only Linux is supported!"
Expand Down

0 comments on commit 5001a86

Please sign in to comment.