In the past few weeks, we at Firmhouse are starting to make all our apps 12factor compliant. One thing that we needed to tackle was where to store our user uploads.
We decided that the best place is Amazon S3, because the disk space is extremely cheap, and they are very reliable.
The downside of this is that we have to set up an S3 bucket for all our apps, and one thing we learned, S3 is awesome, but the policies are awful!
In this article, I want to show you how you can quickly setup an S3 bucket with a proper IAM user and policy!
1. Create IAM User
2. Create your S3 bucket
3. Generate the Bucket policy
Since creating the policies is the biggest problem in this endeavour, I created a simple app for you to generate your policies: s3bucketpolicy.com.
For this, you need to have the Users ARN, which you can find by going to the IAM user, it's on the given user overview page.
4. Add the policy to your bucket
You've just created an S3 bucket with a secure policy! It can be that simple.