Skip to content

dhoppeIT/terraform-gitlab-project_variable

Repository files navigation

terraform-gitlab-project_variable

Terraform module to manage the following GitLab resources:

  • gitlab_project_variable

Usage

Copy and paste the following code snippet to your Terraform configuration, specify the required variables and run the command terraform init.

module "gitlab_project_access_token" {
  source  = "gitlab.com/terraform-child-modules-48151/terraform-gitlab-project-access-token/local"
  version = "1.0.0"

  project = "example-group-48165/example-project"
  name    = "example-access-token"
  scopes  = ["read_api"]
}

module "gitlab_project_variable" {
  source  = "gitlab.com/terraform-child-modules-48151/terraform-gitlab-project-variable/local"
  version = "1.1.0"

  project = "example-group-48165/example-project"
  key     = "example-key"
  value   = module.gitlab_project_access_token.token

  masked = true
}

Requirements

Name Version
terraform >= 1.0
gitlab ~> 18.0

Providers

Name Version
gitlab ~> 18.0

Modules

No modules.

Resources

Name Type
gitlab_project_variable.this resource

Inputs

Name Description Type Default Required
description The description of the variable string null no
environment_scope The environment scope of the variable string "*" no
hidden If set to true, the value of the variable will be hidden in the CI/CD User Interface bool false no
key The name of the variable string n/a yes
masked If set to true, the value of the variable will be hidden in job logs bool false no
project The name or id of the project string n/a yes
protected If set to true, the variable will be passed only to pipelines running on protected branches and tags bool false no
raw Whether the variable is treated as a raw string bool false no
value The value of the variable string n/a yes
variable_type The type of a variable string "env_var" no

Outputs

Name Description
id The ID of this resource

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.