entrepot_service_account_token
An API token (ent_…) for a service account. Tokens cannot be changed: changing any attribute revokes the token and issues a new one.
The token value (secret) is returned by the server only when the token is created and is stored in the Terraform state — protect the state accordingly. After terraform import the secret is unknown (null); replace the token (e.g. with -replace) to obtain a new secret.
Example Usage
Section titled “Example Usage”resource "entrepot_service_account_token" "ci" { service_account = entrepot_service_account.ci.name name = "github-actions" scopes = ["read", "write"] expires_in_days = 90}
# The token value is only known when Terraform creates the token, and is# stored (sensitive) in the state.output "ci_token" { value = entrepot_service_account_token.ci.secret sensitive = true}Schema
Section titled “Schema”Required
Section titled “Required”name(String) Token name (shown in the UI and audit log). Changing it forces a new token.service_account(String) Name of the service account (without thesa:prefix), e.g.entrepot_service_account.ci.name. Changing it forces a new token.
Optional
Section titled “Optional”expires_in_days(Number) Lifetime in days; omit for a token that never expires. Only used at creation (not returned by the API, so null after import; setting it on an imported token just records the value). Changing it forces a new token. The token is not renewed automatically when it expires: replace it.scopes(Set of String) Restrict the token to these actions (read,write,delete,admin) on top of the service account’s role bindings. Omit for an unrestricted token (the attribute is then empty), unless the provider itself authenticates with a scoped token, in which case the server copies its scopes. Changing it forces a new token.
Read-Only
Section titled “Read-Only”created_at(String) Creation time (RFC 3339).expires_at(String) Expiry time (RFC 3339); null for no expiry.hint(String) Non-secret abbreviation of the token, e.g.ent_AbCd…wXyZ.id(String) Server-assigned token ID.secret(String, Sensitive) The token value, forAuthorization: Beareror as a package-client password. Only known when Terraform created the token (null after import).
Import
Section titled “Import”The terraform import command can be used, for example:
# Tokens are imported as <service_account>/<token_id>. The secret cannot be# recovered: after import it is null; replace the token to get a new one.terraform import entrepot_service_account_token.ci ci/8d0c2a54-1f7e-4b61-a0c9-5e3f6d2b7a41Resource documentation generated from the provider’s schema (docs/resources/service_account_token.md in terraform-provider-entrepot).