Create an S3 bucket using AWS CLI

To create a bucket, you must register an account on Amazon Web Services and have a valid AWS Access Key ID to authenticate requests.

Creating an S3 bucket can be accomplished in several ways:

  • My Choice – Install AWS CLI on your desktop or laptop.
  • Use AWS cloud 9 – AWS Cloud9 is free for new accounts using the Free Tier option.
  • Use a virtual machine locally, then install AWS CLI on the virtual machine.
    • For Windows – Virtual Box, VMware Workstation, or VMWare Player.
    • For MAC, you can use Virtual Box, VMware Fusion, or Parallels desktop
    • For Linux, use Virtual Box or VMware Workstation Player
    • Use a Docker Container and run CLI from the container

Not every string is an acceptable bucket name. For information about bucket naming restrictions. See Bucket naming rules

Install and configure AWS CLI

AWS CLI version 2 installation instructions:

Note: the above instructions are links to AWS documentation. I’m planning on writing up the use of Packer for Docker and Vagrant for virtual machines, along with Ansible configurations, as future posts.

Create a Bucket

Before executing the following command, you must configure the AWS CLI

When you have configured your AWS CLI environment, you should be able to run the following command.

AWS s3 mb s3://bucket-name

Author: Joseph OMara

Solution Architect for Information Technology. Hobbies include amateur photography, backpacking, camping, hiking, and travel

Leave a Reply

Discover more from Joseph O'Mara

Subscribe now to keep reading and get access to the full archive.

Continue reading