The gitlab_group_variable
data source allows to retrieve details about a group-level CI/CD variable.
Upstream API: GitLab REST API docs
data "gitlab_group_variable" "foo" {
group = "my/example/group"
key = "foo"
}
# Using an environment scope
data "gitlab_group_variable" "bar" {
group = "my/example/group"
key = "bar"
environment_scope = "staging/*"
}
group
(String) The name or id of the group.key
(String) The name of the variable.environment_scope
(String) The environment scope of the variable. Defaults to all environment (*
). Note that in Community Editions of Gitlab, values other than *
will cause inconsistent plans.description
(String) The description of the variable.id
(String) The ID of this resource.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.value
(String) The value of the variable.variable_type
(String) The type of a variable. Valid values are: env_var
, file
. Default is env_var
.