s3 Policy has invalid action - s3:ListAllMyBuckets

后端 未结 4 836
故里飘歌
故里飘歌 2021-01-01 17:45

I\'m trying these policy through console.aws.amazon.com on my buckets:


    {
      \"Statement\": [
        {
          \"Effect\": \"Allow\",
          \"Action\         


        
相关标签:
4条回答
  • 2021-01-01 18:09

    Anyone getting same issue:

    S3 bucket Policy Actions are different from IAM policy actions. Can reference to s3 actions from https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html.

    Or try with the following actions

    "Action": [
            "s3:DeleteObject",
            "s3:GetObject",
            "s3:PutObject"
          ], 
    
    0 讨论(0)
  • 2021-01-01 18:12

    I figured out myself. It needs to be done in the IAM, not in S3 itself...

    0 讨论(0)
  • 2021-01-01 18:18

    @dnlbrky You need to do this by setting the policy on for the IAM user/group/role and set it by either using the AWS console for the IAM user/group or by calling put_[role/user/group]_policy boto API call.

    0 讨论(0)
  • 2021-01-01 18:28

    As zdev mentioned, you need to do this for the IAM. Go to the IAM console and navigate to Users > Permissions > Inline policies > Create > Custom, and enter this:

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "s3:ListAllMyBuckets"
                ],
                "Resource": [
                    "arn:aws:s3:::*"
                ]
            }
        ]
    }
    
    0 讨论(0)
提交回复
热议问题