Skip to content

Create `gitlab_runners` Data source for listing GitLab runners

New Data Source

I'm missing a data source to retrieve details about all the runners in a GitLab instance. This would be used in conjunction with the project_runner_enablement resource which currently takes in the runner id. Without this data source there is no automated way in terraform to retrieve a runner id for usage

I'm looking for something that I could use like this:

data "gitlab_runners" "specifc_runner" {
    status   = "active"
    type     = "project_type"
    tag_list = ["dev", "docker"]
}

resource "gitlab_project_runner_enablement" "foo" {
  project   = gitlab_project.project.id
  runner_id = data.gitlab_runners.specifc_runner[0].id
}

Related GitLab APIs

API documentation:

Additional Details