--- page_title: "ona_service_account Resource - ona" subcategory: "Identity and Access" description: |- Ona service account for non-human API access. Issue tokens with the ona_service_account_token ephemeral resource and use them only for supported service-account-token workflows. Link a source-control personal access token to the service account with ona_git_authentication. --- # ona_service_account (Resource) Ona service account for non-human API access. Issue tokens with the `ona_service_account_token` ephemeral resource and use them only for supported service-account-token workflows. Link a source-control personal access token to the service account with `ona_git_authentication`. For product context, see [Service accounts](https://ona.com/docs/ona/organizations/service-accounts), [Manage groups](https://ona.com/docs/ona/organizations/groups), and [Organization roles](https://ona.com/docs/ona/organizations/organization-roles). ## Example Usage ```terraform resource "ona_service_account" "ci" { name = "ci-pipeline" description = "CI/CD Pipeline automation" valid_until = "2099-01-01T00:00:00Z" } ``` ## Schema ### Required - `name` (String) Service account display name shown in Ona. - `valid_until` (String) RFC3339 timestamp when this service account expires, for example `2030-01-02T03:04:05Z`. Changing this value replaces the service account. ### Optional - `description` (String) Service account description. Omit to leave the description empty. ### Read-Only - `created_at` (String) Time when the service account was created. - `creator` (Attributes) Identity that created the service account. (see [below for nested schema](#nestedatt--creator)) - `id` (String) Service account ID. ### Nested Schema for `creator` Read-Only: - `id` (String) Creator subject ID. - `principal` (String) Creator principal type. ## Import Import is supported using the following syntax: The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: ```shell #!/usr/bin/env sh terraform import ona_service_account.ci 00000000-0000-0000-0000-000000000000 ```