Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 2.7 KB

service_principal.md

File metadata and controls

64 lines (45 loc) · 2.7 KB

databricks_service_principal Resource

Directly creates service principal, that could be added to databricks_group within workspace.

Example Usage

Creating regular service principal:

resource "databricks_service_principal" "sp" {
  application_id = "00000000-0000-0000-0000-000000000000"
}

Creating service principal with administrative permissions - referencing special admins databricks_group in databricks_group_member resource:

data "databricks_group" "admins" {
    display_name = "admins"
}

resource "databricks_service_principal" "sp" {
  application_id    = "00000000-0000-0000-0000-000000000000"
}

resource "databricks_group_member" "i-am-admin" {
  group_id = data.databricks_group.admins.id
  member_id = databricks_service_principal.sp.id
}

Creating service principal with cluster create permissions:

resource "databricks_service_principal" "sp" {
  application_id    = "00000000-0000-0000-0000-000000000000"
  display_name = "Example service principal"
  allow_cluster_create = true
}

Argument Reference

The following arguments are available:

  • application_id - (Required) This is the application id of the given service principal and will be their form of access and identity.
  • display_name - (Optional) This is an alias for the service principal can be the full name of the service principal.
  • allow_cluster_create - (Optional) Allow the service principal to have cluster create priviliges. Defaults to false. More fine grained permissions could be assigned with databricks_permissions and cluster_id argument. Everyone without allow_cluster_create arugment set, but with permission to use Cluster Policy would be able to create clusters, but within boundaries of that specific policy.
  • allow_instance_pool_create - (Optional) Allow the service principal to have instance pool create priviliges. Defaults to false. More fine grained permissions could be assigned with databricks_permissions and instance_pool_id argument.
  • active - (Optional) Either service principal is active or not. True by default, but can be set to false in case of service principal deactivation with preserving service principal assets.

Attribute Reference

In addition to all arguments above, the following attributes are exported:

  • id - Canonical unique identifier for the service principal.

Import

The resource scim service principal can be imported using id:

$ terraform import databricks_service_principal.me <service-principal-id>