CopyObject Operation Error:
10/29/2024 03:02:11 PM, Error, "copy failed: s3://atestbucket2022saif/cli commands.txt to s3://s3sync-cross-account-destination/cli commands.txt An error occurred (AccessDenied) when calling the CopyObject operation: Access Denied"
ListObjectsV2 Operation Error:
10/29/2024 03:22:34 PM, Error, "fatal error: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied"
To resolve these errors, you need to modify the bucket policy to include access to the bucket’s objects. Update your bucket policy as follows:
Original Bucket Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789123:root"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::s3sync-cross-account-destination-with-kms"
]
}
]
}
Updated Bucket Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789123:root"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::s3sync-cross-account-destination-with-kms",
"arn:aws:s3:::s3sync-cross-account-destination-with-kms/*"
]
}
]
}
Access the S3 Console:
Navigate to the Bucket:
s3sync-cross-account-destination-with-kms
).Edit the Bucket Policy:
Save Changes:
By updating the bucket policy to include access to the bucket’s objects, you should be able to resolve the Access Denied errors and successfully perform S3 sync operations.
If you need further assistance, feel free to ask!