Creating S3 Bucket Using CLI
The AWS S3 command is part of the AWS Command Line Interface (CLI) and serves as a tool for interacting with Amazon Simple Storage Service (S3). The AWS s3 mb command creates a new bucket in Amazon S3. It’s a straightforward way to initiate the creation of a storage container within AWS. mb stands for make bucket The bucket name should be globally unique
aws s3 mb s3://<bucket-name> [–options]
Step 1: In this example, we will create a S3 bucket named gfg-example with a default region. Before command execution
aws s3 mb s3://gfg-example
Step 2: The above command will create a s3 bucket with default region
Step 3: In this example we are creating a s3 bucket with specific region using AWS CLI.
The –region flag in the aws s3 mb command allows us to specify the region of the S3 bucket. By using this flag, we can ensure that the s3 bucket is belongs to specific AWS region. Here I am creating a bucket in the Mumbai (ap-south-1) region.
aws s3 s3://gfg-example2 –region ap-south-1
How to Create AWS S3 Bucket using CLI ?
Amazon S3 is a Simple Storage Service in AWS that stores files of different types like Photos, Audio, and videos, as objects, providing more scalability and security. It allows users to store and retrieve any amount of data at any point in time from anywhere on the web. It facilitates features such as extremely high availability, security, and simple connections to other AWS Services. In this article, we will see how to create s3 buckets using AWS CLI