You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# generated by https://github.com/hashicorp/terraform-plugin-docs
3
+
page_title: "gitlab_group_variable Data Source - terraform-provider-gitlab"
4
+
subcategory: ""
5
+
description: |-
6
+
The gitlab_group_variable data source allows to retrieve details about a group-level CI/CD variable.
7
+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/group_level_variables.html
8
+
---
9
+
10
+
# gitlab_group_variable (Data Source)
11
+
12
+
The `gitlab_group_variable` data source allows to retrieve details about a group-level CI/CD variable.
13
+
14
+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_level_variables.html)
15
+
16
+
17
+
18
+
<!-- schema generated by tfplugindocs -->
19
+
## Schema
20
+
21
+
### Required
22
+
23
+
-`group` (String) The name or id of the group.
24
+
-`key` (String) The name of the variable.
25
+
26
+
### Optional
27
+
28
+
-`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.
29
+
-`id` (String) The ID of this resource.
30
+
31
+
### Read-Only
32
+
33
+
-`masked` (Boolean) If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.
34
+
-`protected` (Boolean) If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
35
+
-`value` (String) The value of the variable.
36
+
-`variable_type` (String) The type of a variable. Valid values are: `env_var`, `file`. Default is `env_var`.
-`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. See https://docs.gitlab.com/ee/ci/variables/#add-a-cicd-variable-to-a-group
40
+
-`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.
41
41
-`id` (String) The ID of this resource.
42
42
-`masked` (Boolean) If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.
43
43
-`protected` (Boolean) If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
44
-
-`variable_type` (String) The type of a variable. Available types are: env_var (default) and file.
44
+
-`variable_type` (String) The type of a variable. Valid values are: `env_var`, `file`. Default is `env_var`.
Description: "The type of a variable. Available types are: env_var (default) and file.",
50
-
Type: schema.TypeString,
51
-
Optional: true,
52
-
Default: "env_var",
53
-
ValidateFunc: StringIsGitlabVariableType,
54
-
},
55
-
"protected": {
56
-
Description: "If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.",
57
-
Type: schema.TypeBool,
58
-
Optional: true,
59
-
Default: false,
60
-
},
61
-
"masked": {
62
-
Description: "If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.",
63
-
Type: schema.TypeBool,
64
-
Optional: true,
65
-
Default: false,
66
-
},
67
-
"environment_scope": {
68
-
Description: "The environment scope of the variable. Defaults to all environment (`*`). Note that in Community Editions of Gitlab, values other than `*` will cause inconsistent plans. See https://docs.gitlab.com/ee/ci/variables/#add-a-cicd-variable-to-a-group",
69
-
Type: schema.TypeString,
70
-
Optional: true,
71
-
ForceNew: true,
72
-
Default: "*",
73
-
},
74
-
},
28
+
Schema: gitlabGroupVariableGetSchema(),
75
29
}
76
30
})
77
31
@@ -104,7 +58,6 @@ func resourceGitlabGroupVariableCreate(ctx context.Context, d *schema.ResourceDa
Description: "If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.",
41
+
Type: schema.TypeBool,
42
+
Optional: true,
43
+
Default: false,
44
+
},
45
+
"masked": {
46
+
Description: "If set to `true`, the value of the variable will be hidden in job logs. The value must meet the [masking requirements](https://docs.gitlab.com/ee/ci/variables/#masked-variables). Defaults to `false`.",
47
+
Type: schema.TypeBool,
48
+
Optional: true,
49
+
Default: false,
50
+
},
51
+
"environment_scope": {
52
+
Description: "The environment scope of the variable. Defaults to all environment (`*`). Note that in Community Editions of Gitlab, values other than `*` will cause inconsistent plans.",
53
+
Type: schema.TypeString,
54
+
Optional: true,
55
+
Default: "*",
56
+
// Versions of GitLab prior to 13.4 cannot update environment_scope.
0 commit comments