S3:重命名对象失败,访问被拒绝

时间:2019-02-25 23:53:57

标签: amazon-web-services amazon-s3

我试图在s3中“重命名”一堆带前缀的对象,但是它一直给我<Access Denied>。我可以拿到物体,也可以放物体。我没有理由相信我不能只是一个一个地下载每个对象并使用新名称重新put_object,但我宁愿不要这样做。

aws s3 cp s3://$AWS_S3_BUCKET/1050/currency s3://$AWS_S3_BUCKET/1050/currency2-> copy failed: s3://XXXXXXXXXXXX/1050/currency to s3://XXXXXXXXXXX/1050/currency2 An error occurred (AccessDenied) when calling the CopyObject operation: Access Denied

使用mv命令时也会发生同样的情况。

是否有关于在相同存储桶中甚至不允许在相同前缀中进行复制的内容?这是我使用的角色的政策:

    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "autoscaling:Describe*",
                "cloudwatch:*",
                "logs:*",
                "sns:*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::XXXXXXXXXXXXX"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:GetObjectAcl",
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": "arn:aws:s3:::XXXXXXXXXXXXXX/*"
        }
    ]
}

1 个答案:

答案 0 :(得分:0)

您要复制的某些文件可能已应用标签。尝试在下面添加两个附加权限:

s3:GetObjectTagging

s3:PutObjectTagging