How to Create an S3 Bucket
How to set up the AWS CLI, how to authenticate to AWS, and show how to create and destroy an S3 bucket
The goal of this article is to guide you through the steps required to set up AWS and the AWS command line interface so that by its end you should be comfortable setting up and destroying an AWS S3 bucket from the command line.
Why Command Line?
It’s absolutely possible to log in to the AWS console, navigate the various menus and web forms, and set up an S3 bucket. However, one of the benefits of setting up resources from the command line is that the act now becomes much easier to repeat without error, and much easier to document. If you have to set up multiple resources, being able to script their creation easily will cut down on a lot of laborious and repetitive Click-Ops.
Installing the AWS Command Line Interface
Installation of the command line interface itself is relatively simple; AWS provides its own instructions on how to get up and running with its command line interface here. On either macOS or Windows, it’s as simple as downloading and running an installer from that page. On Linux, it’s as simple as:
Whichever platform you’re on this should install the aws binary somewhere in your system’s
PATH. To verify successful installation, run
aws --version; you should see something like:
aws-cli/2.2.24 Python/3.8.8 Linux/5.4.0-77-generic exe/x86_64.linuxmint.20 prompt/off
Configuring AWS Security Credentials
In order to authenticate our AWS command line to our AWS account we’re going to use Access Keys. Other methods are available, but are outside the scope of this article.
Note: If you don’t already have an account with AWS, you can sign up for one here.