New Resource - gitlab_service_account
gitlab_service_account
New Resource - As introduced in 16.1 you can now create a service account user. In the API documentation there are currently 3 endpoints:
POST /groups/:id/service_accounts
POST /groups/:id/service_accounts/:user_id/personal_access_tokens
POST /groups/:id/service_accounts/:user_id/personal_access_tokens/:token_id/rotate
For these endpoints it would be nice to have resources that would look a little something like this:
resource "gitlab_group" "foo" {
name = "foo-group"
path = "foo-path"
}
resource "gitlab_service_account" "foo" {
group = gitlab_group.foo.id
}
resource "gitlab_service_account_personal_access_token" "foo" {
group = gitlab_group.foo.id
user = gitlab_service_account.foo.id
}
resource "gitlab_service_account_personal_access_token_rotate" "foo" {
group = gitlab_group.foo.id
user = gitlab_service_account.foo.id
token = gitlab_service_account_personal_access_token.foo.id
}
Related GitLab APIs
API documentation:
Additional Details
-
GitLab REST API resources available (read for data sources, crud for resources) -
go-gitlab
does support the related GitLab API already -
I'd like to contribute it myself
Edited by Pascal Roose