Skip to content

Commit 28d5fd1

Browse files
[DLS] Adds instructions to send logs to an EU R2 bucket via an S3-Compatible endpoint (#18267)
* Adds instructions to set up a Logpush using an S3-Compatible endpoint to store logs in an R2 bucket with EU jurisdiction. * Apply suggestions from code review Co-authored-by: Jun Lee <[email protected]> --------- Co-authored-by: Jun Lee <[email protected]>
1 parent 3ef7dd9 commit 28d5fd1

File tree

1 file changed

+71
-0
lines changed
  • src/content/docs/data-localization/how-to

1 file changed

+71
-0
lines changed

src/content/docs/data-localization/how-to/r2.mdx

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar:
66

77
---
88

9+
import { Details } from "~/components"
10+
911
In the following sections, we will give you some details about how to configure R2 with Regional Services and Customer Metadata Boundary.
1012

1113
## Regional Services
@@ -20,6 +22,75 @@ To configure Regional Services for hostnames [proxied](/dns/manage-dns-records/r
2022

2123
Regional Services only applies to the custom domain configured for an R2 Bucket.
2224

25+
### Send logs to an EU R2 bucket via an S3-compatible endpoint
26+
27+
The following instructions will show you how to set up a Logpush job using an S3-compatible endpoint to store logs in an R2 bucket with EU jurisdiction.
28+
29+
1. Create an [R2 bucket](/r2/get-started/) in your Cloudflare account and set EU as the jurisdiction.
30+
31+
2. Generate an API token for your R2 bucket. You have the following two options:
32+
33+
<Details header="Generate a token for a specific bucket (recommended)">
34+
35+
Go to the R2 section of your Cloudflare dashboard and select **Manage R2 API Tokens** to generate a token directly tied to your specific bucket. You can follow the instructions in the [Authentication](/r2/api/s3/tokens/) section.
36+
37+
</Details>
38+
39+
<Details header="Generate a token for all buckets">
40+
41+
You can generate a API token in **Manage Account** > **Account API Tokens** or you can create a user-specific token:
42+
43+
1. Go to **My Profile** > **API Tokens**
44+
2. Select **Create Token** > **Create Custom Token**
45+
3. Choose **Account** > **Workers R2 Storage** > **Edit** to set permissions.
46+
4. To test your token, copy the `curl` command and paste it into a terminal.
47+
48+
```bash
49+
curl "https://api.cloudflare.com/client/v4/user/tokens/verify" \
50+
--header "Authorization: Bearer <API_TOKEN>"
51+
```
52+
53+
The result:
54+
55+
```json
56+
{
57+
"result": {
58+
"id": "325xxxxcd",
59+
"status": "active"
60+
},
61+
"success": true,
62+
"errors": [],
63+
"messages": [
64+
{
65+
"code": 10000,
66+
"message": "This API Token is valid and active",
67+
"type": null
68+
}
69+
]
70+
}
71+
```
72+
73+
5. Generate a SHA-256 hash of the token:
74+
75+
```bash
76+
echo -n "<token>" | shasum -a 256
77+
```
78+
79+
This command will output a hash similar to `dxxxx391b`.
80+
81+
</Details>
82+
83+
3. Set up a Logpush destination using [S3-compatible endpoint](/logs/get-started/enable-destinations/s3-compatible-endpoints/) and fill in the required fields as follows:
84+
85+
- **Bucket**: Enter the name of the R2 bucket you created with the EU jurisdiction.
86+
- **Path** (optional): If you want, you can specify a folder path to organize your logs.
87+
- **Endpoint URL**: Provide the S3 API endpoint for your bucket in the format `<account-id>.eu.r2.cloudflarestorage.com`. Do not include the bucket name, as it was set in the first field.
88+
- **Bucket Region**: Use `WEUR` to specify the EU region.
89+
- **Access Key ID**: Enter the Token ID created previously (`325xxxxcd`).
90+
- **Secret Access Key**: Use the SHA-256 hash of the token (`dxxxx391b`).
91+
92+
Complete the configuration by selecting the fields you want to push to your R2 bucket.
93+
2394
## Customer Metadata Boundary
2495

2596
With Customer Metadata Boundary set to `EU`, **R2** > **Bucket** > [**Metrics**](/r2/platform/metrics-analytics/) tab in the account dashboard will be populated.

0 commit comments

Comments
 (0)