Skip to content

Commit

Permalink
gitlab-runners workers instance types as a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lmilbaum committed Sep 28, 2023
1 parent 01a69ce commit 7d03651
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ tf/apply/audit:
tf/apply/gitlab-permissions:
cd live/${ENV}/gitlab-permissions && terragrunt run-all --terragrunt-non-interactive apply -auto-approve

tf/init/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive init

tf/plan/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive plan

tf/apply/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive apply -auto-approve

tf/destroy/gitlab-runners:
cd live/${ENV}/gitlab-runners && terragrunt run-all --terragrunt-non-interactive destroy

tf/apply/oidc:
cd live/${ENV}/oidc && terragrunt run-all --terragrunt-non-interactive apply -auto-approve

Expand Down
10 changes: 5 additions & 5 deletions modules/gitlab-runners/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module "runner-instance-1" {
}

runner_worker_cache = {
bucket_prefix = "1-"
bucket_prefix = "1"
create = "true"
versioning = "true"
shared = "true"
Expand Down Expand Up @@ -132,7 +132,7 @@ module "runner-instance-1" {
}

runner_worker_docker_machine_instance = {
types = ["t3.micro"]
types = var.docker-machine-types
}

runner_networking = {
Expand Down Expand Up @@ -167,7 +167,7 @@ module "runner-instance-2" {
}

runner_worker_cache = {
bucket_prefix = "2-"
bucket_prefix = "2"
create = "true"
versioning = "true"
shared = "true"
Expand Down Expand Up @@ -229,7 +229,7 @@ module "runner-instance-2" {
}

runner_worker_docker_machine_instance = {
types = ["t3.micro"]
types = var.docker-machine-types
}

runner_networking = {
Expand All @@ -241,6 +241,6 @@ module "runner-instance-2" {
runner_role = {
role_profile_name = "runner-2"
}
iam_object_prefix = "2-"
iam_object_prefix = "2"
runner_terminate_ec2_lifecycle_hook_name = "terminate-instances-2"
}
6 changes: 6 additions & 0 deletions modules/gitlab-runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ variable "user" {
description = "User name"
type = string
}

variable "docker-machine-types" {
description = "Gitlab runner docker machine type"
type = list(string)
default = ["t3.micro"]
}

0 comments on commit 7d03651

Please sign in to comment.