Necessary s3cmd S3 permissions for PUT/Sync

前端 未结 4 888
长发绾君心
长发绾君心 2021-02-04 05:17

In moving to AWS EC2, I want to restrict my instances\' user permissions for good reason. One thing the instances need to do is access files on S3 and write files there. However

4条回答
  •  天涯浪人
    2021-02-04 06:06

    Try something like this. I think the problem is that you need s3:ListAllMyBuckets and s3:ListBuckets for the s3cmd to work. Not sure why but it wont work unless it can get a list of the buckets. I had the same problem the first time i tried to use permissions with s3cmd and this was the solution.

    {
      "Statement": [
        {
          "Action": [
            "s3:ListAllMyBuckets"
          ],
          "Effect": "Allow",
          "Resource": "arn:aws:s3:::*"
        },
        {
          "Action": [ 
              "s3:ListBucket", 
              "s3:PutObject",
              "s3:PutObjectAcl"
          ],
          "Effect": "Allow",
          "Resource": [
              "arn:aws:s3:::bucket/path", 
              "arn:aws:s3:::bucket/path/*"
          ]
        }
      ]
    }
    

    Edit I've added the s3:PutObjectAcl action which is required for newer versions of s3cmd as stated by Will Jessop below.

提交回复
热议问题