Necessary s3cmd S3 permissions for PUT/Sync

前端 未结 4 930
长发绾君心
长发绾君心 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:07

    In case you are giving access to a subfolder (as in the original answer of /bucket-name/path/) and not the entire bucket, the ListBucket action requires a bit more specificity:

    {
        "Sid": "AllowListingOfFilesInFolder",
        "Effect": "Allow",
        "Action": [
            "s3:ListBucket"
        ],
        "Resource": [
            "arn:aws:s3:::bucket-name"
        ],
        "Condition": {
            "StringLike": {
                "s3:prefix": [
                    "path/*"
                ]
            }
        }
    }
    

    I believe it works also with the original answer in case you provide access to the entire bucket.

提交回复
热议问题