Title: Creating an S3 Bucket through AWS CLI

Title: Creating an S3 Bucket through AWS CLI

ยท

3 min read

Introduction:

Welcome to this documentation-style blog, where we will guide you through the process of creating an S3 bucket using the AWS Command Line Interface (CLI).

In a previous blog, we discussed creating an S3 bucket using Terraform. This time, we will explore the CLI approach, offering you another method to provision an S3 bucket efficiently.

Let's dive into the step-by-step process of creating an S3 bucket using the AWS CLI:

Step 1: Install and Configure the AWS CLI

  • Ensure that you have the AWS CLI installed on your local machine.

  • If not, search AWS CLI in Google and open the official website.

  • After opening it on the right corner of the homepage you will get many options to download AWS CLI on different operating systems. I am using a Windows laptop so I will choose Windows 64-bit.

  • Choose according to your personal need and install it.

  • Open a terminal or command prompt and run the command: aws configure.

  • Enter your AWS access key ID, secret access key, default region, and default output format when prompted.

To create an access key and secret key for the AWS root user, please follow these steps:

Step 1: Sign in to the AWS Management Console

Step 2: Access the My Security Credentials Page

  • Once you are signed in, click on your account name or the dropdown arrow next to it in the top-right corner of the console.

  • From the dropdown menu, select "My Security Credentials."

Step 3: Navigate to the Access Keys Section

  • On the My Security Credentials page, scroll down to the "Access keys (access key ID and secret access key)" section.

Step 4: Create New Access Key

  • Click on the "Create New Access Key" button.

Step 5: View and Download the Access Key Details

  • After the access key is created, the access key ID and the corresponding secret access key will be displayed.

  • Take note of the access key ID and secret access key or choose to download the credentials file.

Note: It's important to handle access keys securely, as they provide significant access to your AWS resources. Ensure that you protect the access key ID and secret access key, and avoid sharing them publicly or committing them to version control systems.

Step 2: Use the following command to create an S3 bucket:

  • Run the command aws s3 mb s3://"bucket_name" to create an S3 bucket.

  • Replace "bucket_name" with your preferred name for the bucket.

  • To check whether it's been made or not go to your AWS console.

Conclusion:

In this blog, we explored the process of creating an S3 bucket using the AWS Command Line Interface (CLI).

By following these steps, you can easily create an S3 bucket using the AWS CLI. This method provides a flexible and efficient approach to managing your cloud storage. With this knowledge, you can now choose the method that best suits your workflow, whether it be using Terraform or the AWS CLI.

Did you find this article valuable?

Support Infrasity Blog by becoming a sponsor. Any amount is appreciated!

ย