databricks.getUser
Explore with Pulumi AI
Note If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add depends_on attribute in order to prevent default auth: cannot configure default credentials errors.
Retrieves information about databricks_user.
Example Usage
Adding user to administrative group
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const admins = databricks.getGroup({
displayName: "admins",
});
const me = databricks.getUser({
userName: "me@example.com",
});
const myMemberA = new databricks.GroupMember("my_member_a", {
groupId: admins.then(admins => admins.id),
memberId: me.then(me => me.id),
});
import pulumi
import pulumi_databricks as databricks
admins = databricks.get_group(display_name="admins")
me = databricks.get_user(user_name="me@example.com")
my_member_a = databricks.GroupMember("my_member_a",
group_id=admins.id,
member_id=me.id)
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
admins, err := databricks.LookupGroup(ctx, &databricks.LookupGroupArgs{
DisplayName: "admins",
}, nil)
if err != nil {
return err
}
me, err := databricks.LookupUser(ctx, &databricks.LookupUserArgs{
UserName: pulumi.StringRef("me@example.com"),
}, nil)
if err != nil {
return err
}
_, err = databricks.NewGroupMember(ctx, "my_member_a", &databricks.GroupMemberArgs{
GroupId: pulumi.String(admins.Id),
MemberId: pulumi.String(me.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var admins = Databricks.GetGroup.Invoke(new()
{
DisplayName = "admins",
});
var me = Databricks.GetUser.Invoke(new()
{
UserName = "me@example.com",
});
var myMemberA = new Databricks.GroupMember("my_member_a", new()
{
GroupId = admins.Apply(getGroupResult => getGroupResult.Id),
MemberId = me.Apply(getUserResult => getUserResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetGroupArgs;
import com.pulumi.databricks.inputs.GetUserArgs;
import com.pulumi.databricks.GroupMember;
import com.pulumi.databricks.GroupMemberArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var admins = DatabricksFunctions.getGroup(GetGroupArgs.builder()
.displayName("admins")
.build());
final var me = DatabricksFunctions.getUser(GetUserArgs.builder()
.userName("me@example.com")
.build());
var myMemberA = new GroupMember("myMemberA", GroupMemberArgs.builder()
.groupId(admins.applyValue(getGroupResult -> getGroupResult.id()))
.memberId(me.applyValue(getUserResult -> getUserResult.id()))
.build());
}
}
resources:
myMemberA:
type: databricks:GroupMember
name: my_member_a
properties:
groupId: ${admins.id}
memberId: ${me.id}
variables:
admins:
fn::invoke:
Function: databricks:getGroup
Arguments:
displayName: admins
me:
fn::invoke:
Function: databricks:getUser
Arguments:
userName: me@example.com
Related Resources
The following resources are used in the same context:
- End to end workspace management guide.
- databricks.getCurrentUser data to retrieve information about databricks.User or databricks_service_principal, that is calling Databricks REST API.
- databricks.Group to manage groups in Databricks Workspace or Account Console (for AWS deployments).
- databricks.Group data to retrieve information about databricks.Group members, entitlements and instance profiles.
- databricks.GroupInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_group.
- databricks.GroupMember to attach users and groups as group members.
- databricks.Permissions to manage access control in Databricks workspace.
- databricks.User to manage users, that could be added to databricks.Group within the workspace.
- databricks.UserInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_user.
Using getUser
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 getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
function getUserOutput(args: GetUserOutputArgs, opts?: InvokeOptions): Output<GetUserResult>
def get_user(user_id: Optional[str] = None,
user_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUserResult
def get_user_output(user_id: Optional[pulumi.Input[str]] = None,
user_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)
func LookupUserOutput(ctx *Context, args *LookupUserOutputArgs, opts ...InvokeOption) LookupUserResultOutput
> Note: This function is named LookupUser
in the Go SDK.
public static class GetUser
{
public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: databricks:index/getUser:getUser
arguments:
# arguments dictionary
The following arguments are supported:
getUser Result
The following output properties are available:
- Acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - Active bool
- Whether the user is active.
- Alphanumeric string
- Alphanumeric representation of user local name. e.g.
mr_foo
. - Application
Id string - Display
Name string - Display name of the user, e.g.
Mr Foo
. - External
Id string - ID of the user in an external identity provider.
- Home string
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - Id string
- The provider-assigned unique ID for this managed resource.
- Repos string
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - User
Id string - User
Name string - Name of the user, e.g.
mr.foo@example.com
.
- Acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - Active bool
- Whether the user is active.
- Alphanumeric string
- Alphanumeric representation of user local name. e.g.
mr_foo
. - Application
Id string - Display
Name string - Display name of the user, e.g.
Mr Foo
. - External
Id string - ID of the user in an external identity provider.
- Home string
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - Id string
- The provider-assigned unique ID for this managed resource.
- Repos string
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - User
Id string - User
Name string - Name of the user, e.g.
mr.foo@example.com
.
- acl
Principal StringId - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - active Boolean
- Whether the user is active.
- alphanumeric String
- Alphanumeric representation of user local name. e.g.
mr_foo
. - application
Id String - display
Name String - Display name of the user, e.g.
Mr Foo
. - external
Id String - ID of the user in an external identity provider.
- home String
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - id String
- The provider-assigned unique ID for this managed resource.
- repos String
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - user
Id String - user
Name String - Name of the user, e.g.
mr.foo@example.com
.
- acl
Principal stringId - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - active boolean
- Whether the user is active.
- alphanumeric string
- Alphanumeric representation of user local name. e.g.
mr_foo
. - application
Id string - display
Name string - Display name of the user, e.g.
Mr Foo
. - external
Id string - ID of the user in an external identity provider.
- home string
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - id string
- The provider-assigned unique ID for this managed resource.
- repos string
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - user
Id string - user
Name string - Name of the user, e.g.
mr.foo@example.com
.
- acl_
principal_ strid - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - active bool
- Whether the user is active.
- alphanumeric str
- Alphanumeric representation of user local name. e.g.
mr_foo
. - application_
id str - display_
name str - Display name of the user, e.g.
Mr Foo
. - external_
id str - ID of the user in an external identity provider.
- home str
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - id str
- The provider-assigned unique ID for this managed resource.
- repos str
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - user_
id str - user_
name str - Name of the user, e.g.
mr.foo@example.com
.
- acl
Principal StringId - identifier for use in databricks_access_control_rule_set, e.g.
users/mr.foo@example.com
. - active Boolean
- Whether the user is active.
- alphanumeric String
- Alphanumeric representation of user local name. e.g.
mr_foo
. - application
Id String - display
Name String - Display name of the user, e.g.
Mr Foo
. - external
Id String - ID of the user in an external identity provider.
- home String
- Home folder of the user, e.g.
/Users/mr.foo@example.com
. - id String
- The provider-assigned unique ID for this managed resource.
- repos String
- Personal Repos location of the user, e.g.
/Repos/mr.foo@example.com
. - user
Id String - user
Name String - Name of the user, e.g.
mr.foo@example.com
.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.