# ionoscloud\_pg\_backups\_v2

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/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 S3 location where the backup is stored.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/terraform-provider/data-sources/pg_backups_v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
