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,
- Get the total size and number of objects of a AWS S3 bucket and folders
- How to Create AWS SNS Topic using AWS CLI
- Fix: Amazon Linux bash: sudo: command not found
- [Solution] AWS Java SDK S3 AmazonS3Exception InvalidAccessKeyId
- Create an AWS User using CLI2 Command at a specific Path
- Fix: Missing the following required SSO configuration values: sso_start_url, sso_region
- Fix: zsh: command not found: aws (Mac/macOS)
- Configure AWS Access ID and Secret Keys using CLI on Mac
- Quick way to setup AWS DynamoDB locally on macOS
- Most Essencial AWS CLI 2 S3 ls Command Options
- How to Check AWS SNS Permissions using CLI
- AWS CLI Change Default Output Format
- How to install AWS CLI on Ubuntu
- Quick way to install AWS CLI for macOS Terminal
- Install AWS CLI using Brew Command
- AWS CLI Command to Get a List of SNS Topics
- Get List of AWS SNS Topic Subscriptions using CLI
- How to Setup AWS Credentials using Visual Studio Code
- Installing AWS CLI Version 2 on macOS Sonoma using Terminal
- AW3 CLI command to get list of all region names
- AWS SNS CLI Command Publish Message Attributes
- Create an S3 bucket in a specific AWS region using CLI Command
- [Fix] zsh: command not found: awscli [Mac Terminal]
- Understanding AWS Calculator: DynamoDB on-demand capacity
- [Solution] com.amazonaws.dynamodb.v20120810 MissingAuthenticationToken Key Id or X.509 certificate
More Posts:
- Android : No Launcher activity found! Error - Android
- SharePoint 2010 August 2015 Update KB3055049 - Duplicate Document ID issue bug fixed - SharePoint
- How to Convert Python String to DateTime Object - Python
- Calculate Area of Trapezoid - C-Program
- Installing AWS CLI Version 2 on macOS Sonoma using Terminal - AWS
- Insert data into SQLite table using Python For Loop - Python
- Must Know Homebrew Commands for Mac/Linux Users - MacOS
- Unhandled exception type InterruptedException : Java Threads - Java