1. Packages
  2. Databricks Provider
  3. API Docs
  4. getUsers
Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi
databricks logo
Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi

    Retrieves information about multiple databricks.User resources.

    This data source works with both the account-level and workspace-level provider.

    Example Usage

    Adding a subset of users to a group

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    export = async () => {
        const companyUsers = await databricks.getUsers({
            filter: "userName co \"@domain.org\"",
        });
        const dataUsersGroup = new databricks.Group("data_users_group", {displayName: "Data Users"});
        const addUsersToGroup: databricks.GroupMember[] = [];
        for (const range of Object.entries(.reduce((__obj, user) => ({ ...__obj, [user.id]: user }))).map(([k, v]) => ({key: k, value: v}))) {
            addUsersToGroup.push(new databricks.GroupMember(`add_users_to_group-${range.key}`, {
                groupId: dataUsersGroup.id,
                memberId: range.value.id,
            }));
        }
    }
    
    import pulumi
    import pulumi_databricks as databricks
    
    company_users = databricks.get_users(filter="userName co \"@domain.org\"")
    data_users_group = databricks.Group("data_users_group", display_name="Data Users")
    add_users_to_group = []
    for range in [{"key": k, "value": v} for [k, v] in enumerate({user.id: user for user in company_users.users})]:
        add_users_to_group.append(databricks.GroupMember(f"add_users_to_group-{range['key']}",
            group_id=data_users_group.id,
            member_id=%!v(PANIC=Format method: runtime error: index out of range [-1])))
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(async() => 
    {
        var companyUsers = await Databricks.GetUsers.InvokeAsync(new()
        {
            Filter = "userName co \"@domain.org\"",
        });
    
        var dataUsersGroup = new Databricks.Group("data_users_group", new()
        {
            DisplayName = "Data Users",
        });
    
        var addUsersToGroup = new List<Databricks.GroupMember>();
        foreach (var range in .Select(pair => new { pair.Key, pair.Value }))
        {
            addUsersToGroup.Add(new Databricks.GroupMember($"add_users_to_group-{range.Key}", new()
            {
                GroupId = dataUsersGroup.Id,
                MemberId = range.Value.Id,
            }));
        }
    });
    
    Example coming soon!
    
    resources:
      dataUsersGroup:
        type: databricks:Group
        name: data_users_group
        properties:
          displayName: Data Users
      addUsersToGroup:
        type: databricks:GroupMember
        name: add_users_to_group
        properties:
          groupId: ${dataUsersGroup.id}
          memberId: ${range.value.id}
        options: {}
    variables:
      companyUsers:
        fn::invoke:
          function: databricks:getUsers
          arguments:
            filter: userName co "@domain.org"
    

    The following resources are used in the same context:

    • databricks_user: Resource to manage individual users in Databricks.
    • databricks_group: Resource to manage groups in Databricks.
    • databricks_group_member: Resource to manage group memberships by adding users to groups.
    • databricks_permissions: Resource to manage access control in the Databricks workspace.
    • databricks_current_user: Data source to retrieve information about the user or service principal that is calling the Databricks REST API.

    Using getUsers

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
    function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOptions): Output<GetUsersResult>
    def get_users(extra_attributes: Optional[str] = None,
                  filter: Optional[str] = None,
                  users: Optional[Sequence[GetUsersUser]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetUsersResult
    def get_users_output(extra_attributes: Optional[pulumi.Input[str]] = None,
                  filter: Optional[pulumi.Input[str]] = None,
                  users: Optional[pulumi.Input[Sequence[pulumi.Input[GetUsersUserArgs]]]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetUsersResult]
    func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
    func GetUsersOutput(ctx *Context, args *GetUsersOutputArgs, opts ...InvokeOption) GetUsersResultOutput

    > Note: This function is named GetUsers in the Go SDK.

    public static class GetUsers 
    {
        public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
        public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
    public static Output<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
    
    fn::invoke:
      function: databricks:index/getUsers:getUsers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ExtraAttributes string
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    Filter string

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    Users List<GetUsersUser>
    A list of users matching the specified criteria. Each user has the following attributes:
    ExtraAttributes string
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    Filter string

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    Users []GetUsersUser
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes String
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    filter String

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    users List<GetUsersUser>
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes string
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    filter string

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    users GetUsersUser[]
    A list of users matching the specified criteria. Each user has the following attributes:
    extra_attributes str
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    filter str

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    users Sequence[GetUsersUser]
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes String
    A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: id, userName, displayName, and externalId. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the API reference.
    filter String

    Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (eq), contains (co), starts with (sw), and not equals (ne). Additionally, simple expressions can be formed using logical operators and and or.

    Examples:

    • User whose displayName equals "john":
    users List<Property Map>
    A list of users matching the specified criteria. Each user has the following attributes:

    getUsers Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Users List<GetUsersUser>
    A list of users matching the specified criteria. Each user has the following attributes:
    ExtraAttributes string
    Filter string
    Id string
    The provider-assigned unique ID for this managed resource.
    Users []GetUsersUser
    A list of users matching the specified criteria. Each user has the following attributes:
    ExtraAttributes string
    Filter string
    id String
    The provider-assigned unique ID for this managed resource.
    users List<GetUsersUser>
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes String
    filter String
    id string
    The provider-assigned unique ID for this managed resource.
    users GetUsersUser[]
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes string
    filter string
    id str
    The provider-assigned unique ID for this managed resource.
    users Sequence[GetUsersUser]
    A list of users matching the specified criteria. Each user has the following attributes:
    extra_attributes str
    filter str
    id String
    The provider-assigned unique ID for this managed resource.
    users List<Property Map>
    A list of users matching the specified criteria. Each user has the following attributes:
    extraAttributes String
    filter String

    Supporting Types

    GetUsersUser

    Active bool
    Boolean that represents if this user is active.
    DisplayName string
    Emails List<GetUsersUserEmail>
    All the emails associated with the Databricks user.
    Entitlements List<GetUsersUserEntitlement>
    Entitlements assigned to the user.
    ExternalId string
    Groups List<GetUsersUserGroup>
    Indicates if the user is part of any groups.
    Id string
    The ID of the user.

    • userName - The username of the user.
    Name GetUsersUserName
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    Roles List<GetUsersUserRole>
    Indicates if the user has any associated roles.
    Schemas List<string>
    The schema of the user.

    • externalId - Reserved for future use.
    UserName string
    Active bool
    Boolean that represents if this user is active.
    DisplayName string
    Emails []GetUsersUserEmail
    All the emails associated with the Databricks user.
    Entitlements []GetUsersUserEntitlement
    Entitlements assigned to the user.
    ExternalId string
    Groups []GetUsersUserGroup
    Indicates if the user is part of any groups.
    Id string
    The ID of the user.

    • userName - The username of the user.
    Name GetUsersUserName
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    Roles []GetUsersUserRole
    Indicates if the user has any associated roles.
    Schemas []string
    The schema of the user.

    • externalId - Reserved for future use.
    UserName string
    active Boolean
    Boolean that represents if this user is active.
    displayName String
    emails List<GetUsersUserEmail>
    All the emails associated with the Databricks user.
    entitlements List<GetUsersUserEntitlement>
    Entitlements assigned to the user.
    externalId String
    groups List<GetUsersUserGroup>
    Indicates if the user is part of any groups.
    id String
    The ID of the user.

    • userName - The username of the user.
    name GetUsersUserName
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    roles List<GetUsersUserRole>
    Indicates if the user has any associated roles.
    schemas List<String>
    The schema of the user.

    • externalId - Reserved for future use.
    userName String
    active boolean
    Boolean that represents if this user is active.
    displayName string
    emails GetUsersUserEmail[]
    All the emails associated with the Databricks user.
    entitlements GetUsersUserEntitlement[]
    Entitlements assigned to the user.
    externalId string
    groups GetUsersUserGroup[]
    Indicates if the user is part of any groups.
    id string
    The ID of the user.

    • userName - The username of the user.
    name GetUsersUserName
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    roles GetUsersUserRole[]
    Indicates if the user has any associated roles.
    schemas string[]
    The schema of the user.

    • externalId - Reserved for future use.
    userName string
    active bool
    Boolean that represents if this user is active.
    display_name str
    emails Sequence[GetUsersUserEmail]
    All the emails associated with the Databricks user.
    entitlements Sequence[GetUsersUserEntitlement]
    Entitlements assigned to the user.
    external_id str
    groups Sequence[GetUsersUserGroup]
    Indicates if the user is part of any groups.
    id str
    The ID of the user.

    • userName - The username of the user.
    name GetUsersUserName
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    roles Sequence[GetUsersUserRole]
    Indicates if the user has any associated roles.
    schemas Sequence[str]
    The schema of the user.

    • externalId - Reserved for future use.
    user_name str
    active Boolean
    Boolean that represents if this user is active.
    displayName String
    emails List<Property Map>
    All the emails associated with the Databricks user.
    entitlements List<Property Map>
    Entitlements assigned to the user.
    externalId String
    groups List<Property Map>
    Indicates if the user is part of any groups.
    id String
    The ID of the user.

    • userName - The username of the user.
    name Property Map
    • givenName - Given name of the Databricks user.
    • familyName - Family name of the Databricks user.
    • displayName - The display name of the user.
    roles List<Property Map>
    Indicates if the user has any associated roles.
    schemas List<String>
    The schema of the user.

    • externalId - Reserved for future use.
    userName String

    GetUsersUserEmail

    Display string
    Primary bool
    Ref string
    Type string
    Value string
    Display string
    Primary bool
    Ref string
    Type string
    Value string
    display String
    primary Boolean
    ref String
    type String
    value String
    display string
    primary boolean
    ref string
    type string
    value string
    display str
    primary bool
    ref str
    type str
    value str
    display String
    primary Boolean
    ref String
    type String
    value String

    GetUsersUserEntitlement

    Display string
    Primary bool
    Ref string
    Type string
    Value string
    Display string
    Primary bool
    Ref string
    Type string
    Value string
    display String
    primary Boolean
    ref String
    type String
    value String
    display string
    primary boolean
    ref string
    type string
    value string
    display str
    primary bool
    ref str
    type str
    value str
    display String
    primary Boolean
    ref String
    type String
    value String

    GetUsersUserGroup

    Display string
    Primary bool
    Ref string
    Type string
    Value string
    Display string
    Primary bool
    Ref string
    Type string
    Value string
    display String
    primary Boolean
    ref String
    type String
    value String
    display string
    primary boolean
    ref string
    type string
    value string
    display str
    primary bool
    ref str
    type str
    value str
    display String
    primary Boolean
    ref String
    type String
    value String

    GetUsersUserName

    FamilyName string
    GivenName string
    FamilyName string
    GivenName string
    familyName String
    givenName String
    familyName string
    givenName string
    familyName String
    givenName String

    GetUsersUserRole

    Display string
    Primary bool
    Ref string
    Type string
    Value string
    Display string
    Primary bool
    Ref string
    Type string
    Value string
    display String
    primary Boolean
    ref String
    type String
    value String
    display string
    primary boolean
    ref string
    type string
    value string
    display str
    primary bool
    ref str
    type str
    value str
    display String
    primary Boolean
    ref String
    type String
    value String

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate