planetscalepostgresbranch_backups (Data Source)
June 3, 2026 ยท View on GitHub
PostgresBranchBackups DataSource
Example Usage
data "planetscale_postgres_branch_backups" "my_postgresbranchbackups" {
all = false
branch = "...my_branch..."
database = "...my_database..."
from = "...my_from..."
organization = "...my_organization..."
policy = "...my_policy..."
production = true
running_at = "...my_running_at..."
state = "ignored"
to = "...my_to..."
}
Schema
Required
branch(String) The name of the branchdatabase(String) The name of the database the branch belongs toorganization(String) The name of the organization the branch belongs to
Optional
all(Boolean) Whether to include all backups, including deleted onesfrom(String) Filter backups started after this date (e.g. 2023-01-01T00:00:00Z)policy(String) Filter backups by backup policy IDproduction(Boolean) Filter backups by production branchrunning_at(String) Filter backups that are running during a specific time (e.g. 2023-01-01T00:00:00Z..2023-01-01T23:59:59Z)state(String) Filter backups by state. must be one of ["pending", "running", "success", "failed", "canceled", "ignored"]to(String) Filter backups started before this date (e.g. 2023-01-31T23:59:59Z)
Read-Only
data(Attributes List) (see below for nested schema)
Nested Schema for data
Read-Only:
actor(Attributes) (see below for nested schema)backup_policy(Attributes) (see below for nested schema)completed_at(String) When the backup completeddatabase_branch(Attributes) (see below for nested schema)deleted_at(String) When the backup was deletedestimated_storage_cost(Number) The estimated storage cost of the backupexpires_at(String) When the backup expiresid(String) The ID of the backupname(String) The name of the backupprotected(Boolean) Whether or not the backup is protected from deletionpvc_size(Number) Size of the PVC used for the backupsize(Number) The size of the backup in bytesstarted_at(String) When the backup startedstate(String) The current state of the backup
Nested Schema for data.actor
Read-Only:
id(String) The ID of the actor
Nested Schema for data.backup_policy
Read-Only:
id(String) The ID of the backup policy
Nested Schema for data.database_branch
Read-Only:
id(String) The ID for the resourcename(String) The name for the resource