Make Amazon S3 Bucket Public Readable and Accessible
Amazon S3 is a web service offered by Amazon Web Services. Amazon S3 (Simple Storage Service) is object storage built to store and retrieve any amount of data, at any time, from anywhere on the web. We can use S3 to store and serve files, images, documents, and even we can use S3 buckets for hosting a web application. It allows users to store an infinite amount of data. By default, the files uploaded to S3 bucket are not publicly readable and accessible on the web.
Making files public using Amazon console is considered as an option if you have one or two files. But, it is not feasible when you have a huge number of files and data which is required to be served publicly over the web. We can cope up with this situation by creating a “Bucket policy”
We can make the s3 bucket object’s publicly readable and accessible by creating amazon bucket policy. Today we have come up with the brief description of s3 bucket policy and its usage.
Policy To Make S3 Bucket Publicly Readable and Accessible
{"Version": "2008-10-17", "Statement": [{"Sid": "AllowPublicRead", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*" }]}
Description Of Policy Created Above
Option | Description |
---|---|
Version | This is used to describe the version of the Access Policy Language that is currently being used in the policy. |
Statement | This is the section where we define the actual statement. Statement section is the core of policy. |
Sid | This is used for setting the name for this policy. The name of the policy should be clear enough. |
Effect | This contains two options, Allow and Deny and determines whether or not to permit the listed actions. |
Principal | This indicates the user or group permitted to or prevented from performing a particular action. For this policy, we are using a wildcard (*) symbol which allows access to all. |
Action | Actions are defined lists of operations that you can perform on objects and buckets. It is either a single action or an array of actions that are allowed/prohibited. |
Resource | This defines the name of the bucket or objects which are controlled by this policy. |
View Of Bucket Policy In Amazon Console
Hope this helps. More good kind of stuff to come. Post a comment if you have any queries. Stay tuned for future updates!
Normally I do not learn article on blogs, but I wish to say
that this write-up very compelled me to check out
and do so! Your writing taste has been amazed me. Thank you, quite nice post.