Reputation: 1256
I am currently accessing the files that I create in an S3 bucket by using the S3 console (web interface)
Is there a way to download the contents of my S3 bucket to my local machine, without using the S3 console and without using access keys given that I have an IAM role assigned?
Thank you
EDIT:
I do have AWS CLI installed on an EC2 instance, and that has an IAM role assigned to it. The EC2 instance can't seem to "see" my local machine for me to be able to specify a path. So the cp
command doesn't work. Is there a way to copy files to my local machine?
I am new to this, so I apologize in advance if this is a really silly question.
Upvotes: 0
Views: 2028
Reputation: 270264
You can install and use the AWS Command-Line Interface (CLI).
It has commands such as aws s3 cp
that will copy a file to/from Amazon S3, and aws s3 sync
that can synchronize a whole folder by only copying new/changed files.
Running the AWS CLI requires a set of AWS credentials. When running the AWS CLI on your own computer, you will need credentials from an IAM User. You can store them by using the aws configure
command.
If you are running the AWS CLI on an Amazon EC2 instance, instead of providing credentials you can assign an IAM Role to the EC2 instance. This will provide it with credentials to access Amazon S3.
Upvotes: 2