Skip to main content

r2_catalog

Creates, updates, deletes, gets or lists a r2_catalog resource.

Overview

Namer2_catalog
TypeResource
Idcloudflare.r2_data_catalog.r2_catalog

Fields

The following fields are returned by SELECT queries:

R2 catalog details.

NameDatatypeDescription
idstring (uuid)Use this to uniquely identify the catalog. (example: 550e8400-e29b-41d4-a716-446655440000)
namestringSpecifies the catalog name (generated from account and bucket name). (example: account123_my-bucket)
bucketstringSpecifies the associated R2 bucket name. (example: my-data-bucket)
credential_statusstringShows the credential configuration status. (present, absent) (example: present)
maintenance_configobjectConfigures maintenance for the catalog.
statusstringIndicates the status of the catalog. (active, inactive) (example: active)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, bucket_nameRetrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.
listselectaccount_idReturns 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_credentialexecaccount_id, bucket_name, tokenStore authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.
disableexecaccount_id, bucket_nameDisable 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.
enableexecaccount_id, bucket_nameEnable 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
bucket_namestringThe R2 bucket name.

SELECT examples

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
;

Lifecycle Methods

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 }}"
}'
;