How to move files from amazon ec2 to s3 bucket using command line

前端 未结 7 1232
予麋鹿
予麋鹿 2020-12-24 13:15

In my amazon EC2 instance, I have a folder named uploads. In this folder I have 1000 images. Now I want to copy all images to my new S3 bucket. How can I do thi

相关标签:
7条回答
  • 2020-12-24 14:02

    This can be done very simply. Follow the following steps:

    • Open the AWS EC2 on console.
    • Select the instance and navigate to actions.
    • Select instances settings and select Attach/Replace IAM Role
    • When this is done, connect to the AWS instance and the rest will be done via the following CLI commands:

    aws s3 cp filelocation/filename s3://bucketname

    Hence you don't need to install or do any extra efforts.

    Please note... the file location refers to the local address. And the bucketname is the name of your bucket. Also note: This is possible if your instance and S3 bucket are in the same account. Cheers.

    0 讨论(0)
提交回复
热议问题