gitlab_project_access_token (Resource)

The gitlab_project_access_token resource allows to manage the lifecycle of a project access token.

Upstream API: GitLab API docs

Example Usage

resource "gitlab_project_access_token" "example" {
  project      = "25"
  name         = "Example project access token"
  expires_at   = "2020-03-14"
  access_level = "reporter"

  scopes = ["api"]
}

resource "gitlab_project_variable" "example" {
  project = gitlab_project.example.id
  key     = "pat"
  value   = gitlab_project_access_token.example.token
}

Schema

Required

Optional

Read-Only

Nested Schema for rotation_configuration

Required:

Import

Import is supported using the following syntax:

# A GitLab Project Access Token can be imported using a key composed of `<project-id>:<token-id>`, e.g.
terraform import gitlab_project_access_token.example "12345:1"

# NOTE: the `token` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.