
In order to create an S3 bucket using AWS CLI you can make use of the aws s3 mb command followed by the name of the bucket as S3Uri
Example:% aws s3 mb s3://my-bucket-unique-bucket-name
make_bucket: my-bucket-unique-bucket-name
If the bucket is created you would see make_bucket as a response followed by the bucket name.
As bucket names are shared namespace, it is possible that the bucket that you are trying to create already exists, in such a case you will get an error like the below,
% aws s3 mb s3://my-bucket
make_bucket failed: s3://my-bucket An error occurred (BucketAlreadyExists)
when calling the CreateBucket operation:
The requested bucket name is not available.
The bucket namespace is shared by all users of the system.
Please select a different name and try again.
Question: How to create a bucket in a specific region?
In order to create a bucket in a specific region you can make use of the --region parameter followed by the region name,
Example:% aws s3 mb s3://my-bucket-unique-bucket-name --region us-west-2
List of all regions:
af-south-1
eu-north-1
ap-south-1
eu-west-3
eu-west-2
eu-south-1
eu-west-1
ap-northeast-3
ap-northeast-2
me-south-1
ap-northeast-1
sa-east-1
ca-central-1
ap-east-1
ap-southeast-1
ap-southeast-2
ap-southeast-3
eu-central-1
us-east-1
us-east-2
us-west-1
us-west-2
More Posts related to AWS,
- Create S3 bucket and upload files using AWS Toolkit for Visual Studio Code
- Get the total size and number of objects of a AWS S3 bucket and folders
- Create an S3 bucket in a specific AWS region using CLI Command
- [Solution] AWS Java SDK S3 AmazonS3Exception InvalidAccessKeyId
- Fix AWS CLI 2 SignatureDoesNotMatch Error - Signature we calculated does not match
- 573 List of reserved keywords in AWS DynamoDB
- Quick way to setup AWS DynamoDB locally on macOS
- [Solution] com.amazonaws.dynamodb.v20120810 MissingAuthenticationToken Key Id or X.509 certificate
- Quick way to install AWS CLI for macOS Terminal
- Setting and Updating AWS CLI Configuration
- AWS S3 CLI BucketAlreadyExists when calling CreateBucket Error make_bucket failed
- How to install AWS Toolkit for Visual Studio Code
- Create S3 bucket using AWS CLI Command mb
- Fix: zsh: command not found: aws (Mac/macOS)
- How to install AWS CLI on Ubuntu
- Fix: Amazon Linux bash: sudo: command not found
- How to Setup AWS Credentials using Visual Studio Code
- AW3 CLI command to get list of all region names
- Most Essencial AWS CLI 2 S3 ls Command Options
- Install AWS CLI using Brew Command
More Posts:
- Command to display epoch time Terminal - Linux
- Calculate Volume of Sphere - C-Program
- Download interrupted: Unknown Host dl-ssl.google.com Error Android SDK Manager - Android
- [Microsoft Teams] You're not on Teams yet, but you can set it up for your organization. - Teams
- How to call a SQL StoredProcedure from Hibernate - Java
- How to Set Homepage on Chrome - Chrome
- Error 404 Tomcat homepage http://localhost:8080/ not displayed - Tomcat
- JSON Syntax : JSON Tutorial - Json-Tutorial