AWS S3 Bucket Access from EC2

后端 未结 3 1105
情深已故
情深已故 2020-12-01 11:25

I need to fire up an S3 bucket so my EC2 instances have access to store image files to it. The EC2 instances need read/write permissions. I do not want to make the S3 bucket

3条回答
  •  失恋的感觉
    2020-12-01 11:46

    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
    • Create a new role and attach S3FullAccess policy to that 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

    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.

提交回复
热议问题