Save a Cloudflare R2 bucket
Connect a Cloudflare R2 bucket to Konnekt so scheduler blocks can upload to it.
- Duration
- ~10 min
- Requirements
- A Cloudflare account with R2
- Topics
- Destinations
Before you start
- A Cloudflare account with R2Cloudflare issues an R2 token only after R2 is purchased on the account.
- A public address for the bucketOnly snapshot links need it. Step 04 adds it.
Create the bucket
- In the Cloudflare dashboard, open R2 object storage.
- Select Create bucket, name it, then select Create bucket again.
- Open the bucket's Settings tab and find S3 API.
The endpoint is
https://<account id>.r2.cloudflarestorage.com.
A bucket in a jurisdiction uses a host such as
<account id>.eu.r2.cloudflarestorage.com.
Konnekt takes the host only, so leave off anything after it.
Create an API token
- On the R2 overview, under Account Details, select Manage next to API Tokens.
- Select Create Account API token or Create User API token.
- Under Permissions, choose Object Read and Write.
- Scope the token to the bucket from step 01.
- Create the token, then copy the Access Key ID and the Secret Access Key.
Konnekt lists, reads, writes and deletes objects in the bucket.
A token that only reads cannot upload.
Add the destination
- Open Settings, then Destinations.
- Select Add destination.
- Fill in the fields.
- Select Test, then Save.
| Field | Value |
|---|---|
| Name | Any name: scheduler blocks pick the bucket by it. |
| Endpoint | The host from step 01. |
| Region | auto. |
| Bucket | The bucket's name. |
| Prefix | A folder for Konnekt's objects, or blank. |
| Public base URL | Blank until step 04. |
| Access key ID | The Access Key ID from step 02. |
| Secret access key | The Secret Access Key from step 02. |
Test writes nothing to the bucket.
Each field is described on
Destinations.
Add a public address
A snapshot link is the Public base URL followed by the object's key.
Without one, the link points at the bucket's own S3 address.
That address opens only for a bucket that serves objects publicly.
| Address | Steps in the bucket's Settings |
|---|---|
| Custom domain | Under Custom Domains, select Add, enter a domain on a zone in the same account, select Continue, then Connect Domain. Wait for Active. |
r2.dev |
Under Public Development URL, select Enable, type
allow, then select Allow. Cloudflare rate-limits it and
intends it for non-production use.
|
- In Settings, Destinations, select Edit on the destination.
-
Enter the address in Public base URL, such as
https://files.example.com. - Select Save.
Only snapshot links use it, and Upload to Bucket does not.
When it refuses
| Error | Do |
|---|---|
| the bucket refused the upload (status code): check the destination's access key and secret, and that the key may write to the bucket | Create the token again with Object Read and Write on this bucket. Test writes nothing, so it does not show whether a token can write. |
| public base URL must be an http(s) address | Start Public base URL with https://. |