Skip to content

Commit 358bfd3

Browse files
committed
(Auto-generated) Migrate documentation
- Move attribute documentation to resource schemas - Move examples to /examples
1 parent fd875ee commit 358bfd3

File tree

124 files changed

+2296
-1083
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2296
-1083
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# By group's ID
2+
data "gitlab_group" "foo" {
3+
group_id = 123
4+
}
5+
6+
# By group's full path
7+
data "gitlab_group" "foo" {
8+
full_path = "foo/bar"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# By group's ID
2+
data "gitlab_group_membership" "example" {
3+
group_id = 123
4+
}
5+
6+
# By group's full path
7+
data "gitlab_group_membership" "example" {
8+
full_path = "foo/bar"
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
data "gitlab_project" "example" {
2+
id = 30
3+
}
4+
5+
data "gitlab_project" "example" {
6+
id = "foo/bar/baz"
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "gitlab_project_protected_branch" "example" {
2+
project_id = 30
3+
name = "main"
4+
}
5+
6+
data "gitlab_project_protected_branch" "example" {
7+
project_id = "foo/bar/baz"
8+
name = "main"
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
data "gitlab_project_protected_branches" "example" {
2+
project_id = 30
3+
}
4+
5+
data "gitlab_project_protected_branches" "example" {
6+
project_id = "foo/bar/baz"
7+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# List projects within a group tree
2+
data "gitlab_group" "mygroup" {
3+
full_path = "mygroup"
4+
}
5+
6+
data "gitlab_projects" "group_projects" {
7+
group_id = data.gitlab_group.mygroup.id
8+
order_by = "name"
9+
include_subgroups = true
10+
with_shared = false
11+
}
12+
13+
# List projects using the search syntax
14+
data "gitlab_projects" "projects" {
15+
search = "postgresql"
16+
visibility = "private"
17+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
data "gitlab_user" "example" {
2+
username = "myuser"
3+
}
4+
5+
# Example using `for_each`
6+
data "gitlab_user" "example-two" {
7+
for_each = toset(["user1", "user2", "user3"])
8+
9+
username = each.value
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "gitlab_users" "example" {
2+
sort = "desc"
3+
order_by = "name"
4+
created_before = "2019-01-01"
5+
}
6+
7+
data "gitlab_users" "example-two" {
8+
search = "username"
9+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Gitlab protected branches can be imported with a key composed of `<project_id>:<branch>`, e.g.
2+
terraform import gitlab_branch_protection.BranchProtect "12345:main"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "gitlab_branch_protection" "BranchProtect" {
2+
project = "12345"
3+
branch = "BranchProtected"
4+
push_access_level = "developer"
5+
merge_access_level = "developer"
6+
code_owner_approval_required = true
7+
allowed_to_push {
8+
user_id = 5
9+
}
10+
allowed_to_push {
11+
user_id = 521
12+
}
13+
allowed_to_merge {
14+
user_id = 15
15+
}
16+
allowed_to_merge {
17+
user_id = 37
18+
}
19+
}
20+
21+
# Example using dynamic block
22+
resource "gitlab_branch_protection" "main" {
23+
project = "12345"
24+
branch = "main"
25+
push_access_level = "maintainer"
26+
merge_access_level = "maintainer"
27+
28+
dynamic "allowed_to_push" {
29+
for_each = [50, 55, 60]
30+
content {
31+
user_id = allowed_to_push.value
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)