Skip to content

Commit 205ae0b

Browse files
committed
chore(docs): Improve S3 CORS guide
1 parent 02b421a commit 205ae0b

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

docs/docs/engines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DuckDB WASM allows you to query Lakekeeper directly from your browser. If you ar
2626
**Requirements:**
2727

2828
1. **Same-Origin Access**: The S3 endpoint must be accessible from your browser at the same URL/origin that Lakekeeper uses to access it. For example, if Lakekeeper accesses S3 at `http://my-s3-endpoint:9000`, your browser must also be able to reach it at `http://my-s3-endpoint:9000`. This means the Docker Compose examples won't work with DuckDB WASM out of the box, as the S3 endpoint is typically only accessible within the Docker network, while your browser is not in this network.
29-
2. **CORS Policy**: Your S3 storage must be configured with a CORS policy that allows requests from the Lakekeeper origin.
29+
2. **CORS Policy**: Your S3 storage must be configured with a CORS policy that allows requests from the Lakekeeper origin. See the [CORS Configuration guide](storage.md#cors-configuration) for setup instructions.
3030

3131
## <img src="/assets/duckdb.svg" width="30"> DuckDB
3232

docs/docs/storage.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,43 @@ We are now ready to create the Warehouse using the system identity:
278278

279279
The specified `assume-role-arn` is used for Lakekeeper's reads and writes of the object store. It is also used as a default for `sts-role-arn`, which is the role that is assumed when generating vended credentials for clients (with an attached policy for the accessed table).
280280

281+
##### CORS Configuration
282+
283+
For browser-based access to S3 buckets (required for [DuckDB WASM](engines.md#-duckdb-wasm)), you need to configure CORS (Cross-Origin Resource Sharing) on your S3 bucket.
284+
285+
To configure CORS for your S3 bucket:
286+
287+
3. In the AWS S3 Configuration Menu, klick on the name of your bucket
288+
4. Choose **Permissions** Tab
289+
5. In the **Cross-origin resource sharing (CORS)** section, choose **Edit**
290+
6. In the CORS configuration editor text box, type or copy and paste a new CORS configuration, or edit an existing configuration. The CORS configuration is a JSON file. The text that you type in the editor must be valid JSON. See below for an example.
291+
7. Choose **Save changes**
292+
293+
Example CORS policy:
294+
295+
```json
296+
[
297+
{
298+
"AllowedHeaders": [
299+
"*"
300+
],
301+
"AllowedMethods": [
302+
"GET",
303+
"POST",
304+
"PUT",
305+
"DELETE",
306+
"HEAD"
307+
],
308+
"AllowedOrigins": [
309+
"https://lakekeeper.example.com"
310+
],
311+
"ExposeHeaders": []
312+
}
313+
]
314+
```
315+
316+
Replace `https://lakekeeper.example.com` with the origin where your Lakekeeper instance is hosted.
317+
281318
##### STS Session Tags
282319
The optional `sts-session-tags` setting can be used to provide Session Tags when assuming roles via STS. Doing so requires that the IAM Role's Trust Relationship also allow `sts:TagSession`. Here's the above example with this addition:
283320

0 commit comments

Comments
 (0)