Skip to content

Commit 18d0ef3

Browse files
Update docs for v16.4.0 release
1 parent 7f8cf86 commit 18d0ef3

9 files changed

+177
-9
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 16.4.0 (2023-09-22)
2+
3+
This release was tested against GitLab 16.2, 16.3, and 16.4 for both CE and EE
4+
5+
BREAKING CHANGES:
6+
7+
This breaking change was made early for security reasons. If a configuration relies on the value being non-sensitive,
8+
users can use the [`nonsensitive()`](https://developer.hashicorp.com/terraform/language/functions/nonsensitive) function
9+
in Terraform.
10+
11+
- resource/gitlab_user_runner: `token` is now marked as sensitive ([!1688](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1688))
12+
13+
IMPROVEMENTS:
14+
15+
- resource/gitlab_project_mirror: Updated documentation to include a warning about `keep_divergent_refs` default value ([!1691](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1691))
16+
- resource/gitlab_project_protected_environment: Add support for `approval_rules` ([!1679](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1679))
17+
- resource/gitlab_group_access_token: Add support for the `create_runner` scope ([!1675](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1675))
18+
- resource/gitlab_personal_access_token: Add support for the `create_runner` scope ([!1675](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1675))
19+
- resource/gitlab_project_access_token: Add support for the `create_runner` scope ([!1675](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1675))
20+
21+
BUG FIXES:
22+
23+
- resource/gitlab_branch: No longer returns an error when the branch is missing during a destroy ([!1690](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1690))
24+
- datasource/gitlab_cluster_agents: Fixed an issue where `agent_id` was always `0` ([!1677](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1677))
25+
- datasource/gitlab_group_subgroups: Fixed an issue where the data source returned a maximum of 20 subgroups ([!1689](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1689))
26+
127
## 16.3.0 (2023-08-22)
228

329
This release was tested against GitLab 16.0, 16.1, and 16.2 for both CE and EE

docs/resources/group_access_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ resource "gitlab_group_variable" "example" {
4343
- `expires_at` (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD.
4444
- `group` (String) The ID or path of the group to add the group access token to.
4545
- `name` (String) The name of the group access token.
46-
- `scopes` (Set of String) The scope for the group access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_api`, `read_registry`, `write_registry`, `read_repository`, `write_repository`.
46+
- `scopes` (Set of String) The scope for the group access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_api`, `read_registry`, `write_registry`, `read_repository`, `write_repository`, `create_runner`.
4747

4848
### Optional
4949

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gitlab_integration_mattermost Resource - terraform-provider-gitlab"
4+
subcategory: ""
5+
description: |-
6+
The gitlab_integration_mattermost resource allows to manage the lifecycle of a project integration with Mattermost.
7+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/integrations.html#mattermost-notifications
8+
---
9+
10+
# gitlab_integration_mattermost (Resource)
11+
12+
The `gitlab_integration_mattermost` resource allows to manage the lifecycle of a project integration with Mattermost.
13+
14+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/integrations.html#mattermost-notifications)
15+
16+
## Example Usage
17+
18+
```terraform
19+
resource "gitlab_project" "awesome_project" {
20+
name = "awesome_project"
21+
description = "My awesome project."
22+
visibility_level = "public"
23+
}
24+
25+
resource "gitlab_integration_mattermost" "mattermost" {
26+
project = gitlab_project.awesome_project.id
27+
webhook = "https://webhook.com"
28+
username = "myuser"
29+
push_events = true
30+
push_channel = "push_chan"
31+
}
32+
```
33+
34+
<!-- schema generated by tfplugindocs -->
35+
## Schema
36+
37+
### Required
38+
39+
- `project` (String) ID of the project you want to activate integration on.
40+
- `webhook` (String) Webhook URL (Example, https://mattermost.yourdomain.com/hooks/...). This value cannot be imported.
41+
42+
### Optional
43+
44+
- `branches_to_be_notified` (String) Branches to send notifications for. Valid options are "all", "default", "protected", and "default_and_protected".
45+
- `confidential_issue_channel` (String) The name of the channel to receive confidential issue events notifications.
46+
- `confidential_issues_events` (Boolean) Enable notifications for confidential issues events.
47+
- `confidential_note_channel` (String) The name of the channel to receive confidential note events notifications.
48+
- `confidential_note_events` (Boolean) Enable notifications for confidential note events.
49+
- `issue_channel` (String) The name of the channel to receive issue events notifications.
50+
- `issues_events` (Boolean) Enable notifications for issues events.
51+
- `merge_request_channel` (String) The name of the channel to receive merge request events notifications.
52+
- `merge_requests_events` (Boolean) Enable notifications for merge requests events.
53+
- `note_channel` (String) The name of the channel to receive note events notifications.
54+
- `note_events` (Boolean) Enable notifications for note events.
55+
- `notify_only_broken_pipelines` (Boolean) Send notifications for broken pipelines.
56+
- `pipeline_channel` (String) The name of the channel to receive pipeline events notifications.
57+
- `pipeline_events` (Boolean) Enable notifications for pipeline events.
58+
- `push_channel` (String) The name of the channel to receive push events notifications.
59+
- `push_events` (Boolean) Enable notifications for push events.
60+
- `tag_push_channel` (String) The name of the channel to receive tag push events notifications.
61+
- `tag_push_events` (Boolean) Enable notifications for tag push events.
62+
- `username` (String) Username to use.
63+
- `wiki_page_channel` (String) The name of the channel to receive wiki page events notifications.
64+
- `wiki_page_events` (Boolean) Enable notifications for wiki page events.
65+
66+
### Read-Only
67+
68+
- `id` (String) The ID of this resource.
69+
70+
## Import
71+
72+
Import is supported using the following syntax:
73+
74+
```shell
75+
# You can import a gitlab_integration_mattermost.mattermost state using the project ID, e.g.
76+
terraform import gitlab_integration_mattermost.mattermost 1
77+
```

docs/resources/integration_slack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ Import is supported using the following syntax:
7474

7575
```shell
7676
# You can import a gitlab_integration_slack.slack state using the project ID, e.g.
77-
terraform import gitlab_integration_slack.slack.email 1
77+
terraform import gitlab_integration_slack.slack 1
7878
```

docs/resources/personal_access_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ resource "gitlab_project_variable" "example" {
4141

4242
- `expires_at` (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD.
4343
- `name` (String) The name of the personal access token.
44-
- `scopes` (Set of String) The scope for the personal access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_user`, `read_api`, `read_repository`, `write_repository`, `read_registry`, `write_registry`, `sudo`, `admin_mode`.
44+
- `scopes` (Set of String) The scope for the personal access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_user`, `read_api`, `read_repository`, `write_repository`, `read_registry`, `write_registry`, `sudo`, `admin_mode`, `create_runner`.
4545
- `user_id` (Number) The id of the user.
4646

4747
### Read-Only

docs/resources/project_access_token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resource "gitlab_project_variable" "example" {
4040
- `expires_at` (String) Time the token will expire it, YYYY-MM-DD format.
4141
- `name` (String) A name to describe the project access token.
4242
- `project` (String) The id of the project to add the project access token to.
43-
- `scopes` (Set of String) Valid values: `api`, `read_api`, `read_repository`, `write_repository`, `read_registry`, `write_registry`.
43+
- `scopes` (Set of String) The scope for the project access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_api`, `read_registry`, `write_registry`, `read_repository`, `write_repository`, `create_runner`.
4444

4545
### Optional
4646

docs/resources/project_mirror.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ description: |-
66
The gitlab_project_mirror resource allows to manage the lifecycle of a project mirror.
77
This is for pushing changes to a remote repository. Pull Mirroring can be configured using a combination of the
88
importurl, mirror, and mirrortriggerbuilds properties on the gitlabproject resource.
9+
-> Warning By default, the provider sets the keep_divergent_refs argument to True.
10+
If you manually set keep_divergent_refs to False, GitLab mirroring removes branches in the target that aren't in the source.
11+
This action can result in unexpected branch deletions.
912
-> Destroy Behavior GitLab 14.10 introduced an API endpoint to delete a project mirror.
1013
Therefore, for GitLab 14.10 and newer the project mirror will be destroyed when the resource is destroyed.
1114
For older versions, the mirror will be disabled and the resource will be destroyed.
@@ -19,6 +22,10 @@ The `gitlab_project_mirror` resource allows to manage the lifecycle of a project
1922
This is for *pushing* changes to a remote repository. *Pull Mirroring* can be configured using a combination of the
2023
import_url, mirror, and mirror_trigger_builds properties on the gitlab_project resource.
2124

25+
-> **Warning** By default, the provider sets the `keep_divergent_refs` argument to `True`.
26+
If you manually set `keep_divergent_refs` to `False`, GitLab mirroring removes branches in the target that aren't in the source.
27+
This action can result in unexpected branch deletions.
28+
2229
-> **Destroy Behavior** GitLab 14.10 introduced an API endpoint to delete a project mirror.
2330
Therefore, for GitLab 14.10 and newer the project mirror will be destroyed when the resource is destroyed.
2431
For older versions, the mirror will be disabled and the resource will be destroyed.

docs/resources/project_protected_environment.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "gitlab_project_environment" "this" {
3333
external_url = "www.example.com"
3434
}
3535
36-
# Example with access level
36+
# Example with deployment access level
3737
resource "gitlab_project_protected_environment" "example_with_access_level" {
3838
project = gitlab_project_environment.this.project
3939
required_approval_count = 1
@@ -44,7 +44,7 @@ resource "gitlab_project_protected_environment" "example_with_access_level" {
4444
}
4545
}
4646
47-
# Example with group
47+
# Example with group-based deployment level
4848
resource "gitlab_project_protected_environment" "example_with_group" {
4949
project = gitlab_project_environment.this.project
5050
environment = gitlab_project_environment.this.name
@@ -54,7 +54,7 @@ resource "gitlab_project_protected_environment" "example_with_group" {
5454
}
5555
}
5656
57-
# Example with user
57+
# Example with user-based deployment level
5858
resource "gitlab_project_protected_environment" "example_with_user" {
5959
project = gitlab_project_environment.this.project
6060
environment = gitlab_project_environment.this.name
@@ -64,7 +64,7 @@ resource "gitlab_project_protected_environment" "example_with_user" {
6464
}
6565
}
6666
67-
# Example with multiple access levels
67+
# Example with multiple deployment access levels
6868
resource "gitlab_project_protected_environment" "example_with_multiple" {
6969
project = gitlab_project_environment.this.project
7070
required_approval_count = 2
@@ -81,6 +81,46 @@ resource "gitlab_project_protected_environment" "example_with_multiple" {
8181
deploy_access_levels {
8282
user_id = 789
8383
}
84+
}
85+
86+
# Example with access-level based approval rules
87+
resource "gitlab_project_protected_environment" "example_with_multiple" {
88+
project = gitlab_project_environment.this.project
89+
required_approval_count = 2
90+
environment = gitlab_project_environment.this.name
91+
92+
deploy_access_levels {
93+
access_level = "developer"
94+
}
95+
96+
approval_rules = [
97+
{
98+
access_level = "developer"
99+
}
100+
]
101+
}
102+
103+
# Example with multiple approval rules, using access level, user, and group
104+
resource "gitlab_project_protected_environment" "example_with_multiple" {
105+
project = gitlab_project_environment.this.project
106+
required_approval_count = 2
107+
environment = gitlab_project_environment.this.name
108+
109+
deploy_access_levels {
110+
access_level = "developer"
111+
}
112+
113+
approval_rules = [
114+
{
115+
user_id = 789
116+
},
117+
{
118+
access_level = "developer"
119+
},
120+
{
121+
group_id = 456
122+
}
123+
]
84124
}
85125
```
86126

@@ -94,13 +134,30 @@ resource "gitlab_project_protected_environment" "example_with_multiple" {
94134

95135
### Optional
96136

137+
- `approval_rules` (Attributes List) Array of approval rules to deploy, with each described by a hash. (see [below for nested schema](#nestedatt--approval_rules))
97138
- `deploy_access_levels` (Block Set) Array of access levels allowed to deploy, with each described by a hash. (see [below for nested schema](#nestedblock--deploy_access_levels))
98139
- `required_approval_count` (Number) The number of approvals required to deploy to this environment.
99140

100141
### Read-Only
101142

102143
- `id` (String) The ID of this Terraform resource. In the format of `<project>:<environment-name>`.
103144

145+
<a id="nestedatt--approval_rules"></a>
146+
### Nested Schema for `approval_rules`
147+
148+
Optional:
149+
150+
- `access_level` (String) Levels of access allowed to approve a deployment to this protected environment. Valid values are `developer`, `maintainer`.
151+
- `group_id` (Number) The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. This is mutually exclusive with user_id.
152+
- `required_approvals` (Number) The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
153+
- `user_id` (Number) The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. This is mutually exclusive with group_id and required_approvals.
154+
155+
Read-Only:
156+
157+
- `access_level_description` (String) Readable description of level of access.
158+
- `id` (Number) The unique ID of the Approval Rules object.
159+
160+
104161
<a id="nestedblock--deploy_access_levels"></a>
105162
### Nested Schema for `deploy_access_levels`
106163

@@ -113,6 +170,7 @@ Optional:
113170
Read-Only:
114171

115172
- `access_level_description` (String) Readable description of level of access.
173+
- `id` (Number) The unique ID of the Deploy Access Level object.
116174

117175
## Import
118176

docs/resources/user_runner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ The `gitlab_user_runner` resource allows creating a GitLab runner using the new
3737
### Read-Only
3838

3939
- `id` (String) The ID of the gitlab runner.
40-
- `token` (String) The authentication token to use when setting up a new runner with this configuration. This value cannot be imported.
40+
- `token` (String, Sensitive) The authentication token to use when setting up a new runner with this configuration. This value cannot be imported.

0 commit comments

Comments
 (0)