Skip to main content

managed

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

Overview

Namemanaged
TypeResource
Idcloudflare.r2.managed

Fields

The following fields are returned by SELECT queries:

Get Managed Subdomain response.

NameDatatypeDescription
bucketIdstringBucket ID.
domainstringDomain name of the bucket's r2.dev domain.
enabledbooleanWhether this bucket is publicly accessible at the r2.dev domain.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, bucket_namecf-r2-jurisdictionGets state of public access over the bucket's R2-managed (r2.dev) domain.
updatereplaceaccount_id, bucket_name, enabledcf-r2-jurisdictionUpdates state of public access over the bucket's R2-managed (r2.dev) domain.

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.
cf-r2-jurisdictionstring

SELECT examples

Gets state of public access over the bucket's R2-managed (r2.dev) domain.

SELECT
bucketId,
domain,
enabled
FROM cloudflare.r2.managed
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction }}'
;

REPLACE examples

Updates state of public access over the bucket's R2-managed (r2.dev) domain.

REPLACE cloudflare.r2.managed
SET
enabled = {{ enabled }}
WHERE
account_id = '{{ account_id }}' --required
AND bucket_name = '{{ bucket_name }}' --required
AND enabled = {{ enabled }} --required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction}}'
RETURNING
errors,
messages,
result,
success;