If you upload a file to S3, it becomes an object and is set as private by default on AWS. In our example I uploaded a JPG image to S3 using WinSCP (free of charge, Windows).
If you click on the object in S3, you get the information about it. If you then open this object in the browser via the URL of the object in a new tab, you will receive an error message: “Access denied.”
If you want to make a file publicly available on the Internet for everyone, you can do this relatively quickly with S3.
It's easy: Share Your S3 File Publicly
Step 1: Edit public access of your bucket
Step 2: Disable option to block public access
Step 3: Create a bucket policy (scroll down to copy the code)
Step 4: Check your settings
If you want to share the entire bucket publicly on the Internet, you can replace the file name 350937254.jpg with an asterisk “*”. The code required for step 3 is:
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::files-original/350937254.jpg"
}
]
}
About the Author
Michael Wutzke has more than 20 years of experience in IT. His focus is on the conception and development
of digital solutions on the Internet. Michael is currently working in finance in Frankfurt. More about the person
Tags: Amazon Web Services, AWS, bucket policies, enable public S3 access, S3, S3 make files public, S3 public access, simple storage service