From 0d05309d8e9f08f5fae81e133a8c60131ac350e2 Mon Sep 17 00:00:00 2001 From: Liora Milbaum Date: Mon, 24 Jun 2024 19:12:51 +0300 Subject: [PATCH] feat: add new authentication method for GitLab >= 16 --- main.tf | 18 ++++++++++-------- variables.tf | 9 +++++++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/main.tf b/main.tf index f5a3224..402da64 100644 --- a/main.tf +++ b/main.tf @@ -68,12 +68,13 @@ module "runner-instance" { runner_worker_docker_machine_ami_owners = var.runner_worker_docker_machine_ami_owners runner_gitlab_registration_config = { - registration_token = var.registration_token_runner - tag_list = "platform-engineering" - description = "Docker Machine" - locked_to_project = "true" - run_untagged = "false" - maximum_timeout = "3600" + type = "group" + group_id = var.gitlab_group_id + tag_list = "platform-engineering" + description = "Docker Machine" + locked_to_project = "true" + run_untagged = "false" + maximum_timeout = "3600" } runner_worker_cache = { @@ -134,8 +135,9 @@ module "runner-instance" { } runner_gitlab = { - url = var.gitlab_url - runner_version = var.runner_version + url = var.gitlab_url + runner_version = var.runner_version + access_token_secure_parameter_store_name = var.access_token_secure_parameter_store_name } runner_worker_docker_machine_instance_spot = { diff --git a/variables.tf b/variables.tf index a5f0cfb..0b55aeb 100644 --- a/variables.tf +++ b/variables.tf @@ -45,8 +45,8 @@ variable "gitlab_url" { default = "https://gitlab.com" } -variable "registration_token_runner" { - description = "Registration token for the runner." +variable "access_token_secure_parameter_store_name" { + description = "Runner Gitlab Access Token SSM Parameter Name" type = string sensitive = true } @@ -115,3 +115,8 @@ variable "runner_version" { type = string default = "17.0.0" // renovate: packageName=gitlab-org/gitlab-runner } + +variable "gitlab_group_id" { + description = "Gitlab group id" + type = string +}