Skip to content

Commit 3d00ba9

Browse files
authored
Merge pull request #1051 from timofurrer/docs/missing-examples
Adds missing examples in docs for the `gitlab_*_variable(s)` data sources
2 parents 5c1b525 + 0fde5b6 commit 3d00ba9

File tree

12 files changed

+110
-4
lines changed

12 files changed

+110
-4
lines changed

docs/data-sources/group_variable.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ The `gitlab_group_variable` data source allows to retrieve details about a group
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_group_variable" "foo" {
20+
group = "my/example/group"
21+
key = "foo"
22+
}
23+
24+
# Using an environment scope
25+
data "gitlab_group_variable" "bar" {
26+
group = "my/example/group"
27+
key = "bar"
28+
environment_scope = "staging/*"
29+
}
30+
```
1731

1832
<!-- schema generated by tfplugindocs -->
1933
## Schema

docs/data-sources/group_variables.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ The `gitlab_group_variables` data source allows to retrieve all group-level CI/C
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_group_variables" "vars" {
20+
group = "my/example/group"
21+
}
22+
23+
# Using an environment scope
24+
data "gitlab_group_variables" "staging_vars" {
25+
group = "my/example/group"
26+
environment_scope = "staging/*"
27+
}
28+
```
1729

1830
<!-- schema generated by tfplugindocs -->
1931
## Schema

docs/data-sources/instance_variable.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ The `gitlab_instance_variable` data source allows to retrieve details about an i
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/instance_level_ci_variables.html)
1515

16+
## Example Usage
1617

18+
```terraform
19+
data "gitlab_instance_variable" "foo" {
20+
key = "foo"
21+
}
22+
```
1723

1824
<!-- schema generated by tfplugindocs -->
1925
## Schema

docs/data-sources/instance_variables.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ The `gitlab_instance_variables` data source allows to retrieve all instance-leve
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/instance_level_ci_variables.html)
1515

16+
## Example Usage
1617

18+
```terraform
19+
data "gitlab_instance_variables" "vars" {}
20+
```
1721

1822
<!-- schema generated by tfplugindocs -->
1923
## Schema

docs/data-sources/project_variable.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ The `gitlab_project_variable` data source allows to retrieve details about a pro
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/project_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_project_variable" "foo" {
20+
project = "my/example/project"
21+
key = "foo"
22+
}
23+
24+
# Using an environment scope
25+
data "gitlab_project_variable" "bar" {
26+
project = "my/example/project"
27+
key = "bar"
28+
environment_scope = "staging/*"
29+
}
30+
```
1731

1832
<!-- schema generated by tfplugindocs -->
1933
## Schema

docs/data-sources/project_variables.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ The `gitlab_project_variables` data source allows to retrieve all project-level
1313

1414
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/project_level_variables.html)
1515

16-
16+
## Example Usage
17+
18+
```terraform
19+
data "gitlab_project_variables" "vars" {
20+
project = "my/example/project"
21+
}
22+
23+
# Using an environment scope
24+
data "gitlab_project_variables" "staging_vars" {
25+
project = "my/example/project"
26+
environment_scope = "staging/*"
27+
}
28+
```
1729

1830
<!-- schema generated by tfplugindocs -->
1931
## Schema
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
data "gitlab_group_variable" "foo" {
2+
group = "my/example/group"
3+
key = "foo"
4+
}
5+
6+
# Using an environment scope
7+
data "gitlab_group_variable" "bar" {
8+
group = "my/example/group"
9+
key = "bar"
10+
environment_scope = "staging/*"
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "gitlab_group_variables" "vars" {
2+
group = "my/example/group"
3+
}
4+
5+
# Using an environment scope
6+
data "gitlab_group_variables" "staging_vars" {
7+
group = "my/example/group"
8+
environment_scope = "staging/*"
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "gitlab_instance_variable" "foo" {
2+
key = "foo"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data "gitlab_instance_variables" "vars" {}

0 commit comments

Comments
 (0)