Skip to Content
We are live but in Staging 🎉
Object StorageCLI Guidedodil k3 bucket cors

dodil k3 bucket cors

S3 CORS configuration on a bucketset, get, delete. Mirrors CORS — API Reference. See Core Concepts → CORS for the type signature.

dodil k3 bucket cors set

dodil k3 bucket cors set [name] -f FILE dodil k3 bucket cors set [name] -f - # read from stdin

Reads a JSON document (file or stdin) and applies it as the bucket’s CORS configuration via PutBucketCors. The JSON must match the BucketCorsConfiguration shape — a corsRules array, camelCase fields throughout.

FlagShortTypeDefaultDescription
--file-fstring-JSON file path, or - for stdin

Example — from a file:

cat > cors.json <<'EOF' { "corsRules": [ { "allowedOrigins": ["https://app.example.com"], "allowedMethods": ["GET", "PUT"], "allowedHeaders": ["*"], "exposeHeaders": ["ETag"], "maxAgeSeconds": 3600 } ] } EOF dodil k3 bucket cors set kb-prod -f cors.json

Or via stdin:

jq '.' cors.json | dodil k3 bucket cors set kb-prod -f -

dodil k3 bucket cors get

dodil k3 bucket cors get [name]

Returns the current BucketCorsConfiguration. Use --output json for machine-readable output suitable for round-trip editing.

Example:

dodil k3 bucket cors get kb-prod --output json

dodil k3 bucket cors delete

dodil k3 bucket cors delete [name]

Removes the CORS configuration from the bucket.

Example:

dodil k3 bucket cors delete kb-prod

See also