I recently wanted to upload a Techno mix that I wanted to share with a local DJ friend. As expected after allowing public access in the initial bucket provisioning step, I came up with an access-denied when accessing it via URL.
Here is the resulting policy I created directly within the bucket permissions tab to give public access to the file I uploaded.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::housentechnomixes/*"
}
]
}
"Version"
"Version": "2012-10-17"
2012-10-17
) indicates the current version of the AWS policy language. Using the correct version ensures compatibility with AWS's features and services."Statement"
"Statement": [
{
...
}
]
"Sid"
(Statement ID)"Sid": "PublicReadGetObject"