custom
Creates, updates, deletes, gets or lists a custom resource.
Overview
| Name | custom |
| Type | Resource |
| Id | cloudflare.r2.custom |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get Custom Domain Configuration response.
| Name | Datatype | Description |
|---|---|---|
ciphers | array | An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. |
domain | string | Domain name of the custom domain to be added. |
enabled | boolean | Whether this bucket is publicly accessible at the specified custom domain. |
minTLS | string | Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. (1.0, 1.1, 1.2, 1.3) |
status | object | |
zoneId | string | Zone ID of the custom domain resides in. |
zoneName | string | Zone that the custom domain resides in. |
List Custom Domains response.
| Name | Datatype | Description |
|---|---|---|
ciphers | array | An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format. |
domain | string | Domain name of the custom domain to be added. |
enabled | boolean | Whether this bucket is publicly accessible at the specified custom domain. |
minTLS | string | Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0. (1.0, 1.1, 1.2, 1.3) |
status | object | |
zoneId | string | Zone ID of the custom domain resides in. |
zoneName | string | Zone that the custom domain resides in. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, bucket_name, domain | cf-r2-jurisdiction | Get the configuration for a custom domain on an existing R2 bucket. |
list | select | account_id, bucket_name | cf-r2-jurisdiction | Gets a list of all custom domains registered with an existing R2 bucket. |
create | insert | account_id, bucket_name, domain, zoneId, enabled | cf-r2-jurisdiction | Register a new custom domain for an existing R2 bucket. |
update | replace | account_id, bucket_name, domain | cf-r2-jurisdiction | Edit the configuration for a custom domain on an existing R2 bucket. |
delete | delete | bucket_name, account_id, domain | cf-r2-jurisdiction | Remove custom domain registration from an existing R2 bucket. |
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. |
domain | string | |
cf-r2-jurisdiction | string |
SELECT examples
- get
- list
Get the configuration for a custom domain on an existing R2 bucket.
SELECT
ciphers,
domain,
enabled,
minTLS,
status,
zoneId,
zoneName
FROM cloudflare.r2.custom
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
AND domain = '{{ domain }}' -- required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction }}'
;
Gets a list of all custom domains registered with an existing R2 bucket.
SELECT
ciphers,
domain,
enabled,
minTLS,
status,
zoneId,
zoneName
FROM cloudflare.r2.custom
WHERE account_id = '{{ account_id }}' -- required
AND bucket_name = '{{ bucket_name }}' -- required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction }}'
;
INSERT examples
- create
- Manifest
Register a new custom domain for an existing R2 bucket.
INSERT INTO cloudflare.r2.custom (
ciphers,
domain,
enabled,
minTLS,
zoneId,
account_id,
bucket_name,
cf-r2-jurisdiction
)
SELECT
'{{ ciphers }}',
'{{ domain }}' /* required */,
{{ enabled }} /* required */,
'{{ minTLS }}',
'{{ zoneId }}' /* required */,
'{{ account_id }}',
'{{ bucket_name }}',
'{{ cf-r2-jurisdiction }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: custom
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the custom resource.
- name: bucket_name
value: "{{ bucket_name }}"
description: Required parameter for the custom resource.
- name: ciphers
value:
- "{{ ciphers }}"
description: |
An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.
- name: domain
value: "{{ domain }}"
description: |
Name of the custom domain to be added.
- name: enabled
value: {{ enabled }}
description: |
Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.
- name: minTLS
value: "{{ minTLS }}"
description: |
Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.
valid_values: ['1.0', '1.1', '1.2', '1.3']
- name: zoneId
value: "{{ zoneId }}"
description: |
Zone ID of the custom domain.
- name: cf-r2-jurisdiction
value: "{{ cf-r2-jurisdiction }}"
REPLACE examples
- update
Edit the configuration for a custom domain on an existing R2 bucket.
REPLACE cloudflare.r2.custom
SET
ciphers = '{{ ciphers }}',
enabled = {{ enabled }},
minTLS = '{{ minTLS }}'
WHERE
account_id = '{{ account_id }}' --required
AND bucket_name = '{{ bucket_name }}' --required
AND domain = '{{ domain }}' --required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction}}'
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Remove custom domain registration from an existing R2 bucket.
DELETE FROM cloudflare.r2.custom
WHERE bucket_name = '{{ bucket_name }}' --required
AND account_id = '{{ account_id }}' --required
AND domain = '{{ domain }}' --required
AND cf-r2-jurisdiction = '{{ cf-r2-jurisdiction }}'
;