dodil k3 bucket cors
S3 CORS configuration on a bucket — set, 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 stdinReads 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.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--file | -f | string | - | 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.jsonOr 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 jsondodil k3 bucket cors delete
dodil k3 bucket cors delete [name]Removes the CORS configuration from the bucket.
Example:
dodil k3 bucket cors delete kb-prodSee also
- CORS — API Reference —
PutBucketCors/GetBucketCors/DeleteBucketCors - Core Concepts → CORS — type signature
dodil k3 bucket·dodil k3 bucket policy·dodil k3 object·dodil k3 mount