Giving S3 access to EC2 Servers

0 votes
I have developed a photo sharing application and would like to deploy it on EC2. The application would be putting and getting the images from S3 as it is very scalable and reliable. But, the application on EC2 is not able to interact with S3 to store and get the images. How do I provide the permissions to EC2 to interact with S3 or any other services?
Jul 30, 2019 in AWS by jimmy_longmann
• 930 points
872 views

1 answer to this question.

0 votes

This can be done using IAM roles. IAM roles are attached to the AWS resources like EC2, Lambda, RedShift to give the proper permissions. Here are the sequence of steps for the same.

  • Create a policy to give Read and Write Permissions to a specific S3 Bucket or use the existing AmazonS3FullAccess policy.
  • Create an IAM role and attach the one of the above policies.
  • Attach the role to the EC2 instance.

Depending upon the policy attached to the role, the EC2 would be getting the appropriate permissions. In this case, the application running on EC2 would be able to upload/ download the images from S3.

answered Jul 30, 2019 by Praveen
• 700 points

Related Questions In AWS

0 votes
1 answer
0 votes
2 answers

How to access files in S3 bucket from R?

You can take a look at the ...READ MORE

answered Aug 10, 2018 in AWS by Deepthi
• 300 points
6,633 views
0 votes
1 answer
0 votes
1 answer

how to access AWS S3 from Lambda in VPC

With boto3, the S3 urls are virtual by default, ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 58,020 points
10,150 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
6,012 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP