---
title: R2 Data Catalog
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/terraform)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# R2 Data Catalog

#### resource cloudflare\_r2\_data\_catalog

##### required Expand Collapse

account\_id: String

Use this to identify the account.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

bucket\_name: String

Specifies the R2 bucket name.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20bucket_name>)

##### computed Expand Collapse

id: String

Use this to uniquely identify the activated catalog.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

bucket: String

Specifies the associated R2 bucket name.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20bucket>)

credential\_status: String

Shows the credential configuration status.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20credential_status>)

name: String

Specifies the catalog name (generated from account and bucket name).

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

status: String

Indicates the status of the catalog.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20status>)

<details>

<summary>

maintenance\_config: Attributes

Configures maintenance for the catalog.

</summary>

<details>

<summary>

compaction: Attributes

Configures compaction for catalog maintenance.

</summary>

state: String

Specifies the state of maintenance operations.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction%20%3E%20(attribute)%20state">Link to this property</a>

target\_size\_mb: String

Sets the target file size for compaction in megabytes. Defaults to “128”.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction%20%3E%20(attribute)%20target_size_mb">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction">Link to this property</a>

interval: String

Scheduling interval between normal table maintenance runs.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20interval">Link to this property</a>

<details>

<summary>

snapshot\_expiration: Attributes

Configures snapshot expiration settings.

</summary>

max\_snapshot\_age: String

Specifies the maximum age for snapshots. The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: “7d” (7 days), “48h” (48 hours), “2880m” (2,880 minutes). Defaults to “7d”.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20max_snapshot_age">Link to this property</a>

min\_snapshots\_to\_keep: Int64

Specifies the minimum number of snapshots to retain. Defaults to 100.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20min_snapshots_to_keep">Link to this property</a>

state: String

Specifies the state of maintenance operations.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20state">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20maintenance_config>)

### cloudflare\_r2\_data\_catalog

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_r2_data_catalog" "example_r2_data_catalog" {
  account_id = "0123456789abcdef0123456789abcdef"
  bucket_name = "my-data-bucket"
}
```

#### data cloudflare\_r2\_data\_catalog

##### required Expand Collapse

bucket\_name: String

Specifies the R2 bucket name.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20bucket_name>)

account\_id: String

Use this to identify the account.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### computed Expand Collapse

id: String

Specifies the R2 bucket name.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

bucket: String

Specifies the associated R2 bucket name.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20bucket>)

credential\_status: String

Shows the credential configuration status.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20credential_status>)

name: String

Specifies the catalog name (generated from account and bucket name).

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

status: String

Indicates the status of the catalog.

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20status>)

<details>

<summary>

maintenance\_config: Attributes

Configures maintenance for the catalog.

</summary>

<details>

<summary>

compaction: Attributes

Configures compaction for catalog maintenance.

</summary>

state: String

Specifies the state of maintenance operations.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction%20%3E%20(attribute)%20state">Link to this property</a>

target\_size\_mb: String

Sets the target file size for compaction in megabytes. Defaults to “128”.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction%20%3E%20(attribute)%20target_size_mb">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20compaction">Link to this property</a>

interval: String

Scheduling interval between normal table maintenance runs.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20interval">Link to this property</a>

<details>

<summary>

snapshot\_expiration: Attributes

Configures snapshot expiration settings.

</summary>

max\_snapshot\_age: String

Specifies the maximum age for snapshots. The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: “7d” (7 days), “48h” (48 hours), “2880m” (2,880 minutes). Defaults to “7d”.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20max_snapshot_age">Link to this property</a>

min\_snapshots\_to\_keep: Int64

Specifies the minimum number of snapshots to retain. Defaults to 100.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20min_snapshots_to_keep">Link to this property</a>

state: String

Specifies the state of maintenance operations.

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration%20%3E%20(attribute)%20state">Link to this property</a>

</details>

<a href="#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config%20%3E%20(attribute)%20snapshot_expiration">Link to this property</a>

</details>

[Link to this property](<#(resource)%20r2_data_catalog%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20maintenance_config>)

### cloudflare\_r2\_data\_catalog

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_r2_data_catalog" "example_r2_data_catalog" {
  account_id = "0123456789abcdef0123456789abcdef"
  bucket_name = "my-data-bucket"
}
```