r2_catalog
Creates, updates, deletes, gets or lists a r2_catalog resource.
Overview
| Name | r2_catalog |
| Type | Resource |
| Id | cloudflare.r2_data_catalog.r2_catalog |
Fields
The following fields are returned by SELECT queries:
- get
- list
R2 catalog details.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Use this to uniquely identify the catalog. (example: 550e8400-e29b-41d4-a716-446655440000) |
name | string | Specifies the catalog name (generated from account and bucket name). (example: account123_my-bucket) |
bucket | string | Specifies the associated R2 bucket name. (example: my-data-bucket) |
credential_status | string | Shows the credential configuration status. (present, absent) (example: present) |
maintenance_config | object | Configures maintenance for the catalog. |
status | string | Indicates the status of the catalog. (active, inactive) (example: active) |
List of R2 catalogs.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Use this to uniquely identify the catalog. (example: 550e8400-e29b-41d4-a716-446655440000) |
name | string | Specifies the catalog name (generated from account and bucket name). (example: account123_my-bucket) |
bucket | string | Specifies the associated R2 bucket name. (example: my-data-bucket) |
credential_status | string | Shows the credential configuration status. (present, absent) (example: present) |
maintenance_config | object | Configures maintenance for the catalog. |
status | string | Indicates the status of the catalog. (active, inactive) (example: active) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, bucket_name | Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status. | |
list | select | account_id | Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files. | |
create_credential | exec | account_id, bucket_name, token | Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations. | |
disable | exec | account_id, bucket_name | Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later. | |
enable | exec | account_id, bucket_name | Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
bucket_name | string | The R2 bucket name. |
SELECT examples
- get
- list
Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.
SELECT
id,
name,
bucket,
credential_status,
maintenance_config,
status
FROM cloudflare.r2_data_catalog.r2_catalog
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
;
Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.
SELECT
id,
name,
bucket,
credential_status,
maintenance_config,
status
FROM cloudflare.r2_data_catalog.r2_catalog
WHERE account_id = '{{ account_id }}' -- required
;
Lifecycle Methods
- create_credential
- disable
- enable
Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.
EXEC cloudflare.r2_data_catalog.r2_catalog.create_credential
@account_id='{{ account_id }}' --required,
@bucket_name='{{ bucket_name }}' --required
@@json=
'{
"token": "{{ token }}"
}'
;
Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.
EXEC cloudflare.r2_data_catalog.r2_catalog.disable
@account_id='{{ account_id }}' --required,
@bucket_name='{{ bucket_name }}' --required
;
Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.
EXEC cloudflare.r2_data_catalog.r2_catalog.enable
@account_id='{{ account_id }}' --required,
@bucket_name='{{ bucket_name }}' --required
;