Skip to content

Commit b3b2f19

Browse files
Update docs for v16.5.0 release
1 parent c1eec41 commit b3b2f19

10 files changed

+234
-18
lines changed

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
## 16.5.0 (2023-10-22)
2+
3+
This release was tested against GitLab 16.3, 16.4, and 16.5 for both CE and EE
4+
5+
IMPROVEMENTS:
6+
7+
- **New Resource:** `gitlab_group_protected_environment` allows managing group-level protected environments ([!1707](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1707))
8+
- resource/gitlab_user_sshkey: Added support for creating an SSH key for the current user by making `user_id` optional ([!1726](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1726))
9+
- resource/gitlab_group: Added support for managing the `shared_runners_setting` attribute ([!1710](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1710))
10+
- resource/gitlab_project: Added support for creating an empty repository using the `empty_repo` attribute ([!1713](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1713))
11+
- resource/gitlab_project: Added support for the `public_jobs` attribute, deprecating the old `public_builds` attribute ([!1700](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1700))
12+
- datasource/gitlab_project: Added support for reading the `empty_repo` attribute ([!1713](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1713))
13+
- datasource/gitlab_projects: Added support for reading the `empty_repo` attribute ([!1713](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1713))
14+
- datasource/gitlab_group: Added support for reading the `shared_runner_setting` attribute ([!1717](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1717))
15+
- datasource/gitlab_groups: Added support for reading the `shared_runner_setting` attribute ([!1717](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1717))
16+
- datasource/gitlab_group_subgroups: Added support for reading the `shared_runner_setting` attribute ([!1719](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1719))
17+
18+
BUG FIXES:
19+
20+
- resource/gitlab_group: Removed "default" hints in the documentation, since defaults can be changed by admins in some cases ([!1696](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1696))
21+
- resource/gitlab_group_ldap_link: Fixed an issue where changing CN or Filter didn't force a new resource ([!1729](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1729))
22+
- resource/gitlab_project: Fixed an issue where the documentation didn't contain valid values for several fields ([!1714](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1714))
23+
- resource/gitlab_tag_protection: Fix d an issue where the resource read the wrong `create_access_level` when using `no one` ([!1694](https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/merge_requests/1694))
24+
125
## 16.4.1 (2023-09-25)
226

327
This release was tested against GitLab 16.2, 16.3, and 16.4 for both CE and EE

docs/data-sources/group.md

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ data "gitlab_group" "foo" {
5151
- `request_access_enabled` (Boolean) Boolean, is request for access enabled to the group.
5252
- `runners_token` (String, Sensitive) The group level registration token to use during runner setup.
5353
- `shared_runners_minutes_limit` (Number) Can be set by administrators only. Maximum number of monthly CI/CD minutes for this group. Can be nil (default; inherit system default), 0 (unlimited), or > 0.
54+
- `shared_runners_setting` (String) Enable or disable shared runners for a group’s subgroups and projects. Valid values are: `enabled`, `disabled_and_overridable`, `disabled_and_unoverridable`, `disabled_with_override`.
5455
- `visibility_level` (String) Visibility level of the group. Possible values are `private`, `internal`, `public`.
5556
- `web_url` (String) Web URL of the group.
5657
- `wiki_access_level` (String) The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are `disabled`, `private`, `enabled`.

docs/data-sources/group_subgroups.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Read-Only:
7474
- `request_access_enabled` (Boolean)
7575
- `require_two_factor_authentication` (Boolean)
7676
- `share_with_group_lock` (Boolean)
77+
- `shared_runners_setting` (String)
7778
- `statistics` (Map of String)
7879
- `subgroup_creation_level` (String)
7980
- `two_factor_grace_period` (Number)

docs/data-sources/groups.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Read-Only:
6464
- `prevent_forking_outside_group` (Boolean)
6565
- `request_access_enabled` (Boolean)
6666
- `runners_token` (String)
67+
- `shared_runners_setting` (String)
6768
- `visibility_level` (String)
6869
- `web_url` (String)
6970
- `wiki_access_level` (String)

docs/data-sources/project.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ data "gitlab_project" "example" {
5555
- `default_branch` (String) The default branch for the project.
5656
- `description` (String) A description of the project.
5757
- `emails_disabled` (Boolean) Disable email notifications.
58+
- `empty_repo` (Boolean) Whether the project is empty.
5859
- `environments_access_level` (String) Set the environments access level. Valid values are `disabled`, `private`, `enabled`.
5960
- `external_authorization_classification_label` (String) The classification label for the project.
6061
- `feature_flags_access_level` (String) Set the feature flags access level. Valid values are `disabled`, `private`, `enabled`.

docs/data-sources/projects.md

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Read-Only:
105105
- `default_branch` (String)
106106
- `description` (String)
107107
- `emails_disabled` (Boolean)
108+
- `empty_repo` (Boolean)
108109
- `environments_access_level` (String)
109110
- `external_authorization_classification_label` (String)
110111
- `feature_flags_access_level` (String)

docs/resources/group.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,33 @@ resource "gitlab_project" "example" {
3838

3939
### Required
4040

41-
- `name` (String) The name of this group.
41+
- `name` (String) The name of the group.
4242
- `path` (String) The path of the group.
4343

4444
### Optional
4545

46-
- `auto_devops_enabled` (Boolean) Defaults to false. Default to Auto DevOps pipeline for all projects within this group.
46+
- `auto_devops_enabled` (Boolean) Default to Auto DevOps pipeline for all projects within this group.
4747
- `avatar` (String) A local path to the avatar image to upload. **Note**: not available for imported resources.
4848
- `avatar_hash` (String) The hash of the avatar image. Use `filesha256("path/to/avatar.png")` whenever possible. **Note**: this is used to trigger an update of the avatar. If it's not given, but an avatar is given, the avatar will be updated each time.
49-
- `default_branch_protection` (Number) Defaults to 2. See https://docs.gitlab.com/ee/api/groups.html#options-for-default_branch_protection
50-
- `description` (String) The description of the group.
51-
- `emails_disabled` (Boolean) Defaults to false. Disable email notifications.
49+
- `default_branch_protection` (Number) See https://docs.gitlab.com/ee/api/groups.html#options-for-default_branch_protection. Valid values are: `0`, `1`, `2`, `3`, `4`.
50+
- `description` (String) The group's description.
51+
- `emails_disabled` (Boolean) Disable email notifications.
5252
- `extra_shared_runners_minutes_limit` (Number) Can be set by administrators only. Additional CI/CD minutes for this group.
5353
- `ip_restriction_ranges` (List of String) A list of IP addresses or subnet masks to restrict group access. Will be concatenated together into a comma separated string. Only allowed on top level groups.
54-
- `lfs_enabled` (Boolean) Defaults to true. Enable/disable Large File Storage (LFS) for the projects in this group.
54+
- `lfs_enabled` (Boolean) Enable/disable Large File Storage (LFS) for the projects in this group.
5555
- `membership_lock` (Boolean) Users cannot be added to projects in this group.
56-
- `mentions_disabled` (Boolean) Defaults to false. Disable the capability of a group from getting mentioned.
56+
- `mentions_disabled` (Boolean) Disable the capability of a group from getting mentioned.
5757
- `parent_id` (Number) Id of the parent group (creates a nested group).
5858
- `prevent_forking_outside_group` (Boolean) Defaults to false. When enabled, users can not fork projects from this group to external namespaces.
59-
- `project_creation_level` (String) Defaults to maintainer. Determine if developers can create projects in the group.
60-
- `request_access_enabled` (Boolean) Defaults to false. Allow users to request member access.
61-
- `require_two_factor_authentication` (Boolean) Defaults to false. Require all users in this group to setup Two-factor authentication.
62-
- `share_with_group_lock` (Boolean) Defaults to false. Prevent sharing a project with another group within this group.
59+
- `project_creation_level` (String) Determine if developers can create projects in the group. Valid values are: `noone`, `maintainer`, `developer`
60+
- `request_access_enabled` (Boolean) Allow users to request member access.
61+
- `require_two_factor_authentication` (Boolean) Require all users in this group to setup Two-factor authentication.
62+
- `share_with_group_lock` (Boolean) Prevent sharing a project with another group within this group.
6363
- `shared_runners_minutes_limit` (Number) Can be set by administrators only. Maximum number of monthly CI/CD minutes for this group. Can be nil (default; inherit system default), 0 (unlimited), or > 0.
64-
- `subgroup_creation_level` (String) Defaults to owner. Allowed to create subgroups.
64+
- `shared_runners_setting` (String) Enable or disable shared runners for a group’s subgroups and projects. Valid values are: `enabled`, `disabled_and_overridable`, `disabled_and_unoverridable`, `disabled_with_override`.
65+
- `subgroup_creation_level` (String) Allowed to create subgroups. Valid values are: `owner`, `maintainer`.
6566
- `two_factor_grace_period` (Number) Defaults to 48. Time before Two-factor authentication is enforced (in hours).
66-
- `visibility_level` (String) The group's visibility. Can be `private`, `internal`, or `public`.
67+
- `visibility_level` (String) The group's visibility. Can be `private`, `internal`, or `public`. Valid values are: `private`, `internal`, `public`.
6768
- `wiki_access_level` (String) The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are `disabled`, `private`, `enabled`.
6869

6970
### Read-Only
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gitlab_group_protected_environment Resource - terraform-provider-gitlab"
4+
subcategory: ""
5+
description: |-
6+
The gitlab_group_protected_environment resource allows to manage the lifecycle of a protected environment in a group.
7+
~> In order to use a userid in the deploy_access_levels configuration,
8+
you need to make sure that users have access to the group with Maintainer role or higher.
9+
In order to use a groupid in the deploy_access_levels configuration,
10+
the group_id must be a sub-group under the given group.
11+
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/group_protected_environments.html
12+
---
13+
14+
# gitlab_group_protected_environment (Resource)
15+
16+
The `gitlab_group_protected_environment` resource allows to manage the lifecycle of a protected environment in a group.
17+
18+
~> In order to use a user_id in the `deploy_access_levels` configuration,
19+
you need to make sure that users have access to the group with Maintainer role or higher.
20+
In order to use a group_id in the `deploy_access_levels` configuration,
21+
the group_id must be a sub-group under the given group.
22+
23+
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/group_protected_environments.html)
24+
25+
## Example Usage
26+
27+
```terraform
28+
# Example with deployment access level
29+
resource "gitlab_group_protected_environment" "example_with_access_level" {
30+
group = 12345
31+
required_approval_count = 1
32+
environment = "production"
33+
34+
deploy_access_levels = [
35+
{
36+
access_level = "developer"
37+
}
38+
]
39+
}
40+
41+
# Example with group-based deployment level
42+
resource "gitlab_group_protected_environment" "example_with_group" {
43+
group = 12345
44+
environment = "staging"
45+
46+
deploy_access_levels = [
47+
{
48+
group_id = 456
49+
}
50+
]
51+
}
52+
53+
# Example with user-based deployment level
54+
resource "gitlab_group_protected_environment" "example_with_user" {
55+
group = 12345
56+
environment = "other"
57+
58+
deploy_access_levels = [
59+
{
60+
user_id = 789
61+
}
62+
]
63+
}
64+
65+
# Example with multiple deployment access levels
66+
resource "gitlab_group_protected_environment" "example_with_multiple" {
67+
group = 12345
68+
required_approval_count = 2
69+
environment = "development"
70+
71+
deploy_access_levels = [
72+
{
73+
access_level = "developer"
74+
},
75+
{
76+
group_id = 456
77+
},
78+
{
79+
user_id = 789
80+
}
81+
]
82+
}
83+
84+
# Example with access-level based approval rules
85+
resource "gitlab_group_protected_environment" "example_with_multiple" {
86+
group = 12345
87+
required_approval_count = 2
88+
environment = "testing"
89+
90+
deploy_access_levels = [
91+
{
92+
access_level = "developer"
93+
}
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_group_protected_environment" "example_with_multiple" {
105+
group = 12345
106+
required_approval_count = 2
107+
environment = "production"
108+
109+
deploy_access_levels = [
110+
{
111+
access_level = "developer"
112+
}
113+
]
114+
115+
approval_rules = [
116+
{
117+
user_id = 789
118+
},
119+
{
120+
access_level = "developer"
121+
},
122+
{
123+
group_id = 456
124+
}
125+
]
126+
}
127+
```
128+
129+
<!-- schema generated by tfplugindocs -->
130+
## Schema
131+
132+
### Required
133+
134+
- `deploy_access_levels` (Attributes Set) Array of access levels allowed to deploy, with each described by a hash. (see [below for nested schema](#nestedatt--deploy_access_levels))
135+
- `environment` (String) The deployment tier of the environment. Valid values are `production`, `staging`, `testing`, `development`, `other`.
136+
- `group` (String) The ID or full path of the group which the protected environment is created against.
137+
138+
### Optional
139+
140+
- `approval_rules` (Attributes Set) Array of approval rules to deploy, with each described by a hash. (see [below for nested schema](#nestedatt--approval_rules))
141+
- `required_approval_count` (Number) The number of approvals required to deploy to this environment.
142+
143+
### Read-Only
144+
145+
- `id` (String) The ID of this Terraform resource. In the format of `<group>:<environment-name>`.
146+
147+
<a id="nestedatt--deploy_access_levels"></a>
148+
### Nested Schema for `deploy_access_levels`
149+
150+
Optional:
151+
152+
- `access_level` (String) Levels of access required to deploy to this protected environment. Valid values are `developer`, `maintainer`.
153+
- `group_id` (Number) The ID of the group allowed to deploy to this protected environment. The group must be a sub-group under the given group.
154+
- `user_id` (Number) The ID of the user allowed to deploy to this protected environment. The user must be a member of the group with Maintainer role or higher.
155+
156+
Read-Only:
157+
158+
- `access_level_description` (String) Readable description of level of access.
159+
- `id` (Number) The unique ID of the Deploy Access Level object.
160+
161+
162+
<a id="nestedatt--approval_rules"></a>
163+
### Nested Schema for `approval_rules`
164+
165+
Optional:
166+
167+
- `access_level` (String) Levels of access allowed to approve a deployment to this protected environment. Valid values are `developer`, `maintainer`.
168+
- `group_id` (Number) The ID of the group allowed to approve a deployment to this protected environment. TThe group must be a sub-group under the given group. This is mutually exclusive with user_id.
169+
- `required_approvals` (Number) The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
170+
- `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 group with Maintainer role or higher. This is mutually exclusive with group_id and required_approvals.
171+
172+
Read-Only:
173+
174+
- `access_level_description` (String) Readable description of level of access.
175+
- `id` (Number) The unique ID of the Approval Rules object.
176+
177+
## Import
178+
179+
Import is supported using the following syntax:
180+
181+
```shell
182+
# GitLab group protected environments can be imported using an id made up of `groupId:environmentName`, e.g.
183+
terraform import gitlab_group_protected_environment.bar 123:production
184+
```

docs/resources/project.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ resource "gitlab_project" "import_private" {
147147
- `avatar` (String) A local path to the avatar image to upload. **Note**: not available for imported resources.
148148
- `avatar_hash` (String) The hash of the avatar image. Use `filesha256("path/to/avatar.png")` whenever possible. **Note**: this is used to trigger an update of the avatar. If it's not given, but an avatar is given, the avatar will be updated each time.
149149
- `build_coverage_regex` (String, Deprecated) Test coverage parsing for the project. This is deprecated feature in GitLab 15.0.
150-
- `build_git_strategy` (String) The Git strategy. Defaults to fetch.
150+
- `build_git_strategy` (String) The Git strategy. Defaults to fetch. Valid values are `clone`, `fetch`.
151151
- `build_timeout` (Number) The maximum amount of time, in seconds, that a job can run.
152152
- `builds_access_level` (String) Set the builds access level. Valid values are `disabled`, `private`, `enabled`.
153153
- `ci_config_path` (String) Custom Path to CI config file.
@@ -193,11 +193,12 @@ resource "gitlab_project" "import_private" {
193193
- `only_allow_merge_if_pipeline_succeeds` (Boolean) Set to true if you want allow merges only if a pipeline succeeds.
194194
- `only_mirror_protected_branches` (Boolean) Enable only mirror protected branches for a mirrored project.
195195
- `packages_enabled` (Boolean) Enable packages repository for the project.
196-
- `pages_access_level` (String) Enable pages access control
196+
- `pages_access_level` (String) Enable pages access control. Valid values are `public`, `private`, `enabled`, `disabled`.
197197
- `path` (String) The path of the repository.
198198
- `pipelines_enabled` (Boolean, Deprecated) Enable pipelines for the project. The `pipelines_enabled` field is being sent as `jobs_enabled` in the GitLab API calls.
199199
- `printing_merge_request_link_enabled` (Boolean) Show link to create/view merge request when pushing from the command line
200-
- `public_builds` (Boolean) If true, jobs can be viewed by non-project members.
200+
- `public_builds` (Boolean, Deprecated) If true, jobs can be viewed by non-project members.
201+
- `public_jobs` (Boolean) If true, jobs can be viewed by non-project members.
201202
- `push_rules` (Block List, Max: 1) Push rules for the project. (see [below for nested schema](#nestedblock--push_rules))
202203
- `releases_access_level` (String) Set the releases access level. Valid values are `disabled`, `private`, `enabled`.
203204
- `remove_source_branch_after_merge` (Boolean) Enable `Delete source branch` option by default for all new merge requests.
@@ -224,13 +225,14 @@ This attribute is only used during resource creation, thus changes are suppresse
224225
- `topics` (Set of String) The list of topics for the project.
225226
- `use_custom_template` (Boolean) Use either custom instance or group (with group_with_project_templates_id) project template (enterprise edition).
226227
~> When using a custom template, [Group Tokens won't work](https://docs.gitlab.com/15.7/ee/user/project/settings/import_export_troubleshooting.html#import-using-the-rest-api-fails-when-using-a-group-access-token). You must use a real user's Personal Access Token.
227-
- `visibility_level` (String) Set to `public` to create a public project.
228+
- `visibility_level` (String) Set to `public` to create a public project. Valid values are `private`, `internal`, `public`.
228229
- `wiki_access_level` (String) Set the wiki access level. Valid values are `disabled`, `private`, `enabled`.
229230
- `wiki_enabled` (Boolean) Enable wiki for the project.
230231

231232
### Read-Only
232233

233234
- `avatar_url` (String) The URL of the avatar image.
235+
- `empty_repo` (Boolean) Whether the project is empty.
234236
- `http_url_to_repo` (String) URL that can be provided to `git clone` to clone the
235237
- `id` (String) The ID of this resource.
236238
- `path_with_namespace` (String) The path of the repository with namespace.

0 commit comments

Comments
 (0)