How Do You Create an AWS S3 Bucket via the AWS CLI?

Problem scenario
You want to create an AWS S3 bucket using the AWS CLI. What do you do?

Solution
Prerequisite

This assumes that you have installed the AWS CLI. If you need assistance, see this posting.

Procedures
Run a command like this but replace "foobar" with the unique name of an s3 bucket that other people will see.

aws s3 mb s3://foobar

If you want to create it in a non-default region, use the --region flag like this (but replace us-east-1 with the region of your choice):

aws s3 mb s3://foobar --region us-east-1

If you aren't sure about the default region (if you did not use the --region flag), see How Do You Determine the AWS CLI Default Region?.

Leave a comment

Your email address will not be published. Required fields are marked *