iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔖

How to Check Cloudflare R2 Configuration Values

に公開

Explains the steps to check Cloudflare R2 configuration values.
(This is a memo with screenshots pasted from Claude chat.)

1. Create and Configure an R2 Bucket

From the Dashboard:

  1. Click "R2 Object Storage" in the left sidebar
  2. Create a bucket with "Create bucket"
  3. Enter the bucket name (this will be your CLOUDFLARE_R2_BUCKET_NAME)


    Bucket created successfully.

2. Confirm the Account ID

Method: R2 Settings Screen

  • You can check it on the R2 > Manage R2 API tokens screen.

3. Create an R2 API Token

  1. On the R2 screen, click "Manage R2 API tokens"
  2. Click "Create API token"

  3. Configure the following:
    • Token name: Any name you like
    • Permissions: Select "Object Read & Write"
    • TTL: Set as needed
  4. Click "Create API token"

Created token information:

(Image omitted below)

  • Access Key ID → CLOUDFLARE_R2_ACCESS_KEY
  • Secret Access Key → CLOUDFLARE_R2_SECRET_KEY

4. Endpoint URL

It will be in the following format:

https://[アカウントID].r2.cloudflarestorage.com

The account ID is the part in the dashboard URL:
https://dash.cloudflare.com/[アカウントID]/r2/overview

5. Configure a Public Domain (Optional)

Using a custom domain:

  1. On the bucket details screen, go to the "Custom Domains" tab
  2. Click "Connect Domain" to set up the domain
    (We will use a dev domain this time.)

Using the R2.dev domain:

  1. On the bucket details screen, go to the "Settings" tab

  2. Enable "Public access"
  3. The automatically generated URL will be displayed

This completes the retrieval of all necessary configuration values. The API token is displayed only once, so be sure to save it in a secure place.

Discussion