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

前端 未结 14 1351
醉话见心
醉话见心 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:45

    I encountered the same issue. My bucket was private and had KMS encryption. I was able to resolve this issue by putting in additional KMS permissions in the role. The following list is the bare minimum set of roles needed.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
            "Sid": "AllowAttachmentBucketWrite",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "kms:Decrypt",
                "s3:AbortMultipartUpload",
                "kms:Encrypt",
                "kms:GenerateDataKey"
            ],
            "Resource": [
                "arn:aws:s3:::bucket-name/*",
                "arn:aws:kms:kms-key-arn"
            ]
        }
      ]
    }
    

    Reference: https://aws.amazon.com/premiumsupport/knowledge-center/s3-large-file-encryption-kms-key/

提交回复
热议问题