Skip to content

entrepot_service_account

A service account: a non-human principal for automation. It authenticates with entrepot_service_account_token tokens and is granted access with entrepot_role_binding (subject_type = "user", subject = entrepot_service_account.<x>.username). Deleting a service account revokes its tokens.

resource "entrepot_service_account" "ci" {
name = "ci"
description = "CI publisher"
}
# Use the username ("sa:ci") as a role binding subject.
output "ci_username" {
value = entrepot_service_account.ci.username
}
  • name (String) Service account name (without the sa: prefix). Changing it forces a new service account.
  • description (String) Free-form description (the account’s display name). The API cannot update service accounts, so changing it forces a new service account (and new tokens).
  • id (String) Same as name.
  • user_id (String) Server-assigned user ID.
  • username (String) Username to use as a role binding subject: sa:<name>.

The terraform import command can be used, for example:

Terminal window
# Service accounts are imported by name (with or without the "sa:" prefix).
terraform import entrepot_service_account.ci ci

Resource documentation generated from the provider’s schema (docs/resources/service_account.md in terraform-provider-entrepot).