The gitlab_group_access_token
resource allows to manage the lifecycle of a group access token.
Upstream API: GitLab REST API
resource "gitlab_group_access_token" "example" {
group = "25"
name = "Example project access token"
expires_at = "2020-03-14"
access_level = "developer"
scopes = ["api"]
}
resource "gitlab_group_variable" "example" {
group = "25"
key = "gat"
value = gitlab_group_access_token.example.token
}
group
(String) The ID or full path of the group.name
(String) The name of the group access token.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
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
.expires_at
(String) When the token will expire, YYYY-MM-DD format.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)active
(Boolean) True if the token is active.created_at
(String) Time the token has been created, RFC3339 format.id
(String) The ID of the group access token.revoked
(Boolean) True if the token is revoked.token
(String, Sensitive) The token of the group access token. Note: the token is not available for imported resources.user_id
(Number) The user_id associated to the token.rotation_configuration
Required:
expiration_days
(Number) The duration (in days) the new token should be valid for.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.Import is supported using the following syntax:
# A GitLab Group Access Token can be imported using a key composed of `<group-id>:<token-id>`, e.g.
terraform import gitlab_group_access_token.example "12345:1"
# ATTENTION: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.