We are trying to copy a file using the CLI for AWS to an S3 bucket.
aws s3 cp e:\myfolder\2020\11\15 s3://xmode-data-exports/XXXXX/2020/11/15 --recursive --include *
We are getting an error message: An error occurred (AccessDenied) when calling the GetObjectTagging operation: Access Denied
We have a policy on the bucket:
{
"Version": "2012-10-17",
"Id": "PolicyXXX",
"Statement": [
{
"Sid": "StmtXXXX",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::XXXXX:user/transfer2"
},
"Action": [
"s3:GetObject",
"s3:Get*",
"s3:List*",
"s3:ObjectOwnerOverrideToBucketOwner",
"s3:PutObject",
"s3:GetObjectTagging",
"s3:PutObjectTagging",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::bucket",
"arn:aws:s3:::bucket/*"
]
}
]
}
Any ideas? These permissions are going to be the death of me.
Check the IAM policy attached to the transfer2 user. (Ensure transfer2 user has sufficient right for above actions. If you are not sure, assign S3 admin access and test)