Returns the profile of the currently authenticated user, including their project (org) memberships and scopes. Use this to look up the current user’s ID for resource assignments without hard-coding it in variables.
data "sg_me" "current" {}
output "user_id" {
value = data.sg_me.current.id
}
email (String) Deprecated top-level email; prefer user_identities for linked login profiles.id (String) The user’s unique identifier (UUID).name (String) The user’s display name.orgs (Attributes List) Projects (organizations) the user has access to with the assigned role and permission scopes for each. (see below for nested schema)role (String) Deprecated top-level role; prefer tenant_memberships for tenant-scoped roles.tenant_memberships (Attributes List) Tenant memberships for the authenticated user. (see below for nested schema)user_identities (Attributes List) Linked login identities (email, OAuth provider, etc.) for the authenticated user. (see below for nested schema)orgsRead-Only:
id (String) Project (org) ID.name (String) Project (org) name.role_uuid (String) Role UUID assigned to the user in this project.scopes (Set of String) Permission scopes the user has in this project.tenant_membershipsRead-Only:
joined_at (String) ISO 8601 timestamp when the user joined the tenant.role (String) Role of the user within the tenant.tenant_id (String) UUID of the tenant.tenant_name (String) Display name of the tenant.user_id (String) UUID of the user in this tenant.user_identitiesRead-Only:
avatar (String) Avatar URL from the identity provider.company (String) Company from the identity provider profile.email (String) Email address for this identity.external_user_id (String) User ID on the external identity provider.id (String) UUID of the linked identity.logged_in_using (String) OAuth or login provider used for this identity.name (String) Display name on the identity provider.primary (Boolean) Whether this is the user’s primary login identity.