|
3 | 3 | page_title: "gitlab_group_access_token Resource - terraform-provider-gitlab"
|
4 | 4 | subcategory: ""
|
5 | 5 | description: |-
|
6 |
| - The gitlab_group_accesstoken resource allows to manage the lifecycle of a group access token. |
7 |
| - -> Group Access Token were introduced in GitLab 14.7 |
| 6 | + The gitlab_group_access_tokenresource allows to manage the lifecycle of a group access token. |
| 7 | + ~> 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 |
| 8 | + ~> Use rotation_configuration to automatically rotate tokens instead of using timestamp() as timestamp will cause changes with every plan. terraform apply must still be run to rotate the token. |
| 9 | + ~> Due to Automatic reuse detection https://docs.gitlab.com/ee/api/group_access_tokens.html#automatic-reuse-detection it's possible that a new Group Access Token will immediately be revoked. Check if an old process using the old token is running if this happens. |
8 | 10 | Upstream API: GitLab REST API https://docs.gitlab.com/ee/api/group_access_tokens.html
|
9 | 11 | ---
|
10 | 12 |
|
11 | 13 | # gitlab_group_access_token (Resource)
|
12 | 14 |
|
13 |
| -The `gitlab_group_access`token resource allows to manage the lifecycle of a group access token. |
| 15 | +The `gitlab_group_access_token`resource allows to manage the lifecycle of a group access token. |
14 | 16 |
|
15 |
| --> Group Access Token were introduced in GitLab 14.7 |
| 17 | +~> 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) |
| 18 | + |
| 19 | +~> Use `rotation_configuration` to automatically rotate tokens instead of using `timestamp()` as timestamp will cause changes with every plan. `terraform apply` must still be run to rotate the token. |
| 20 | + |
| 21 | +~> Due to [Automatic reuse detection](https://docs.gitlab.com/ee/api/group_access_tokens.html#automatic-reuse-detection) it's possible that a new Group Access Token will immediately be revoked. Check if an old process using the old token is running if this happens. |
16 | 22 |
|
17 | 23 | **Upstream API**: [GitLab REST API](https://docs.gitlab.com/ee/api/group_access_tokens.html)
|
18 | 24 |
|
@@ -40,23 +46,32 @@ resource "gitlab_group_variable" "example" {
|
40 | 46 |
|
41 | 47 | ### Required
|
42 | 48 |
|
43 |
| -- `expires_at` (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. |
44 |
| -- `group` (String) The ID or path of the group to add the group access token to. |
| 49 | +- `group` (String) The ID or full path of the group. |
45 | 50 | - `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`, `create_runner`. |
| 51 | +- `scopes` (Set of String) The scopes of the group access token. Valid values are: `api`, `read_api`, `read_user`, `k8s_proxy`, `read_registry`, `write_registry`, `read_repository`, `write_repository`, `create_runner`, `ai_features`, `k8s_proxy`, `read_observability`, `write_observability` |
47 | 52 |
|
48 | 53 | ### Optional
|
49 | 54 |
|
50 |
| -- `access_level` (String) The access level for the group access token. Valid values are: `guest`, `reporter`, `developer`, `maintainer`, `owner`. |
| 55 | +- `access_level` (String) The access level for the group access token. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`, `master`. Default is `maintainer`. |
| 56 | +- `expires_at` (String) When the token will expire, YYYY-MM-DD format. |
| 57 | +- `rotation_configuration` (Attributes) The configuration for when to rotate a token automatically. Will not rotate a token until `terraform apply` is run. (see [below for nested schema](#nestedatt--rotation_configuration)) |
51 | 58 |
|
52 | 59 | ### Read-Only
|
53 | 60 |
|
54 | 61 | - `active` (Boolean) True if the token is active.
|
55 | 62 | - `created_at` (String) Time the token has been created, RFC3339 format.
|
56 |
| -- `id` (String) The ID of this resource. |
| 63 | +- `id` (String) The ID of the group access token. |
57 | 64 | - `revoked` (Boolean) True if the token is revoked.
|
58 |
| -- `token` (String, Sensitive) The group access token. This is only populated when creating a new group access token. This attribute is not available for imported resources. |
59 |
| -- `user_id` (Number) The user id associated to the token. |
| 65 | +- `token` (String, Sensitive) The token of the group access token. **Note**: the token is not available for imported resources. |
| 66 | +- `user_id` (Number) The user_id associated to the token. |
| 67 | + |
| 68 | +<a id="nestedatt--rotation_configuration"></a> |
| 69 | +### Nested Schema for `rotation_configuration` |
| 70 | + |
| 71 | +Required: |
| 72 | + |
| 73 | +- `expiration_days` (Number) The duration (in days) the new token should be valid for. |
| 74 | +- `rotate_before_days` (Number) The duration (in days) before the expiration when the token should be rotated. As an example, if set to 7 days, the token will rotate 7 days before the expiration date, but only when `terraform apply` is run in that timeframe. |
60 | 75 |
|
61 | 76 | ## Import
|
62 | 77 |
|
|
0 commit comments