Skip to content

Instantly share code, notes, and snippets.

@ericwastaken
Last active November 7, 2020 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericwastaken/f7adf1b3c40581060740f46f6edcec11 to your computer and use it in GitHub Desktop.
Save ericwastaken/f7adf1b3c40581060740f46f6edcec11 to your computer and use it in GitHub Desktop.
How to create an S3 Bucket with Programmatic Access

How to create an S3 Bucket with Programmatic Access

Summary

This post explains how to create an AWS S3 Bucket and an IAM User with programmatic access to the bucket.

You will need access to the AWS S3 console for your account and have permissions to create new buckets and create new IAM users.

This is based on:

License

This content is shared under a Creative Commons Attribution-ShareAlike 4.0 International.

Create an S3 Bucket

On the AWS S3 console, create a new bucket, making sure to note the name. Also, be sure to secure the bucket (allowing no public access). Also, the bucket should be created in the a region of your convenience (closest to your use is likely best.)

From the AWS S3 Console, select S3. Once on the S3 interface, follow the on-screen menus to create a new bucket.

Create an IAM User and give the user access

On the AWS S3 console, create a new user.

  • Give the user "programmatic" access.

  • When prompted or a security policy, create a new one with the following:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "s3:*",
          "Resource": [
            "arn:aws:s3:::your-bucket-name-here/*",
            "arn:aws:s3:::your-bucket-name-here"
          ]
        }
      ]
    }
  • Be sure to attach the new policy to the new user!

  • Once the user is created, take note of the Access Key Id and Secret Access Key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment