'Is there an easy way to access s3 via ec2 from local machine?

I want to transfer files from s3 bucket to local, but for some reason I don't have the flexibility to generate credentials for direct access. Instead I have access to an EC2 instance that has access to the s3 bucket. Currently what i did is

  1. transfer files from s3 to ec2
  2. transfer files from ec2 to local

Is there an easier way to transfer files in this situation? for example, use the ec2 as an tunnel to direct transfer files to local without transferring to the ec2 instances.



Solution 1:[1]

I don’t know if I understood … did you try create an access key and a profile from local machine?

1 - $aws iam create-access-key --user-name

2 - $aws configure --profile tocopy

3 - $aws s3 cp s3://bucket-name/filename.txt ./ —-profile tocopy

Ps: tocopy is any string to named your profile.

If these steps doesn’t work, you need see ACL, Policy or others access control on your bucket. ;-) Tip: on your user apply an policy with get and list to your bucket.

Ps: if you need copy many times, I should you use: $aws s3 syn s3://bucket-name/filename.txt ./ —-profile tocopy

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1