|
| 1 | +--- |
| 2 | +subcategory: "Security" |
| 3 | +--- |
| 4 | +# databricks_user_role Resource |
| 5 | + |
| 6 | +This resource allows you to attach a role or [databricks_instance_profile](instance_profile.md) (AWS) to [databricks_user](user.md). |
| 7 | + |
| 8 | +## Example Usage |
| 9 | + |
| 10 | +Adding AWS instance profile to a user |
| 11 | + |
| 12 | +```hcl |
| 13 | +resource "databricks_instance_profile" "instance_profile" { |
| 14 | + instance_profile_arn = "my_instance_profile_arn" |
| 15 | +} |
| 16 | +
|
| 17 | +resource "databricks_user" "my_user" { |
| 18 | + |
| 19 | +} |
| 20 | +
|
| 21 | +resource "databricks_user_role" "my_user_role" { |
| 22 | + user_id = databricks_user.my_user.id |
| 23 | + role = databricks_instance_profile.instance_profile.id |
| 24 | +} |
| 25 | +``` |
| 26 | + |
| 27 | +Adding user as administrator to Databricks Account |
| 28 | + |
| 29 | +```hcl |
| 30 | +provider "databricks" { |
| 31 | + host = "https://accounts.cloud.databricks.com" |
| 32 | + account_id = var.databricks_account_id |
| 33 | + username = var.databricks_user |
| 34 | + password = var.databricks_password |
| 35 | +} |
| 36 | +
|
| 37 | +resource "databricks_user" "my_user" { |
| 38 | + |
| 39 | +} |
| 40 | +
|
| 41 | +resource "databricks_user_role" "my_user_account_admin" { |
| 42 | + user_id = databricks_user.my_user.id |
| 43 | + role = "account_admin" |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +## Argument Reference |
| 48 | + |
| 49 | +The following arguments are supported: |
| 50 | + |
| 51 | +* `user_id` - (Required) This is the id of the [user](user.md) resource. |
| 52 | +* `role` - (Required) Either a role name or the id of the [instance profile](instance_profile.md) resource. |
| 53 | + |
| 54 | +## Attribute Reference |
| 55 | + |
| 56 | +In addition to all arguments above, the following attributes are exported: |
| 57 | + |
| 58 | +* `id` - The id in the format `<user_id>|<role>`. |
| 59 | + |
| 60 | +## Related Resources |
| 61 | + |
| 62 | +The following resources are often used in the same context: |
| 63 | + |
| 64 | +* [End to end workspace management](../guides/workspace-management.md) guide. |
| 65 | +* [databricks_group_instance_profile](group_instance_profile.md) to attach [databricks_instance_profile](instance_profile.md) (AWS) to [databricks_group](group.md). |
| 66 | +* [databricks_group_member](group_member.md) to attach [users](user.md) and [groups](group.md) as group members. |
| 67 | +* [databricks_instance_profile](instance_profile.md) to manage AWS EC2 instance profiles that users can launch [databricks_cluster](cluster.md) and access data, like [databricks_mount](mount.md). |
| 68 | +* [databricks_user](user.md) to [manage users](https://docs.databricks.com/administration-guide/users-groups/users.html), that could be added to [databricks_group](group.md) within the workspace. |
| 69 | +* [databricks_user](../data-sources/user.md) data to retrieves information about [databricks_user](user.md). |
0 commit comments