postgres_roles
Creates, updates, deletes, gets or lists a postgres_roles resource.
Overview
| Name | postgres_roles |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_roles |
Fields
The following fields are returned by SELECT queries:
- list
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} |
create_time | string (date-time) | |
parent | string | The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id} |
spec | object | The spec contains the role configuration, including identity type, authentication method, and role attributes. |
status | object | Current status of the role, including its identity type, authentication method, and role attributes. |
update_time | string (date-time) |
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} |
create_time | string (date-time) | |
parent | string | The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id} |
spec | object | The spec contains the role configuration, including identity type, authentication method, and role attributes. |
status | object | Current status of the role, including its identity type, authentication method, and role attributes. |
update_time | string (date-time) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | page_size, page_token | Returns a paginated list of Postgres roles in the branch. |
get | select | name, deployment_name | Retrieves information about the specified Postgres role, including its authentication method and | |
create | insert | parent, deployment_name, role | role_id | Creates a new Postgres role in the branch. |
delete | delete | name, deployment_name | reassign_owned_to | Deletes the specified Postgres role. |
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) |
name | string | The full resource path of the role to delete. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} |
parent | string | The Branch where this Role is created. Format: projects/{project_id}/branches/{branch_id} |
page_size | integer | Upper bound for items returned. Cannot be negative. |
page_token | string | Page token from a previous response. If not provided, returns the first page. |
reassign_owned_to | string | Reassign objects. If this is set, all objects owned by the role are reassigned to the role specified in this parameter. NOTE: setting this requires spinning up a compute to succeed, since it involves running SQL queries. TODO: #LKB-7187 implement reassign_owned_to on LBM side. This might end-up being a synchronous query when this parameter is used. |
role_id | string | The ID to use for the Role, which will become the final component of the role's resource name. This ID becomes the role in Postgres. This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123. If role_id is not specified in the request, it is generated automatically. |
SELECT examples
- list
- get
Returns a paginated list of Postgres roles in the branch.
SELECT
name,
create_time,
parent,
spec,
status,
update_time
FROM databricks_workspace.postgres.postgres_roles
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
Retrieves information about the specified Postgres role, including its authentication method and
SELECT
name,
create_time,
parent,
spec,
status,
update_time
FROM databricks_workspace.postgres.postgres_roles
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
Creates a new Postgres role in the branch.
INSERT INTO databricks_workspace.postgres.postgres_roles (
role,
parent,
deployment_name,
role_id
)
SELECT
'{{ role }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ role_id }}'
;
# Description fields are for documentation purposes
- name: postgres_roles
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the postgres_roles resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_roles resource.
- name: role
description: |
The desired specification of a Role.
value:
create_time: "{{ create_time }}"
name: "{{ name }}"
parent: "{{ parent }}"
spec:
auth_method: "{{ auth_method }}"
identity_type: "{{ identity_type }}"
postgres_role: "{{ postgres_role }}"
status:
auth_method: "{{ auth_method }}"
identity_type: "{{ identity_type }}"
postgres_role: "{{ postgres_role }}"
update_time: "{{ update_time }}"
- name: role_id
value: "{{ role_id }}"
description: The ID to use for the Role, which will become the final component of the role's resource name. This ID becomes the role in Postgres. This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123. If role_id is not specified in the request, it is generated automatically.
DELETE examples
- delete
Deletes the specified Postgres role.
DELETE FROM databricks_workspace.postgres.postgres_roles
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND reassign_owned_to = '{{ reassign_owned_to }}'
;