To rename a file in a bucket, I copy the file to the new name and delete the old one. But when I was migrating from the old aws-sdk to the new S3-client, I now get a access denied on the copy object command. I have triple checked the permissions on the account accessing the objects and nothing seems wrong to me. I have tried applying all the permissions, but sadly with the same results. My permissions look like this:
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion",
"s3:GetObjectTagging",
"s3:PutObjectVersionTagging",
"s3:ListBucket",
"s3:PutObjectTagging",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::bucket/*",
"arn:aws:s3:::bucket"
]
The parameter I give to the command look like this
{
"Bucket": "bucket",
"CopySource": "pictures/1014/2.png",
"Key": "pictures/1014/1.png"
}
And the output of the command is a 403 AccesDenied. The same s3-client gets used to do normal puts and gets on the same bucket, no problem there. Thanks for helping.