Amazon S3 sync with local machine failed

I am new to AWS and I am trying to upload a bunch of files from my S3 bucket to my local machine using aws s3 sync , as described at http://docs.aws.amazon.com/cli/latest/reference/s3/sync. html I used the following command:

 aws s3 sync s3://outputbucket/files/ . 

The following error appeared: When the ListObjects operation was called, a client error (AccessDenied) occurred: Access Denied Part 1 completed with ... remaining files

Despite the fact that I configured my passkey identifier and secret passkey, as described in http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html

Where can the problem arise?

+6
source share
3 answers

Assuming you are an administrator and / or have set up your credentials correctly, it is possible that you are using the old AWS CLI.

I came across this when using the packed AWS CLI with Ubuntu 14.04.

The solution that worked for me was to remove the AWS CLI pre-packaged with Ubuntu and download it from python-pip:

 sudo apt-get remove awscli sudo apt-get install python-pip sudo pip install awscli 

Thanks a lot for this link: https://forums.aws.amazon.com/thread.jspa?threadID=173124

+6
source

To perform file synchronization, two sets of permissions are required:

  • ListObjects to get a list of files to copy
  • GetObjects for accessing objects

If you use your β€œroot” user, which comes with your AWS account, you will automatically receive these permissions.

If you are using a user created in Identity and Access Management (IAM), you will need to assign these permissions to the user. The easiest way is to assign an AmazonS3FullAccess policy that provides access to all S3 features.

+1
source

In my case, the credentials stored in ~/.aws/config were knocked down by a competing profile obtained in ~/.zshrc . Run env | grep AWS env | grep AWS to check.

+1
source

Source: https://habr.com/ru/post/983499/


All Articles