Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add custom tags option to mig-vm-module #177

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/gh-runner-mig-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This example shows how to deploy a MIG Self Hosted Runner with an image pre-bake
| custom\_metadata | User provided custom metadata | `map(any)` | `{}` | no |
| 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 |
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
| instance\_tags | Additional tags to add to the instances | `list(string)` | `[]` | no |
| machine\_type | The GCP machine type to deploy | `string` | `"n1-standard-1"` | no |
| max\_replicas | Maximum number of runner instances | `number` | `10` | no |
| min\_replicas | Minimum number of runner instances | `number` | `2` | no |
Expand Down
4 changes: 1 addition & 3 deletions modules/gh-runner-mig-vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ module "mig_template" {
}, {
"shutdown-script" = local.shutdown_script
}, var.custom_metadata)
tags = [
"gh-runner-vm"
]
tags = concat(["gh-runner-vm"], var.instance_tags)
}
/*****************************************
Runner MIG
Expand Down
6 changes: 6 additions & 0 deletions modules/gh-runner-mig-vm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,9 @@ variable "cooldown_period" {
type = number
default = 60
}

variable "instance_tags" {
type = list(string)
description = "Additional tags to add to the instances"
default = []
}