Skip to content

Commit befdf1b

Browse files
feat: allow set disk size & type on vm runner
1 parent e0062bc commit befdf1b

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

modules/gh-runner-mig-vm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ This example shows how to deploy a MIG Self Hosted Runner with an image pre-bake
3232
| create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no |
3333
| create\_subnetwork | Whether to create subnetwork or use the one provided via subnet\_name | `bool` | `true` | no |
3434
| custom\_metadata | User provided custom metadata | `map(any)` | `{}` | no |
35+
| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no |
36+
| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no |
3537
| gh\_runner\_labels | GitHub runner labels to attach to the runners. Docs: https://docs.github.com/en/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners | `set(string)` | `[]` | no |
3638
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
3739
| instance\_tags | Additional tags to add to the instances | `list(string)` | `[]` | no |

modules/gh-runner-mig-vm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ module "mig_template" {
132132
"https://www.googleapis.com/auth/cloud-platform",
133133
]
134134
}
135-
disk_size_gb = 100
136-
disk_type = "pd-ssd"
135+
disk_size_gb = var.disk_size_gb
136+
disk_type = var.disk_type
137137
auto_delete = true
138138
name_prefix = "gh-runner"
139139
source_image_family = var.source_image_family

modules/gh-runner-mig-vm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,15 @@ variable "spot_instance_termination_action" {
165165
type = string
166166
default = "STOP"
167167
}
168+
169+
variable "disk_size_gb" {
170+
type = number
171+
description = "Instance disk size in GB"
172+
default = 100
173+
}
174+
175+
variable "disk_type" {
176+
type = string
177+
description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard"
178+
default = "pd-ssd"
179+
}

0 commit comments

Comments
 (0)