In this article we talk about how to create an S3 bucket and credentials that allow only write access to only this bucket.

You might want to use it for Postgres backups

  1. Go to AWS interface for S3 service: https://s3.console.aws.amazon.com/s3/buckets?region=eu-central-1
  2. Create a bucket https://s3.console.aws.amazon.com/s3/bucket/create?region=eu-central-1
  3. Give bucket, pick a region, ACL disabled: AWS console: Create a bucket
  4. Scroll down and click the "Create bucket" button.
  5. On the top right of the screen find your username, click on it to open a dropdown and open the link "Security Credentials" https://us-east-1.console.aws.amazon.com/iam/home?region=eu-central-1#security_credential
  6. Click on "Policies" in the left sidebar AWS console: On the top right of the screen find your username, click on it to open a dropdown an...
  7. Click on the "Create policy" button AWS console: Click on "Policies" in the left sidebar
  8. Open JSON tab. and paste this JSON into the field, replace mywriteonlybucket with your bucket name:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::mywriteonlybucket/*"
    }
  ]
}

AWS console: Now click on "Next: Tags"

Now click on "Next: Tags", then "Next: Review"

Give this policy a name ad click the "Create policy" button AWS console: name the policy and click Create policy 9. Now go to Users sectionAWS console: the created policy in the policy list 10. Click on the "Add users" buttonAWS console: Now go to Users section 11. Give your new user a name, leave "Provide user access to AWS Management Console" unchecked and click "Next"AWS console: Click on the "Add users" button 12. Pick "Attach policies directly"AWS console: Give your new user a name, leave "Provide user access to AWS Management Console" unc... 13. Find the policy that we created earlier and check it in the list, click next AWS console: Pick "Attach policies directly" 14. Click the "Create user" button AWS console: Find the policy that we created earlier and check it in the list, click next 15. You will be taken to the list of all users. Find your new user, click on it. 16. Click on the tab "Security credentials"AWS IAM console: list of users with the new user 17. Click "Create access key" AWS console: Click on the tab "Security credentials" 18. Pick "Command Like Interface (CLI)", check that you understand their recommendations and click "Next"AWS console: Click "Create access key" 19. Click the button "Create access key".

Grab your keys and save them safely and don't let anyone get their hands on your keys! AWS console: Click the button "Create access key"