- Create R2 tokens from the r2 Overview page. “Manage r2 API Tokens” -> “Create API Token”
- Copy the access key id and secret access key values
- Copy the endpoint url. It’s of the form
<cloudflare_account_id>.r2.cloudflarestorage.com
. Cloudflare account id is present in the url bar too when you are accessing the cloudflare dashboard and is also displayed in overview page of r2 - ~/.aws/config:
[profile cloudflare] endpoint_url = https://<cloudlare_account_id>.r2.cloudflarestorage.com
- ~/.aws/credentials
[cloudflare] aws_access_key_id = <> aws_secret_access_key = <>
- test with:
aws s3 ls