I was getting the error A client error (403) occurred when calling the HeadObject operation: Forbidden
for my aws cli copy command aws s3 cp s3://bucket/file file
. I was using a IAM role which had full S3 access using an Inline Policy
.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}
]
}
If I give it the full S3 access from the Managed Policies
instead, then the command works. I think this must be a bug from Amazon, because the policies in both cases were exactly the same.