Getting Access Denied when calling the PutObject operation with bucket-level permission

前端 未结 14 1322
醉话见心
醉话见心 2020-12-12 13:37

I followed the example on http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_examples.html#iam-policy-example-s3 for how to grant a user access to just one buck

14条回答
  •  天涯浪人
    2020-12-12 13:48

    I was having a similar problem. I was not using the ACL stuff, so I didn't need s3:PutObjectAcl.

    In my case, I was doing (in Serverless Framework YML):

    - Effect: Allow
      Action:
        - s3:PutObject
      Resource: "arn:aws:s3:::MyBucketName"
    

    Instead of:

    - Effect: Allow
      Action:
        - s3:PutObject
      Resource: "arn:aws:s3:::MyBucketName/*"
    

    Which adds a /* to the end of the bucket ARN.

    Hope this helps.

提交回复
热议问题