databricksuserrole Resource
June 12, 2026 ยท View on GitHub
This resource allows you to attach a role or databricks_instance_profile (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
resource "databricks_instance_profile" "instance_profile" {
instance_profile_arn = "my_instance_profile_arn"
}
resource "databricks_user" "my_user" {
user_name = "me@example.com"
}
resource "databricks_user_role" "my_user_role" {
user_id = databricks_user.my_user.id
role = databricks_instance_profile.instance_profile.id
}
Adding user as administrator to Databricks Account
provider "databricks" {
host = "https://accounts.cloud.databricks.com"
account_id = var.databricks_account_id
client_id = var.client_id
client_secret = var.client_secret
}
resource "databricks_user" "my_user" {
user_name = "me@example.com"
}
resource "databricks_user_role" "my_user_account_admin" {
user_id = databricks_user.my_user.id
role = "account_admin"
}
Argument Reference
The following arguments are supported:
user_id- (Required) This is the id of the user resource.role- (Required) Either a role name or the ARN/ID of the instance profile resource.api- (Optional) Specifies whether to use account-level or workspace-level API. Valid values areaccountandworkspace. When not set, the API level is inferred from the provider host.
Attribute Reference
In addition to all arguments above, the following attributes are exported:
id- The id in the format<user_id>|<role>.
Import
!> Importing this resource is not currently supported.
Related Resources
The following resources are often used in the same context:
- End to end workspace management guide.
- databricks_group_instance_profile to attach databricks_instance_profile (AWS) to databricks_group.
- databricks_group_member to attach users and groups as group members.
- databricks_instance_profile 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.