> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/tools-terraform/docs/data-sources/pg_backups_v2.md).

# ionoscloud\_pg\_backups\_v2

Get information on DBaaS PostgreSQL v2 Backups

The **DBaaS PostgreSQL v2 Backups data source** can be used to list existing DBaaS PostgreSQL v2 Backups. An optional cluster ID filter can be used to narrow down results to backups of a specific cluster.

## Example Usage

### List all backups in a location

```hcl
data "ionoscloud_pg_backups_v2" "example" {
  location = "de/txl"
}
```

### List backups for a specific cluster

```hcl
data "ionoscloud_pg_backups_v2" "example" {
  location   = "de/txl"
  cluster_id = "cluster_id"
}
```

## Argument Reference

* `location` - (Required)\[string] The region in which to look up backups. Available locations: `de/fra`, `de/fra/1`, `de/fra/2`, `de/txl`, `es/vit`, `fr/par`, `gb/bhx`, `gb/lhr`, `us/ewr`, `us/las`, `us/mci`.
* `cluster_id` - (Optional)\[string] The ID (UUID) of the cluster to filter backups by.

## Attributes Reference

The following attributes are returned by the datasource:

* `backups` - The list of backups. Each backup has the following attributes:
  * `id` - The ID (UUID) of the backup.
  * `cluster_id` - The ID (UUID) of the cluster the backup belongs to.
  * `postgres_cluster_version` - The PostgreSQL version of the cluster when the backup was created.
  * `is_active` - Whether the backup is active.
  * `earliest_recovery_target_time` - The earliest point in time to which the cluster can be restored.
  * `latest_recovery_target_time` - The latest point in time to which the cluster can be restored. If the backup can be restored up to the current time, this field will be null.
  * `location` - The Object Storage location where the backup is stored.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/tools-terraform/docs/data-sources/pg_backups_v2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
