Sergey Terehin
Sergey Terehin

Reputation: 163

Storing uploaded files on S3

I'm developing web application. I want to add the ability for my clients to upload files (pdf, images, spreadsheets etc). Which solution for storing files is better - S3 or block storage? S3 seems to be much cheaper. Is it convenient to store uploads on S3 and work with them programmatically (upload, download)? Or this type of storage is for some other use cases? Each client should have access only to their files.

Upvotes: 0

Views: 82

Answers (1)

Varun Chandak
Varun Chandak

Reputation: 971

  1. Create a unique bucket.
  2. Create IAM Users for clients using the S3 to upload/download
  3. Create folders inside the bucket with the same name as IAM users.
  4. Create a IAM group and add IAM users in that group.
  5. Add an explicit deny on all the rest of the buckets/folders.
  6. Create a custom policy to: ListAllBuckets and allow access to <bucketname>/{aws:username} folders, where {aws:username} is a variable in IAM policy.

Rest is up to you on how to write the IAM policies.

Upvotes: 1

Related Questions