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 branch
  • database (String) The name of the database the branch belongs to
  • organization (String) The name of the organization the branch belongs to

Optional

  • all (Boolean) Whether to include all backups, including deleted ones
  • from (String) Filter backups started after this date (e.g. 2023-01-01T00:00:00Z)
  • policy (String) Filter backups by backup policy ID
  • production (Boolean) Filter backups by production branch
  • running_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

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 completed
  • database_branch (Attributes) (see below for nested schema)
  • deleted_at (String) When the backup was deleted
  • estimated_storage_cost (Number) The estimated storage cost of the backup
  • expires_at (String) When the backup expires
  • id (String) The ID of the backup
  • name (String) The name of the backup
  • protected (Boolean) Whether or not the backup is protected from deletion
  • pvc_size (Number) Size of the PVC used for the backup
  • size (Number) The size of the backup in bytes
  • started_at (String) When the backup started
  • state (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 resource
  • name (String) The name for the resource