Skip to content

rsrchboy/terraform-provider-gitlabci

Repository files navigation

terraform-provider-gitlabci

Given a registration token, register a runner with GitLab.

Synopsis

terraform {
    required_providers {
        gitlabci = {
            source = "registry.terraform.io/rsrchboy/gitlabci"
        }
    }
}

provider "gitlabci" {
    base_url = "https://gitlab.com/api/v4"
}

resource "gitlabci_runner_token" "this" {
    registration_token = "..."
    run_untagged       = true
    active             = true
    locked             = true
    tags = [
        "jinx",
        "powder",
        "cupcake",
    ]
}

Description

The GitLab provider for terraform is rather nice. However, it (currently) has a couple limitations:

  • Runners cannot be registered; and
  • API tokens are required.

This is a limited functionality provider, aimed only at making it trivial to create / destroy registered runner tokens while requiring nothing more than the relevant registration token.

This provider also provides data sources related to GitLab CI, including gitlabci_runner_config, a data source allowing runner configuration to be generated (much as, say, the AWS provider's aws_iam_policy_document does for IAM policies).

Documentation

This module is published to the public terraform registry. Please see the documentation there:

Releases and Source

The primary home for this software is on GitLab. However, AFAICT the terraform registry only supports GitHub releases we also mirror-push to a repository on GitHub. GitHub Actions are used to build releases over there, and those releases are then imported by the terraform registry. GitLab CI is used for everything else -- including building releases here, as well.

Author and Copyright

This software is Copyright 2019-2022 Chris Weyl cweyl@alumni.drew.edu.

This is free software, licensed under the GNU GPL v3+. See the LICENSE file for more information.