AngularJS app in AWS S3. What should be correct policies?

I need to quickly deploy a static angular app to AWS S3. Unfortunately, I am still new to id so I would like to ask your help on:

  1. What should be the bucket policy?
  2. What roles should I give a user group to access it?

Requirements:

  1. App deployed in the S3 bucket is public
  2. Bucket contents should only accessible by those part of a user group. The users of the group should only be able to upload and get files in the bucket. Nothing more nothing less.
  3. Another user group as administrators of the bucket.

Thanks. Any help would be appreciated.

Upvotes: 0

Views: 214

Answers (1)

jscott
jscott

Reputation: 1051

Have you read Hosting a static website using S3? That should answer your question about bucket policy.

IAM users will need the appropriate S3 permissions on the bucket. This is an example of a read-write policy; remove the s3:PutObject and s3:DeleteObject permissions for read-only access.

As luk2302 pointed out, if you want to publish the S3 URL as your website URL, then the bucket contents must be publicly readable. If you want to publish the app using a custom domain name and/or use HTTPS, you should consider adding a CloudFront distribution. Doing so would also allow you to keep the bucket contents private so only your IAM users have direct access to the bucket.

Upvotes: 1

Related Questions