dcloud s3 bucket-cors setReplace the bucket’s CORS rules
The same rules `aws s3api put-bucket-cors` writes over the S3 API, for every bucket. The gateway answers browser preflights (OPTIONS) from them and adds Access-Control-* headers to matching responses, presigned URLs included. Example: --rules '{"allowedOrigins":["https://app.example.com"],"allowedMethods":["GET","PUT"],"allowedHeaders":["*"],"exposeHeaders":["ETag"],"maxAgeSeconds":3000}'
Synopsis
dcloud s3 bucket-cors set name --rules rulesArguments
<name>Requiredstring
Also accepted as
--name. Constraints: 3-63 chars, /^[a-z0-9][a-z0-9-]*[a-z0-9]$/
Flags
--rulesRequiredarray of json
The rules, replacing the current ones: { allowedOrigins, allowedMethods, allowedHeaders?, exposeHeaders?, maxAgeSeconds?, id? }; the first rule that matches a request applies
Example
dcloud s3 bucket-cors set name --rules '["example"]'Generated from the API description, the same one the API checks requests against and the CLI is built from.