Cloudflare R2 Bucket Configuration Guide
This guide explains how to set up a Cloudflare R2 bucket as a data source for RunReveal. The setup requires two components:
- An R2 storage bucket that RunReveal can read objects from
- A Cloudflare Workers Queue for event notifications
Note: You'll need both R2 credentials and a Cloudflare API key for this setup.
Prerequisites
1. Cloudflare Account ID
First, locate your Cloudflare Account ID from the R2 homepage:
2. Queue Identifier
Create a queue in the Cloudflare Workers Queues dashboard that will handle R2 object notifications. Make note of the queue ID:
Additionally, enable HTTP Pull for your queue so that RunReveal is able to read from your queue over HTTP. This is under Settings > Add Consumer
Authentication Setup
R2 Credentials
- Navigate to R2 > Manage R2 API Tokens
- Create a new R2 token with "Object Read Only" permissions
- Grant access to the bucket that RunReveal will read logs from
- Save the Access Key ID and Secret Access Key for use in the source setup later.
You must create R2 Access Keys from the R2 dashboard. Creating an API Token with the "Workers R2 Storage" scoped permissions will not give you the correct Access Key ID and Secret Access Key needed for compatability with S3 that RunReveal requires to ingest logs.
Cloudflare API Token
- Go to "Account API Tokens"
- Create a new token with Account > Queues > Edit permissions
Event Notification Configuration
To notify RunReveal when new data is available:
- Navigate to your R2 bucket > Settings > Event notifications
- Click "Add Notification"
- Select your Workers Queue
- Enable "Creation of a new object"
Creating Your Source
Provide RunReveal with the following information to begin reading data:
- Queue ID
- Cloudflare API Token
- R2 Credentials (Access Key ID and Secret Access Key)
- Cloudflare Account ID
RunReveal will automatically begin processing new data as it becomes available in R2.
Rate limits
Keep in mind that Cloudflare Workers Queues have ratelimits. These ratelimits are defined in Cloudflare's docs (opens in a new tab).
For most use cases this shouldn't be an issue. However, sharing Workers API keys between sources, or writing lots of small objects can cause these limits to be reached.