About Me

I have decades of experience is software development using .Net Technologies, PHP and wordpress. I love coding and discovering new tech.

Blog

How to enable Global CORS on AWS S3

AWS

How to enable Global CORS on AWS S3

Posted on August 8, 2022  - By Kaustav Halder - 0 Comments

Introduction

AWS S3 is the cloud storage service awailable on AWS. You can store almost any file on S3 and have the option to keep it private or publicly accessible. You can even store a static website on it and have it delivered to the world. But for this post, we are only looking at enabling CORS on your S3 bucket so it can be accessed globally from any domain,

Let’s Get To Business

Without further delay, let us quickly enable CORS on your AWS bucket. Follow the below steps
1. Navigate to AWS S3: Login to your AWS account and on the search type “S3”. There is the high change the S3 option will come first. Click on S3.
2. Navigate to “Permissions” Tab: 
3. Scroll down to CORS option:

 

 
4. Edit The Cors Details:  Click on the Edit option on the riht side of the Cors option.
5. In the large text area now enter the below JSON:
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]
6. Finale: That’s it. Now your S3 object should be accessible from any origin. Even javascript. Cheers!


About Kaustav

I have decades of experience is software development using .Net Technologies, PHP and wordpress. I love coding and discovering new tech.


0 Comments

Be the first to comment


Leave a reply

Leave a Reply

Your email address will not be published. Required fields are marked *