postgres_projects
Creates, updates, deletes, gets or lists a postgres_projects resource.
Overview
| Name | postgres_projects |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_projects |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the project. Format: projects/{project_id} |
project_id | string | The part of the name, chosen by the user when the resource was created. |
create_time | string (date-time) | |
delete_time | string (date-time) | A timestamp indicating when the project was soft-deleted. Empty if the project is not deleted, otherwise set to a timestamp in the past. |
initial_branch_spec | object | Configuration for the initial default branch created as part of project creation. Allows overriding branch protection. These settings only apply at creation time and do not affect resources created after project creation. |
initial_database_spec | object | Configuration for the initial Postgres database created inside the initial branch for this project. If omitted, the initial branch still gets an initial database with name ``databricks_postgres``. The initial database is always owned by the initial role (caller-provided via ``initial_role_spec`` or defaulted to the caller's identity). This field is input-only; to change databases after project creation, use the standalone Database API. |
initial_endpoint_spec | object | Configuration settings for the initial Read/Write endpoint created inside the initial branch for a newly created project. If omitted, the initial endpoint created will have default settings, without high availability configured. This field does not apply to any endpoints created after project creation. Use spec.default_endpoint_settings to configure default settings for endpoints created after project creation. |
initial_role_spec | object | Configuration for the initial Postgres role created inside the initial branch for this project. If omitted, the initial branch gets an initial role corresponding to the caller of the API endpoint. This field is input-only; to change roles after project creation, use the standalone Role API. |
purge_time | string (date-time) | A timestamp indicating when the project is scheduled for permanent deletion. Empty if the project is not deleted, otherwise set to a timestamp in the future. |
spec | object | The spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings. |
status | object | The current status of a Project. |
uid | string | System-generated unique ID for the project. |
update_time | string (date-time) | A timestamp indicating when the project was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | deployment_name | page_size, page_token, show_deleted | Returns a paginated list of database projects in the workspace that the user has permission to access. |
create | insert | project_id, deployment_name, project | Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute | |
update | update | name, update_mask, deployment_name, snapshot_schedule | Sets the snapshot schedule for a branch. The schedule field is replaced wholesale; an empty | |
undelete | exec | name, deployment_name | Undeletes a soft-deleted project. |
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 project to undelete. Format: projects/{project_id} |
project_id | string | The ID to use for the Project. This becomes the final component of the project's resource name. The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, my-app becomes projects/my-app. |
update_mask | object | Fields to update. The only updatable path is schedule, which replaces the entire set of cadences. |
page_size | integer | Upper bound for items returned. Cannot be negative. The maximum value is 100. |
page_token | string | Page token from a previous response. If not provided, returns the first page. |
show_deleted | boolean | Whether to include soft-deleted projects in the response. When true, soft-deleted projects are included alongside active projects. Hard-deleted and already-purged projects are never returned. |
SELECT examples
- list
Returns a paginated list of database projects in the workspace that the user has permission to access.
SELECT
name,
project_id,
create_time,
delete_time,
initial_branch_spec,
initial_database_spec,
initial_endpoint_spec,
initial_role_spec,
purge_time,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.postgres_projects
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
AND show_deleted = '{{ show_deleted }}'
;
INSERT examples
- create
- Manifest
Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute
INSERT INTO databricks_workspace.postgres.postgres_projects (
project,
project_id,
deployment_name
)
SELECT
'{{ project }}' /* required */,
'{{ project_id }}',
'{{ deployment_name }}'
;
# Description fields are for documentation purposes
- name: postgres_projects
props:
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the postgres_projects resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_projects resource.
- name: project
description: |
The Project to create.
value:
create_time: "{{ create_time }}"
delete_time: "{{ delete_time }}"
initial_branch_spec:
is_protected: {{ is_protected }}
initial_database_spec:
postgres_database: "{{ postgres_database }}"
initial_endpoint_spec:
autoscaling_limit_max_cu: {{ autoscaling_limit_max_cu }}
autoscaling_limit_min_cu: {{ autoscaling_limit_min_cu }}
group:
min: {{ min }}
max: {{ max }}
enable_readable_secondaries: {{ enable_readable_secondaries }}
no_suspension: {{ no_suspension }}
suspend_timeout_duration: "{{ suspend_timeout_duration }}"
initial_role_spec:
attributes:
bypassrls: {{ bypassrls }}
createdb: {{ createdb }}
createrole: {{ createrole }}
auth_method: "{{ auth_method }}"
identity_type: "{{ identity_type }}"
membership_roles:
- "{{ membership_roles }}"
postgres_role: "{{ postgres_role }}"
name: "{{ name }}"
project_id: "{{ project_id }}"
purge_time: "{{ purge_time }}"
spec:
budget_policy_id: "{{ budget_policy_id }}"
compute_provisioner: "{{ compute_provisioner }}"
custom_tags:
- key: "{{ key }}"
value: "{{ value }}"
default_branch: "{{ default_branch }}"
default_endpoint_settings:
autoscaling_limit_max_cu: {{ autoscaling_limit_max_cu }}
autoscaling_limit_min_cu: {{ autoscaling_limit_min_cu }}
no_suspension: {{ no_suspension }}
pg_settings: "{{ pg_settings }}"
suspend_timeout_duration: "{{ suspend_timeout_duration }}"
display_name: "{{ display_name }}"
enable_pg_native_login: {{ enable_pg_native_login }}
history_retention_duration: "{{ history_retention_duration }}"
pg_version: {{ pg_version }}
status:
branch_logical_size_limit_bytes: {{ branch_logical_size_limit_bytes }}
budget_policy_id: "{{ budget_policy_id }}"
compute_last_active_time: "{{ compute_last_active_time }}"
compute_provisioner: "{{ compute_provisioner }}"
custom_tags:
- key: "{{ key }}"
value: "{{ value }}"
default_branch: "{{ default_branch }}"
default_endpoint_settings:
autoscaling_limit_max_cu: {{ autoscaling_limit_max_cu }}
autoscaling_limit_min_cu: {{ autoscaling_limit_min_cu }}
no_suspension: {{ no_suspension }}
pg_settings: "{{ pg_settings }}"
suspend_timeout_duration: "{{ suspend_timeout_duration }}"
display_name: "{{ display_name }}"
enable_pg_native_login: {{ enable_pg_native_login }}
history_retention_duration: "{{ history_retention_duration }}"
owner: "{{ owner }}"
pg_version: {{ pg_version }}
project_id: "{{ project_id }}"
replication_role: "{{ replication_role }}"
synthetic_storage_size_bytes: {{ synthetic_storage_size_bytes }}
uid: "{{ uid }}"
update_time: "{{ update_time }}"
UPDATE examples
- update
Sets the snapshot schedule for a branch. The schedule field is replaced wholesale; an empty
UPDATE databricks_workspace.postgres.postgres_projects
SET
snapshot_schedule = '{{ snapshot_schedule }}'
WHERE
name = '{{ name }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND snapshot_schedule = '{{ snapshot_schedule }}' --required
RETURNING
name,
schedule;
Lifecycle Methods
- undelete
Undeletes a soft-deleted project.
EXEC databricks_workspace.postgres.postgres_projects.undelete
@name='{{ name }}' --required,
@deployment_name='{{ deployment_name }}' --required
;