Is there a way to configure an S3 bucket/folder/file so that it is not publicly accessible, yet a user-data script can authenticate and obtain access to items in S3?
Asked
Active
Viewed 466 times
1 Answers
5
You should be assigning an IAM Role to your EC2 instance that has access to the S3 bucket, and any other AWS resources that the EC2 server needs to access. Then when you use the AWS CLI tool or the AWS SDK it will automatically use the IAM role assigned to the instance.

Mark B
- 183,023
- 24
- 297
- 295
-
1completely agreed with Mark, you should definitely use IAM role for the EC2 instance – Palmer Feb 14 '17 at 22:43
-
Worked perfectly. Thanks guys. – smilingnewguy Mar 24 '17 at 20:30