database_instance_roles
Creates, updates, deletes, gets or lists a database_instance_roles resource.
Overview
| Name | database_instance_roles |
| Type | Resource |
| Id | databricks_workspace.database.database_instance_roles |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the role. This is the unique identifier for the role in an instance. |
instance_name | string | |
attributes | object | The desired API-exposed Postgres role attribute to associate with the role. Optional. |
effective_attributes | object | The attributes that are applied to the role. This is an output only field that contains the value computed from the input field combined with server side defaults. Use the field without the effective_ prefix to set the value. |
identity_type | string | The type of the role. (GROUP, PG_ONLY, SERVICE_PRINCIPAL, USER) |
membership_role | string | An enum value for a standard role that this role is a member of. (DATABRICKS_SUPERUSER) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the role. This is the unique identifier for the role in an instance. |
instance_name | string | |
attributes | object | The desired API-exposed Postgres role attribute to associate with the role. Optional. |
effective_attributes | object | The attributes that are applied to the role. This is an output only field that contains the value computed from the input field combined with server side defaults. Use the field without the effective_ prefix to set the value. |
identity_type | string | The type of the role. (GROUP, PG_ONLY, SERVICE_PRINCIPAL, USER) |
membership_role | string | An enum value for a standard role that this role is a member of. (DATABRICKS_SUPERUSER) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | instance_name, name, deployment_name | Gets a role for a Database Instance. | |
list | select | instance_name, deployment_name | page_size, page_token | START OF PG ROLE APIs Section These APIs are marked a PUBLIC with stage < PUBLIC_PREVIEW. With more |
create | insert | instance_name, deployment_name, database_instance_role | database_instance_name | Create a role for a Database Instance. |
delete | delete | instance_name, name, deployment_name | allow_missing, reassign_owned_to | Deletes a role for a Database Instance. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
instance_name | string | :param name: str |
name | string | |
allow_missing | boolean | This is the AIP standard name for the equivalent of Postgres' IF EXISTS option |
database_instance_name | string | :returns: :class:DatabaseInstanceRole |
page_size | integer | |
page_token | string | Pagination token to go to the next page of Database Instances. Requests first page if absent. |
reassign_owned_to | string | str (optional) |
SELECT examples
- get
- list
Gets a role for a Database Instance.
SELECT
name,
instance_name,
attributes,
effective_attributes,
identity_type,
membership_role
FROM databricks_workspace.database.database_instance_roles
WHERE instance_name = '{{ instance_name }}' -- required
AND name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
START OF PG ROLE APIs Section These APIs are marked a PUBLIC with stage < PUBLIC_PREVIEW. With more
SELECT
name,
instance_name,
attributes,
effective_attributes,
identity_type,
membership_role
FROM databricks_workspace.database.database_instance_roles
WHERE instance_name = '{{ instance_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Create a role for a Database Instance.
INSERT INTO databricks_workspace.database.database_instance_roles (
database_instance_role,
instance_name,
deployment_name,
database_instance_name
)
SELECT
'{{ database_instance_role }}' /* required */,
'{{ instance_name }}',
'{{ deployment_name }}',
'{{ database_instance_name }}'
RETURNING
name,
instance_name,
attributes,
effective_attributes,
identity_type,
membership_role
;
# Description fields are for documentation purposes
- name: database_instance_roles
props:
- name: instance_name
value: "{{ instance_name }}"
description: Required parameter for the database_instance_roles resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the database_instance_roles resource.
- name: database_instance_role
description: |
A DatabaseInstanceRole represents a Postgres role in a database instance.
value:
name: "{{ name }}"
attributes:
bypassrls: {{ bypassrls }}
createdb: {{ createdb }}
createrole: {{ createrole }}
effective_attributes:
bypassrls: {{ bypassrls }}
createdb: {{ createdb }}
createrole: {{ createrole }}
identity_type: "{{ identity_type }}"
instance_name: "{{ instance_name }}"
membership_role: "{{ membership_role }}"
- name: database_instance_name
value: "{{ database_instance_name }}"
description: :returns: :class:`DatabaseInstanceRole`
DELETE examples
- delete
Deletes a role for a Database Instance.
DELETE FROM databricks_workspace.database.database_instance_roles
WHERE instance_name = '{{ instance_name }}' --required
AND name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND allow_missing = '{{ allow_missing }}'
AND reassign_owned_to = '{{ reassign_owned_to }}'
;