Skip to content

Commit e69645f

Browse files
Update documentation
1 parent 8da110a commit e69645f

File tree

5 files changed

+120
-8
lines changed

5 files changed

+120
-8
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
## 1.0.1 (Unreleased)
2+
3+
FEATURES:
4+
5+
* **New Resource:** `gitlab_project_membership`
6+
* **New Resource:** `gitlab_group_membership` ([#8](https://github.com/terraform-providers/terraform-provider-gitlab/issues/8))
7+
* **New Resource:** `gitlab_project_variable` ([#47](https://github.com/terraform-providers/terraform-provider-gitlab/issues/47))
8+
* **New Resource:** `gitlab_group_variable` ([#47](https://github.com/terraform-providers/terraform-provider-gitlab/issues/47))
9+
10+
BACKWARDS INCOMPATIBILITIES:
11+
12+
`gitlab_project_membership` is not compatible with a previous *unrealeased* version due to an id change resource will need to be reimported manually
13+
e.g
14+
```bash
15+
terraform state rm gitlab_project_membership.foo
16+
terraform import gitlab_project_membership.foo 12345:1337
17+
```
18+
219
## 1.0.0 (October 06, 2017)
320

421
BACKWARDS INCOMPATIBILITIES:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_group_membership"
4+
sidebar_current: "docs-gitlab-resource-group_membership"
5+
description: |-
6+
Adds a user to a group as a member
7+
---
8+
9+
# gitlab\_group_membership
10+
11+
This resource allows you to add a user to an existing group.
12+
13+
## Example Usage
14+
15+
```hcl
16+
resource "gitlab_group_membership" "test" {
17+
group_id = "12345"
18+
user_id = 1337
19+
access_level = "guest"
20+
expires_at = "2020-12-31"
21+
}
22+
```
23+
24+
## Argument Reference
25+
26+
The following arguments are supported:
27+
28+
* `group_id` - (Required) The id of the group.
29+
30+
* `user_id` - (Required) The id of the user.
31+
32+
* `access_level` - (Required) Acceptable values are: guest, reporter, developer, master.
33+
34+
* `expires_at` - (Optional) Expiration date for the group membership. Format: `YYYY-MM-DD`
35+
36+
## Import
37+
38+
GitLab group membership can be imported using an id made up of `groupid:username`, e.g.
39+
40+
```
41+
$ terraform import gitlab_group_membership.test 12345:1337
42+
```
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_group_variable"
4+
sidebar_current: "docs-gitlab-resource-group-variable"
5+
description: |-
6+
Creates and manages CI/CD variables for GitLab groups
7+
---
8+
9+
# gitlab\_group\_variable
10+
11+
This resource allows you to create and manage CI/CD variables for your GitLab groups.
12+
For further information on variables, consult the [gitlab
13+
documentation](https://docs.gitlab.com/ce/ci/variables/README.html#variables).
14+
15+
16+
## Example Usage
17+
18+
```hcl
19+
resource "gitlab_group_variable" "example" {
20+
group = "12345"
21+
key = "group_variable_key"
22+
value = "group_variable_value"
23+
protected = false
24+
}
25+
```
26+
27+
## Argument Reference
28+
29+
The following arguments are supported:
30+
31+
* `group` - (Required, string) The name or id of the group to add the hook to.
32+
33+
* `key` - (Required, string) The name of the variable.
34+
35+
* `value` - (Required, string) The value of the variable.
36+
37+
* `protected` - (Optional, boolean) If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
38+
39+
## Import
40+
41+
GitLab group variables can be imported using an id made up of `groupid:variablename`, e.g.
42+
43+
```
44+
$ terraform import gitlab_group_membership.test 12345:group_variable_key
45+
```

website/docs/r/project_membership.html.markdown

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This resource allows you to add a current user to an existing project with a set
1414

1515
```hcl
1616
resource "gitlab_project_membership" "test" {
17-
project_id = "Test Project"
18-
user_id = "Test User"
17+
project_id = "12345"
18+
user_id = 1337
1919
access_level = "guest"
2020
}
2121
```
@@ -30,9 +30,9 @@ The following arguments are supported:
3030

3131
* `access_level` - (Required) One of five levels of access to the project.
3232

33-
## Attributes Reference
33+
## Import
3434

35-
The resource exports the following attributes:
36-
37-
* `id` - The unique id assigned to the membership by the GitLab server.
35+
GitLab group membership can be imported using an id made up of `groupid:username`, e.g.
3836

37+
```
38+
$ terraform import gitlab_group_membership.test 12345:1337

website/docs/r/project_variable.html.markdown

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ description: |-
1010

1111
This resource allows you to create and manage CI/CD variables for your GitLab projects.
1212
For further information on variables, consult the [gitlab
13-
documentation](https://docs.gitlab.com/ce/ci/variables/README.html).
13+
documentation](https://docs.gitlab.com/ce/ci/variables/README.html#variables).
1414

1515

1616
## Example Usage
1717

1818
```hcl
1919
resource "gitlab_project_variable" "example" {
20-
project = "example/project_with_variables"
20+
project = "12345"
2121
key = "project_variable_key"
2222
value = "project_variable_value"
2323
protected = false
@@ -35,3 +35,11 @@ The following arguments are supported:
3535
* `value` - (Required, string) The value of the variable.
3636

3737
* `protected` - (Optional, boolean) If set to `true`, the variable will be passed only to pipelines running on protected branches and tags. Defaults to `false`.
38+
39+
## Import
40+
41+
GitLab project variables can be imported using an id made up of `projectid:variablename`, e.g.
42+
43+
```
44+
$ terraform import gitlab_group_membership.test 12345:project_variable_key
45+
```

0 commit comments

Comments
 (0)