GitlabServiceAccount
The GitlabServiceAccount resource allows you to manage GitLab service accounts declaratively using Frigg. Service accounts are bot users that can be used for CI/CD automation and other programmatic access.
Schema Reference
GitlabServiceAccountResource
| Property | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | Version of Frigg to use. Should be 1. |
| kind | GitlabServiceAccount | Yes | Kind of resource you want to specify |
| metadata | object | Yes | Data used by Frigg internally |
| metadata.name | string | Yes | Name used to reference this resource from other resources |
| metadata.id | number | No | Numeric ID of the service account. Specify this to manage an existing service account. |
| spec | object | Yes | State you want the resource to have |
GitlabServiceAccountSpec
| Property | Type | Required | Description |
|---|---|---|---|
| displayName | string | Yes | Display name of the service account (1-255 characters) |
| username | string | No | Username for the service account. Can only contain lowercase letters, digits, underscores, and hyphens. |
As a Project Sub-Resource
Service accounts can also be defined inline on a GitlabProject resource via spec.serviceAccounts:
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the service account |
| accessLevel | no_access | minimal_access | guest | planner | reporter | developer | maintainer | owner | admin | Yes | The access level of the service account. admin is only available on self-managed instances. |
Example
Standalone Resource
version: '1'
kind: GitlabServiceAccount
metadata:
name: ci-bot
spec:
displayName: CI Bot
username: ci-botAs Project Sub-Resource
spec:
serviceAccounts:
- name: ci-bot
accessLevel: developerRelated Resources
- GitlabProject - Projects can include service accounts via
spec.serviceAccounts