Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 920 Bytes

File metadata and controls

38 lines (23 loc) · 920 Bytes

S3 Cors

An AWS CLI tutorial that demonstrates S3 operations.

Running

bash s3-cors.sh

To auto-run with cleanup:

echo 'y' | bash s3-cors.sh

What it does

  1. Creating bucket"; aws s3api create-bucket --bucket "$B
  2. Setting CORS"; aws s3api put-bucket-cors --bucket "$B" --cors-configuration '{"CORSRules":[{"AllowedOrigins":["https://example.com"],"AllowedMethods":["GET","PUT"],"AllowedHeaders":["*"],"MaxAgeSeconds
  3. Getting CORS"; aws s3api get-bucket-cors --bucket "$B

Resources created

  • Bucket
  • Bucket Cors

The script prompts you to clean up resources when it finishes.

Cost

Free tier eligible for most operations. Clean up resources after use to avoid charges.

Related docs