How to Enable CORS on S3 Bucket?
Learn how to Enable CORS on S3 Bucket. Simple Snippet to Paste and Get Started. CORS in S3 Buckets JSON Array.
I was struggling to get a document to be accessible via my JS request. It was giving me a Cross Origin error so I found an article on how to enable it on AWS.
- Log into the AWS Management Console
- Click on Services and select S3
- Select the desired bucket
- In the right-hand panel, click Permissions.
- Click Edit CORS Configuration
- in the pop-up dialog, paste the following text:
[
{
"AllowedOrigins": [
"*"
],
"AllowedMethods": [
"GET"
],
"MaxAgeSeconds": 3000,
"ExposeHeaders": [
"Content-Range",
"Content-Length",
"ETag"
],
"AllowedHeaders": [
"Authorization",
"Content-Range",
"Accept",
"Content-Type",
"Origin",
"Range"
]
}
]