|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "gitlab_group_access_token Resource - terraform-provider-gitlab" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + This resource allows you to create and manage Group Access Token for your GitLab Groups. (Introduced in GitLab 14.7) |
| 7 | +--- |
| 8 | + |
| 9 | +# gitlab_group_access_token (Resource) |
| 10 | + |
| 11 | +This resource allows you to create and manage Group Access Token for your GitLab Groups. (Introduced in GitLab 14.7) |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +resource "gitlab_group_access_token" "example" { |
| 17 | + group = "25" |
| 18 | + name = "Example project access token" |
| 19 | + expires_at = "2020-03-14" |
| 20 | + access_level = "developer" |
| 21 | +
|
| 22 | + scopes = ["api"] |
| 23 | +} |
| 24 | +
|
| 25 | +resource "gitlab_group_variable" "example" { |
| 26 | + group = "25" |
| 27 | + key = "gat" |
| 28 | + value = gitlab_group_access_token.example.token |
| 29 | +} |
| 30 | +``` |
| 31 | + |
| 32 | +<!-- schema generated by tfplugindocs --> |
| 33 | +## Schema |
| 34 | + |
| 35 | +### Required |
| 36 | + |
| 37 | +- **group** (String) The ID or path of the group to add the group access token to. |
| 38 | +- **name** (String) The name of the group access token. |
| 39 | +- **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`. |
| 40 | + |
| 41 | +### Optional |
| 42 | + |
| 43 | +- **access_level** (String) The access level for the group access token. Valid values are: `guest`, `reporter`, `developer`, `maintainer`. |
| 44 | +- **expires_at** (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. Default is never. |
| 45 | +- **id** (String) The ID of this resource. |
| 46 | + |
| 47 | +### Read-Only |
| 48 | + |
| 49 | +- **active** (Boolean) True if the token is active. |
| 50 | +- **created_at** (String) Time the token has been created, RFC3339 format. |
| 51 | +- **revoked** (Boolean) True if the token is revoked. |
| 52 | +- **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. |
| 53 | +- **user_id** (Number) The user id associated to the token. |
| 54 | + |
| 55 | +## Import |
| 56 | + |
| 57 | +Import is supported using the following syntax: |
| 58 | + |
| 59 | +```shell |
| 60 | +# A GitLab Group Access Token can be imported using a key composed of `<group-id>:<token-id>`, e.g. |
| 61 | +terraform import gitlab_group_access_token.example "12345:1" |
| 62 | + |
| 63 | +# ATTENTION: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API. |
| 64 | +``` |
0 commit comments