Skip to content

Commit 6ff98a7

Browse files
Update docs for v17.2.0 release
1 parent c56575b commit 6ff98a7

File tree

5 files changed

+130
-12
lines changed

5 files changed

+130
-12
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11

2+
## 17.2.0 (2024-07-18)
3+
4+
This release was tested against GitLab 17.2, 17.1, and 17.0 for both CE and EE
5+
6+
### BREAKING CHANGES (1 change)
7+
Note: As a security related change, this breaking change is allowed outside a major release. If a non-sensitive token is required for migration purposes users can use the `nonsensitive()` TF function.
8+
9+
- resource/gitlab_cluster_agent_token: [Mark GitLab cluster agent token as sensitive](gitlab-org/terraform-provider-gitlab@1eec1065723f6393a3e5deb45356a47ec27b575e) by @CarbonCollins ([merge request](gitlab-org/terraform-provider-gitlab!2032))
10+
11+
### IMPROVEMENTS (1 change)
12+
13+
- **New Resource** resource/gitlab_project_security_policy_attachment: [Add new resource for associating security policy projects to a project](gitlab-org/terraform-provider-gitlab@3fc5f6c8a9d74f8b034af84a73fb9dcb6d323179) by @PatrickRice ([merge request](gitlab-org/terraform-provider-gitlab!2009))
14+
- resource/gitlab_personal_access_token: [Migrate `gitlab_personal_access_token` from SDK to TF Plugin Framework](gitlab-org/terraform-provider-gitlab@24489118da1ce464994cdfcedecbe804edf65490) by @theipster ([merge request](gitlab-org/terraform-provider-gitlab!2005))
15+
-
16+
17+
### BUG FIXES (4 changes)
18+
19+
- resource/gitlab_deploy_key: [Fix deploy key documentation reference to point to the correct resource for enabling a pre-existing deploy key](gitlab-org/terraform-provider-gitlab@f8718e66a5608c521009d091761b5577a055e904) by @blrz ([merge request](gitlab-org/terraform-provider-gitlab!2024))
20+
- resource/gitlab_user_runner: [Fix an issue with gitlab_user_runner causing inconsistent TF plans](gitlab-org/terraform-provider-gitlab@a5448baf255134f0d0bff5fe16803ee4cf35ce61) by @PatrickRice ([merge request](gitlab-org/terraform-provider-gitlab!2020))
21+
222
## 17.1.0 (2024-06-20)
323

424
This release was tested against GitLab 17.1, 17.0, and 16.11 for both CE and EE

docs/resources/cluster_agent_token.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ resource "helm_release" "gitlab_agent" {
8484
- `id` (String) The ID of this resource.
8585
- `last_used_at` (String) The ISO8601 datetime when the token was last used.
8686
- `status` (String) The status of the token. Valid values are `active`, `revoked`.
87-
- `token` (String) The secret token for the agent. The `token` is not available in imported resources.
87+
- `token` (String, Sensitive) The secret token for the agent. The `token` is not available in imported resources.
8888
- `token_id` (Number) The ID of the token.
8989

9090
## Import

docs/resources/deploy_key.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ page_title: "gitlab_deploy_key Resource - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
66
The gitlab_deploy_key resource allows to manage the lifecycle of a deploy key.
7-
-> To enable an already existing deploy key for another project use the gitlab_project_deploy_key resource.
7+
-> To enable an already existing deploy key for another project use the gitlab_deploy_key_enable resource.
88
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/deploy_keys.html
99
---
1010

1111
# gitlab_deploy_key (Resource)
1212

1313
The `gitlab_deploy_key` resource allows to manage the lifecycle of a deploy key.
1414

15-
-> To enable an already existing deploy key for another project use the `gitlab_project_deploy_key` resource.
15+
-> To enable an already existing deploy key for another project use the `gitlab_deploy_key_enable` resource.
1616

1717
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/deploy_keys.html)
1818

docs/resources/personal_access_token.md

+18-9
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@
33
page_title: "gitlab_personal_access_token Resource - terraform-provider-gitlab"
44
subcategory: ""
55
description: |-
6-
The gitlab_personal_access_token resource allows to manage the lifecycle of a personal access token for a specified user.
6+
The gitlab_personal_access_token resource allows to manage the lifecycle of a personal access token.
77
-> This resource requires administration privileges.
8-
Upstream API: GitLab REST API docs https://docs.gitlab.com/ee/api/personal_access_tokens.html
8+
~> Use of the timestamp() function with expires_at will cause the resource to be re-created with every apply, it's recommended to use plantimestamp() or a static value instead.
9+
~> Observability scopes are in beta and may not work on all instances. See more details in the documentation https://docs.gitlab.com/ee/operations/tracing.html
10+
~> Due to Automatic reuse detection https://docs.gitlab.com/ee/api/personal_access_tokens.html#automatic-reuse-detection it's possible that a new Personal Access Token will immediately be revoked. Check if an old process using the old token is running if this happens.
11+
Upstream API: GitLab API docs https://docs.gitlab.com/ee/api/personal_access_tokens.html
912
---
1013

1114
# gitlab_personal_access_token (Resource)
1215

13-
The `gitlab_personal_access_token` resource allows to manage the lifecycle of a personal access token for a specified user.
16+
The `gitlab_personal_access_token` resource allows to manage the lifecycle of a personal access token.
1417

1518
-> This resource requires administration privileges.
1619

17-
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/personal_access_tokens.html)
20+
~> Use of the `timestamp()` function with expires_at will cause the resource to be re-created with every apply, it's recommended to use `plantimestamp()` or a static value instead.
21+
22+
~> Observability scopes are in beta and may not work on all instances. See more details in [the documentation](https://docs.gitlab.com/ee/operations/tracing.html)
23+
24+
~> Due to [Automatic reuse detection](https://docs.gitlab.com/ee/api/personal_access_tokens.html#automatic-reuse-detection) it's possible that a new Personal Access Token will immediately be revoked. Check if an old process using the old token is running if this happens.
25+
26+
**Upstream API**: [GitLab API docs](https://docs.gitlab.com/ee/api/personal_access_tokens.html)
1827

1928
## Example Usage
2029

@@ -40,20 +49,20 @@ resource "gitlab_project_variable" "example" {
4049
### Required
4150

4251
- `name` (String) The name of the personal access token.
43-
- `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`, `manage_runner`.
44-
- `user_id` (Number) The id of the user.
52+
- `scopes` (Set of String) The scopes of the personal access token. valid values are: `api`, `read_user`, `read_api`, `read_repository`, `write_repository`, `read_registry`, `write_registry`, `sudo`, `admin_mode`, `create_runner`, `manage_runner`, `ai_features`, `k8s_proxy`, `read_service_ping`
53+
- `user_id` (Number) The ID of the user.
4554

4655
### Optional
4756

48-
- `expires_at` (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD.
57+
- `expires_at` (String) When the token will expire, YYYY-MM-DD format.
4958

5059
### Read-Only
5160

5261
- `active` (Boolean) True if the token is active.
5362
- `created_at` (String) Time the token has been created, RFC3339 format.
54-
- `id` (String) The ID of this resource.
63+
- `id` (String) The ID of the personal access token.
5564
- `revoked` (Boolean) True if the token is revoked.
56-
- `token` (String, Sensitive) The personal access token. This is only populated when creating a new personal access token. This attribute is not available for imported resources.
65+
- `token` (String, Sensitive) The token of the personal access token. **Note**: the token is not available for imported resources.
5766

5867
## Import
5968

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "gitlab_project_security_policy_attachment Resource - terraform-provider-gitlab"
4+
subcategory: ""
5+
description: |-
6+
The gitlab_project_security_policy_attachment resource allows to attach a security policy project to a project.
7+
Upstream API: GitLab GraphQL API docs https://docs.gitlab.com/ee/api/graphql/reference/index.html#mutationsecuritypolicyprojectassign
8+
---
9+
10+
# gitlab_project_security_policy_attachment (Resource)
11+
12+
The `gitlab_project_security_policy_attachment` resource allows to attach a security policy project to a project.
13+
14+
**Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/ee/api/graphql/reference/index.html#mutationsecuritypolicyprojectassign)
15+
16+
## Example Usage
17+
18+
```terraform
19+
# This resource can be used to attach a security policy to a pre-existing project
20+
resource "gitlab_project_security_policy_attachment" "foo" {
21+
project = 1234
22+
policy_project = 4567
23+
}
24+
25+
26+
# Or you can use Terraform to create a new project, add a policy to that project,
27+
# then attach that policy project to other projects.
28+
resource "gitlab_project" "my-policy-project" {
29+
name = "security-policy-project"
30+
}
31+
32+
resource "gitlab_repository_file" "policy-yml" {
33+
project = gitlab_project.my-policy-project.id
34+
file_path = ".gitlab/security-policies/my-policy.yml"
35+
branch = "master"
36+
encoding = "text"
37+
content = <<-EOT
38+
---
39+
approval_policy:
40+
- name: test
41+
description: test
42+
enabled: true
43+
rules:
44+
- type: any_merge_request
45+
branch_type: protected
46+
commits: any
47+
approval_settings:
48+
block_branch_modification: true
49+
prevent_pushing_and_force_pushing: true
50+
prevent_approval_by_author: true
51+
prevent_approval_by_commit_author: true
52+
remove_approvals_with_new_commit: true
53+
require_password_to_approve: false
54+
fallback_behavior:
55+
fail: closed
56+
actions:
57+
- type: send_bot_message
58+
enabled: true
59+
EOT
60+
}
61+
62+
resource "gitlab_project_security_policy" "my-policy" {
63+
project = 1234
64+
policy_project = gitlab_project.my-policy-project.id
65+
}
66+
```
67+
68+
<!-- schema generated by tfplugindocs -->
69+
## Schema
70+
71+
### Required
72+
73+
- `policy_project` (String) The ID or Full Path of the security policy project.
74+
- `project` (String) The ID or Full Path of the project which will have the security policy project assigned to it.
75+
76+
### Read-Only
77+
78+
- `id` (String) The ID of this Terraform resource. In the format of `<project>:<policy_project>`.
79+
- `policy_project_graphql_id` (String) The GraphQL ID of the security policy project.
80+
- `project_graphql_id` (String) The GraphQL ID of the project to which the security policty project will be attached.
81+
82+
## Import
83+
84+
Import is supported using the following syntax:
85+
86+
```shell
87+
# GitLab project security policy attachments can be imported using an id made up of `project:policy_project_id` where the policy project ID is the project ID of the policy project, e.g.
88+
terraform import gitlab_project_security_policy_attachment.foo 1:2
89+
```

0 commit comments

Comments
 (0)