DEV Community

Cover image for Create S3 bucket in AWS
vishal patidar
vishal patidar

Posted on

Create S3 bucket in AWS

What is AWS (Amazon Web Service)

In simple word aws is just a cloud vendor (like other cloud vendor Google GCP and Micrsoft Azure) that work on pay as you go. It provide a servers where we can host our website and it can be access remotely from anywhere and many more service are provided by the AWS like - EC2, S3, IOT, ML, VPC, Container, Robotics etc.
check out all services

What is S3 (Simple Storage Service)

Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance. Customers of all sizes and industries can store and protect any amount of data for virtually any use case, such as data lakes, cloud-native applications, and mobile apps. With cost-effective storage classes and easy-to-use management features, you can optimize costs, organize data, and configure fine-tuned access controls to meet specific business, organizational, and compliance requirements.

What is Bucket

Bucket is just a kind of container where we can put objects(object means we can say files) and we can also say that it could be a folder that contain some kind of files and folders.

Prerequisite

  • AWS account

  • Basic Knowledge of AWS

  • how storage or file system work

  • A smile on your face :)

In this article we will discuss two way to create S3 bucket

  1. Through aws s3 dashboard
  2. Through aws cli

Create S3 Bucket with AWS dashboard

  1. Go to s3 dashboard (search S3 on search box and click it)

Image description

  1. Click on create bucket button enter the bucket name and bucket name should be unique because bucket name would not be a duplicate. You can also select specific region in which region you want to create bucket.

By default all public access are blocked but you can unchecked if you want to make bucket public. If you unchecked all option then other user can access all the objects of this particular bucket otherwise no one can access this bucket objects.

Image description

Image description

Image description

At the end click on create button. Now you can see that one S3 bucket has added on dashboard.

Create S3 Bucket through AWS CLI

To create S3 bucket through AWS CLI you must install awscli tool.
Install AWS CLI (Linux, Mac, Windows)

For the linux user

go to the terminal and link your machine to the aws account to access all kind of service that provided by amazon aws. run bellow command on terminal.

$ aws configure
Enter fullscreen mode Exit fullscreen mode

Now go to aws site and in top right side click on your Name > Security credentials > Access keys (access key ID and secret access key) then click on Create New Access Key button it will open model after that click on show access key or you can also download it.

And when you run aws configure on terminal it would ask bellow thing.

  1. AWS Access Key ID
  2. AWS Secret Access Key
  3. Default region name
  4. Default output format

To check connection is establish or not you can run bellow command.

$ aws sts get-caller-identity
Enter fullscreen mode Exit fullscreen mode
{
    "Account": "123456789012", 
    "UserId": "AR#####:#####", 
    "Arn": "arn:aws:sts::123456789012:assumed-role/role-name/role-session-name"
}
Enter fullscreen mode Exit fullscreen mode

To check how many s3 bucket exist on you account

$ aws s3 ls
Enter fullscreen mode Exit fullscreen mode

Create new fresh S3 bucket

$ aws s3 mb s3://bucket_name --region region_name

$ aws s3 mb s3://vishaljipatid --region us-east-2
Enter fullscreen mode Exit fullscreen mode

you can change region name and bucket name should be unique.
After that to check that bucket is created or not.

$ aws s3 ls
Enter fullscreen mode Exit fullscreen mode

And you can also check bucket from aws S3 dashboard.

Image description

For More information you can follow AWS playlist on youtube
AWS playlist

Top comments (0)