published on Tuesday, May 12, 2026 by Pulumi
published on Tuesday, May 12, 2026 by Pulumi
This resource allows you to attach a role or databricks.InstanceProfile (AWS) to databricks_user.
This resource can be used with an account or workspace-level provider.
Example Usage
Adding AWS instance profile to a user
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const instanceProfile = new databricks.InstanceProfile("instance_profile", {instanceProfileArn: "my_instance_profile_arn"});
const myUser = new databricks.User("my_user", {userName: "me@example.com"});
const myUserRole = new databricks.UserRole("my_user_role", {
userId: myUser.id,
role: instanceProfile.id,
});
import pulumi
import pulumi_databricks as databricks
instance_profile = databricks.InstanceProfile("instance_profile", instance_profile_arn="my_instance_profile_arn")
my_user = databricks.User("my_user", user_name="me@example.com")
my_user_role = databricks.UserRole("my_user_role",
user_id=my_user.id,
role=instance_profile.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 {
instanceProfile, err := databricks.NewInstanceProfile(ctx, "instance_profile", &databricks.InstanceProfileArgs{
InstanceProfileArn: pulumi.String("my_instance_profile_arn"),
})
if err != nil {
return err
}
myUser, err := databricks.NewUser(ctx, "my_user", &databricks.UserArgs{
UserName: pulumi.String("me@example.com"),
})
if err != nil {
return err
}
_, err = databricks.NewUserRole(ctx, "my_user_role", &databricks.UserRoleArgs{
UserId: myUser.ID(),
Role: instanceProfile.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 instanceProfile = new Databricks.InstanceProfile("instance_profile", new()
{
InstanceProfileArn = "my_instance_profile_arn",
});
var myUser = new Databricks.User("my_user", new()
{
UserName = "me@example.com",
});
var myUserRole = new Databricks.UserRole("my_user_role", new()
{
UserId = myUser.Id,
Role = instanceProfile.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.InstanceProfile;
import com.pulumi.databricks.InstanceProfileArgs;
import com.pulumi.databricks.User;
import com.pulumi.databricks.UserArgs;
import com.pulumi.databricks.UserRole;
import com.pulumi.databricks.UserRoleArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var instanceProfile = new InstanceProfile("instanceProfile", InstanceProfileArgs.builder()
.instanceProfileArn("my_instance_profile_arn")
.build());
var myUser = new User("myUser", UserArgs.builder()
.userName("me@example.com")
.build());
var myUserRole = new UserRole("myUserRole", UserRoleArgs.builder()
.userId(myUser.id())
.role(instanceProfile.id())
.build());
}
}
resources:
instanceProfile:
type: databricks:InstanceProfile
name: instance_profile
properties:
instanceProfileArn: my_instance_profile_arn
myUser:
type: databricks:User
name: my_user
properties:
userName: me@example.com
myUserRole:
type: databricks:UserRole
name: my_user_role
properties:
userId: ${myUser.id}
role: ${instanceProfile.id}
Example coming soon!
Adding user as administrator to Databricks Account
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const myUser = new databricks.User("my_user", {userName: "me@example.com"});
const myUserAccountAdmin = new databricks.UserRole("my_user_account_admin", {
userId: myUser.id,
role: "account_admin",
});
import pulumi
import pulumi_databricks as databricks
my_user = databricks.User("my_user", user_name="me@example.com")
my_user_account_admin = databricks.UserRole("my_user_account_admin",
user_id=my_user.id,
role="account_admin")
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 {
myUser, err := databricks.NewUser(ctx, "my_user", &databricks.UserArgs{
UserName: pulumi.String("me@example.com"),
})
if err != nil {
return err
}
_, err = databricks.NewUserRole(ctx, "my_user_account_admin", &databricks.UserRoleArgs{
UserId: myUser.ID(),
Role: pulumi.String("account_admin"),
})
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 myUser = new Databricks.User("my_user", new()
{
UserName = "me@example.com",
});
var myUserAccountAdmin = new Databricks.UserRole("my_user_account_admin", new()
{
UserId = myUser.Id,
Role = "account_admin",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.User;
import com.pulumi.databricks.UserArgs;
import com.pulumi.databricks.UserRole;
import com.pulumi.databricks.UserRoleArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var myUser = new User("myUser", UserArgs.builder()
.userName("me@example.com")
.build());
var myUserAccountAdmin = new UserRole("myUserAccountAdmin", UserRoleArgs.builder()
.userId(myUser.id())
.role("account_admin")
.build());
}
}
resources:
myUser:
type: databricks:User
name: my_user
properties:
userName: me@example.com
myUserAccountAdmin:
type: databricks:UserRole
name: my_user_account_admin
properties:
userId: ${myUser.id}
role: account_admin
Example coming soon!
Related Resources
The following resources are often used in the same context:
- End to end workspace management guide.
- databricks.GroupInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_group.
- databricks.GroupMember to attach users and groups as group members.
- databricks.InstanceProfile to manage AWS EC2 instance profiles that users can launch databricks.Cluster and access data, like databricks_mount.
- databricks.User to manage users, that could be added to databricks.Group within the workspace.
- databricks.User data to retrieve information about databricks_user.
Create UserRole Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserRole(name: string, args: UserRoleArgs, opts?: CustomResourceOptions);@overload
def UserRole(resource_name: str,
args: UserRoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def UserRole(resource_name: str,
opts: Optional[ResourceOptions] = None,
role: Optional[str] = None,
user_id: Optional[str] = None,
api: Optional[str] = None,
provider_config: Optional[UserRoleProviderConfigArgs] = None)func NewUserRole(ctx *Context, name string, args UserRoleArgs, opts ...ResourceOption) (*UserRole, error)public UserRole(string name, UserRoleArgs args, CustomResourceOptions? opts = null)
public UserRole(String name, UserRoleArgs args)
public UserRole(String name, UserRoleArgs args, CustomResourceOptions options)
type: databricks:UserRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "databricks_userrole" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args UserRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UserRoleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserRoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserRoleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var userRoleResource = new Databricks.UserRole("userRoleResource", new()
{
Role = "string",
UserId = "string",
Api = "string",
ProviderConfig = new Databricks.Inputs.UserRoleProviderConfigArgs
{
WorkspaceId = "string",
},
});
example, err := databricks.NewUserRole(ctx, "userRoleResource", &databricks.UserRoleArgs{
Role: pulumi.String("string"),
UserId: pulumi.String("string"),
Api: pulumi.String("string"),
ProviderConfig: &databricks.UserRoleProviderConfigArgs{
WorkspaceId: pulumi.String("string"),
},
})
resource "databricks_userrole" "userRoleResource" {
role = "string"
user_id = "string"
api = "string"
provider_config = {
workspace_id = "string"
}
}
var userRoleResource = new UserRole("userRoleResource", UserRoleArgs.builder()
.role("string")
.userId("string")
.api("string")
.providerConfig(UserRoleProviderConfigArgs.builder()
.workspaceId("string")
.build())
.build());
user_role_resource = databricks.UserRole("userRoleResource",
role="string",
user_id="string",
api="string",
provider_config={
"workspace_id": "string",
})
const userRoleResource = new databricks.UserRole("userRoleResource", {
role: "string",
userId: "string",
api: "string",
providerConfig: {
workspaceId: "string",
},
});
type: databricks:UserRole
properties:
api: string
providerConfig:
workspaceId: string
role: string
userId: string
UserRole Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The UserRole resource accepts the following input properties:
- Role string
- Either a role name or the ARN/ID of the instance profile resource.
- User
Id string - This is the id of the user resource.
- Api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - Provider
Config UserRole Provider Config
- Role string
- Either a role name or the ARN/ID of the instance profile resource.
- User
Id string - This is the id of the user resource.
- Api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - Provider
Config UserRole Provider Config Args
- role string
- Either a role name or the ARN/ID of the instance profile resource.
- user_
id string - This is the id of the user resource.
- api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider_
config object
- role String
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id String - This is the id of the user resource.
- api String
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config UserRole Provider Config
- role string
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id string - This is the id of the user resource.
- api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config UserRole Provider Config
- role str
- Either a role name or the ARN/ID of the instance profile resource.
- user_
id str - This is the id of the user resource.
- api str
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider_
config UserRole Provider Config Args
- role String
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id String - This is the id of the user resource.
- api String
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the UserRole resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing UserRole Resource
Get an existing UserRole resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserRoleState, opts?: CustomResourceOptions): UserRole@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api: Optional[str] = None,
provider_config: Optional[UserRoleProviderConfigArgs] = None,
role: Optional[str] = None,
user_id: Optional[str] = None) -> UserRolefunc GetUserRole(ctx *Context, name string, id IDInput, state *UserRoleState, opts ...ResourceOption) (*UserRole, error)public static UserRole Get(string name, Input<string> id, UserRoleState? state, CustomResourceOptions? opts = null)public static UserRole get(String name, Output<String> id, UserRoleState state, CustomResourceOptions options)resources: _: type: databricks:UserRole get: id: ${id}import {
to = databricks_userrole.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - Provider
Config UserRole Provider Config - Role string
- Either a role name or the ARN/ID of the instance profile resource.
- User
Id string - This is the id of the user resource.
- Api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - Provider
Config UserRole Provider Config Args - Role string
- Either a role name or the ARN/ID of the instance profile resource.
- User
Id string - This is the id of the user resource.
- api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider_
config object - role string
- Either a role name or the ARN/ID of the instance profile resource.
- user_
id string - This is the id of the user resource.
- api String
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config UserRole Provider Config - role String
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id String - This is the id of the user resource.
- api string
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config UserRole Provider Config - role string
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id string - This is the id of the user resource.
- api str
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider_
config UserRole Provider Config Args - role str
- Either a role name or the ARN/ID of the instance profile resource.
- user_
id str - This is the id of the user resource.
- api String
- Specifies whether to use account-level or workspace-level API. Valid values are
accountandworkspace. When not set, the API level is inferred from the provider host. - provider
Config Property Map - role String
- Either a role name or the ARN/ID of the instance profile resource.
- user
Id String - This is the id of the user resource.
Supporting Types
UserRoleProviderConfig, UserRoleProviderConfigArgs
- Workspace
Id string
- Workspace
Id string
- workspace_
id string
- workspace
Id String
- workspace
Id string
- workspace_
id str
- workspace
Id String
Import
!> Importing this resource is not currently supported.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
published on Tuesday, May 12, 2026 by Pulumi
