postgres_replication_group_previews
Creates, updates, deletes, gets or lists a postgres_replication_group_previews resource.
Overview
| Name | postgres_replication_group_previews |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_replication_group_previews |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The resource name of the replication group. Format: projects/{project_id}/preview/replication-groups/{replication_group_id} |
create_time | string (date-time) | Server-generated timestamps. |
etag | string | Optional optimistic concurrency token for update and delete. |
observed_metrics | object | The latest observed replication metrics for this group. |
parent | string | The parent project that owns this replication group. Format: projects/{project_id} |
primary_workspace | string | The workspace currently serving writes. Server-owned. |
replication_mode | string | How changes are propagated from the primary workspace to its secondaries in a replication group:<br />on a fixed schedule or continuously as they occur. (REPLICATION_MODE_PREVIEW_LIVE, REPLICATION_MODE_PREVIEW_PERIODIC) |
state | string | The lifecycle state of the replication group. (REPLICATION_GROUP_PREVIEW_STATE_DEGRADED, REPLICATION_GROUP_PREVIEW_STATE_DELETING, REPLICATION_GROUP_PREVIEW_STATE_FAILING_OVER, REPLICATION_GROUP_PREVIEW_STATE_PROVISIONING, REPLICATION_GROUP_PREVIEW_STATE_READY, REPLICATION_GROUP_PREVIEW_STATE_SWITCHING_OVER) |
update_time | string (date-time) | |
workspaces | array | The workspaces participating in this replication group. Phase 1 requires exactly 2 entries. |
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 replication groups for the project. |
create | insert | parent, replication_group_preview_id, deployment_name, replication_group_preview | request_id | Creates a new replication group for the project. |
failover | exec | name, deployment_name, target_workspace | Fails over the replication group to a target workspace, promoting the secondary to primary. | |
switchover | exec | name, deployment_name, target_workspace | Switches over the replication group to a target workspace with a coordinated failover. |
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 | |
parent | string | |
replication_group_preview_id | string | |
page_size | integer | |
page_token | string | |
request_id | string |
SELECT examples
- list
Returns a paginated list of replication groups for the project.
SELECT
name,
create_time,
etag,
observed_metrics,
parent,
primary_workspace,
replication_mode,
state,
update_time,
workspaces
FROM databricks_workspace.postgres.postgres_replication_group_previews
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a new replication group for the project.
INSERT INTO databricks_workspace.postgres.postgres_replication_group_previews (
replication_group_preview,
parent,
replication_group_preview_id,
deployment_name,
request_id
)
SELECT
'{{ replication_group_preview }}' /* required */,
'{{ parent }}',
'{{ replication_group_preview_id }}',
'{{ deployment_name }}',
'{{ request_id }}'
;
# Description fields are for documentation purposes
- name: postgres_replication_group_previews
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the postgres_replication_group_previews resource.
- name: replication_group_preview_id
value: "{{ replication_group_preview_id }}"
description: Required parameter for the postgres_replication_group_previews resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_replication_group_previews resource.
- name: replication_group_preview
value:
replication_mode: "{{ replication_mode }}"
workspaces:
- "{{ workspaces }}"
create_time: "{{ create_time }}"
etag: "{{ etag }}"
name: "{{ name }}"
observed_metrics:
as_of_time: "{{ as_of_time }}"
bytes_lag: {{ bytes_lag }}
throughput_bytes_per_second: {{ throughput_bytes_per_second }}
time_lag: "{{ time_lag }}"
parent: "{{ parent }}"
primary_workspace: "{{ primary_workspace }}"
state: "{{ state }}"
update_time: "{{ update_time }}"
- name: request_id
value: "{{ request_id }}"
Lifecycle Methods
- failover
- switchover
Fails over the replication group to a target workspace, promoting the secondary to primary.
EXEC databricks_workspace.postgres.postgres_replication_group_previews.failover
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"target_workspace": "{{ target_workspace }}",
"etag": "{{ etag }}",
"request_id": "{{ request_id }}"
}'
;
Switches over the replication group to a target workspace with a coordinated failover.
EXEC databricks_workspace.postgres.postgres_replication_group_previews.switchover
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"target_workspace": "{{ target_workspace }}",
"etag": "{{ etag }}",
"request_id": "{{ request_id }}"
}'
;