问题
I'm trying to make my S3 bucket public but when I add the following policy I get Error Access Denied:
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"AddPerm",
"Effect":"Allow",
"Principal":"*",
"Action":[
"s3:GetObject"
],
"Resource":[
"arn:aws:s3:::emergencydatascience.org/*"
]
}]
}
回答1:
Go in to your Bucket > Permissions > Public access settings > Edit > Untick Block new public ACLs and uploading public objects and Remove public access granted through public ACLs (warning)
回答2:
AWS has introduced Amazon S3 Block Public Access – Another Layer of Protection for Your Accounts and Buckets | AWS News Blog.
You must now disable this feature on any buckets you wish to be publicly accessible.
回答3:
To enable public access to an object, Modify the public access for the account such as
Also enable the same at the bucket level as well
Without these changes, you cannot add new public policy.
回答4:
While AWS policy is quite dynamic please be aware that below answer works for the date when I provide it and it can change in time. What is required to CREATE new bucket with public access policy is to change account level "Block public access" configuration to following: enter image description here
Once this change is done, next the regular settings on the Bucket level need to be performed as well - adding policy and change bucket level "Block public access" (in the same way as it was done on account level).
来源:https://stackoverflow.com/questions/53346275/amazon-s3-bucket-policy-public-access-denied