The gitlab_instance_variable
resource allows to manage the lifecycle of an instance-level CI/CD variable.
Upstream API: GitLab REST API docs
resource "gitlab_instance_variable" "example" {
key = "instance_variable_key"
value = "instance_variable_value"
protected = false
masked = false
}
key
(String) The name of the variable.value
(String) The value of the variable.masked
(Boolean) If set to true
, the value of the variable will be hidden in job logs. The value must meet the masking requirements. Defaults to false
.protected
(Boolean) If set to true
, the variable will be passed only to pipelines running on protected branches and tags. Defaults to false
.raw
(Boolean) Whether the variable is treated as a raw string. Default: false. When true, variables in the value are not expanded.variable_type
(String) The type of a variable. Valid values are: env_var
, file
. Default is env_var
.id
(String) The ID of this resource.Import is supported using the following syntax:
# GitLab instance variables can be imported using an id made up of `variablename`, e.g.
terraform import gitlab_instance_variable.example instance_variable_key