S3 API Response Error while Applying Bucket Policy

0

I have created one Bucket and enabled versioning and Static Website Hosting but to host a static website I will have to make all the objects public So i applied the below mentioned Policy but while saving changes I am getting error "An Unexpected Error occured" stating that Action does not apply to any resource(s) in the statement ? Kidnly Help !!!!!

{ "Id": "Policy1661754296310", "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1661754292357", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Effect": "Allow", "Resource": "arn:aws:s3:::akshay-demo-new-2022/", "Principal": "" } ] }

已提問 2 年前檢視次數 956 次
2 個答案
1
已接受的答案

Try this one:

{
  "Id": "Policy1661758235544",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1661758233197",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::akshay-demo-new-2022/*",
      "Principal": "*"
    }
  ]
}

Added "*" in ARN and Principal.

profile pictureAWS
專家
kentrad
已回答 2 年前
profile pictureAWS
專家
Toni_S
已審閱 2 年前
0

That Worked !! Thanks @kentrad for your valuable help.

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南