简体   繁体   中英

AWS S3 IAM role for Local setup

We are going to put the authentication for S3 bucket on a IAM role for the ec2 instance instead of using access keys. Can someone please help if this will be done, on an application level how can we add or assign an IAM role for local development? Since during development the project is not setup on an EC2 instance which will not have any IAM role in place. My first though would be using a.pem file to allow our local to access the s3 bucket with IAM authentication. Please kindly help if you have the same setup. Thanks:)

There is no need to put a.pem file to allow access the s3 bucket from your ec2 server. you need to do the following steps:

  • a) awsconsole -> IAM -> Access management -> Roles -> Create Role
  • b) Then select EC2 as trusted entity
  • c) type s3 in the filter policies text box
  • d) then choose a policy (for eg AmazonS3FullAccess)
  • e) next click tags and put a tagname to identify the role (for eg ec2-to-s3-full-access)
  • f) then click next and give a rule name (for eg Ec2ToS3FullAccessCustomRole)
  • g) Next; when you launch the ec2 instance; you have to attach this role

Any application running within your ec2 server will be have full access to s3 Now you may not want to grant blanket full access like how i mentioned above. but you can create a custom policy and and use that instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM