cattle-ops / terraform-aws-gitlab-runner

Terraform module for AWS GitLab runners on ec2 (spot) instances
https://registry.terraform.io/modules/cattle-ops/gitlab-runner/aws
MIT License
587 stars 331 forks source link

Documentation Has Non-Existant Variables Referenced #1053

Closed MrGiga closed 10 months ago

MrGiga commented 1 year ago

Describe the bug

Currently struggling to get the new authentication to work. My gitlab runner are throwing forbidden.

While looking through the documentation I found example using variables that don't actually exist.

To Reproduce

Steps to reproduce the behavior: Impacted area is the usage.md https://github.com/cattle-ops/terraform-aws-gitlab-runner/blob/644f8850c29c4c749dc511302131da83a13b1b1e/docs/usage.md

Noted below the incorrect items


Scenario: Basic usage on GitLab >= 16.0.0

Below is a basic examples of usages of the module if your GitLab instance version is >= 16.0.0.

module "runner" {
  # https://registry.terraform.io/modules/cattle-ops/gitlab-runner/aws/
  source  = "cattle-ops/gitlab-runner/aws"

  aws_region  = "eu-west-1"
  environment = "spot-runners"

  vpc_id                   = module.vpc.vpc_id
  subnet_ids_gitlab_runner = module.vpc.private_subnets
  subnet_id_runners        = element(module.vpc.private_subnets, 0)

  runners_name       = "docker-default"
  runners_gitlab_url = "https://gitlab.com"       <------ Incorrect

  runner_gitlab_access_token_secure_parameter_store_name = "gitlab_access_token_ssm__name"      <------ Incorrect

  runner_gitlab_registration_config = {
    type               = "instance" # or "group" or "project"
    # group_id           = 1234 # for "group"
    # project_id         = 5678 # for "project"
    tag_list           = "docker"
    description        = "runner default"
    locked_to_project  = "true"
    run_untagged       = "false"
    maximum_timeout    = "3600"
  }

}
coibib commented 11 months ago

Hello, indeed the documentation isn't updated with the new variable architecture. The runner_gitlab_access_token_secure_parameter_store_name variable should be in runner_gitlab.access_token_secure_parameter_store_name The runners_gitlab_url should be in runner_gitlab.url Be aware that if it is an update for a pre-existing runner, you need to remove the old token used by the runner.

kayman-mk commented 10 months ago

Thanks for pointing this out. Seems that I overlooked some docs. Being fixed.