--- page_title: "ona_user Data Source - ona" subcategory: "Identity and Access" description: |- Fetches one Ona user by UUID or by an exact email and login-provider pair from the organization associated with the configured token. The user must be visible to that token; suspended or departed users can require organization-admin access. --- # ona_user (Data Source) Fetches one Ona user by UUID or by an exact email and login-provider pair from the organization associated with the configured token. The user must be visible to that token; suspended or departed users can require organization-admin access. For product context, see [Organization roles](https://ona.com/docs/ona/organizations/organization-roles). ## Example Usage ```terraform locals { runner_admins = { alice = { email = "alice@example.com", login_provider = "github" } bob = { email = "bob@example.com", login_provider = "google" } carol = { email = "carol@example.com", login_provider = "custom" } } } data "ona_user" "runner_admins" { for_each = local.runner_admins email = each.value.email login_provider = each.value.login_provider } output "runner_admin_user_ids" { value = { for name, user in data.ona_user.runner_admins : name => user.user_id } } ``` ## Schema ### Optional - `email` (String) Exact user email to look up, matched case-insensitively. Must be paired with `login_provider` when `user_id` is omitted. - `login_provider` (String) Exact login provider to pair with `email`. Supported values are `github`, `google`, and `custom` (SSO). - `user_id` (String) Stable UUID of the existing Ona user. Specify this alone, or omit it and specify both `email` and `login_provider`. ### Read-Only - `id` (String) Terraform data source ID. This is the same value as `user_id`. - `member_since` (String) Time the backend user record was created, formatted as RFC 3339. This may not be the most recent rejoin time. - `name` (String) User display name. - `role` (String) Organization role: `admin` or `member`. - `status` (String) User status: `active`, `suspended`, or `left`.