Title: Creating an S3 Bucket through AWS CLI
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
Open a web browser and go to the AWS Management Console (https://console.aws.amazon.com).
Sign in using your AWS root account credentials.
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.
Subscribe to my newsletter
Read articles from Tushar Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Tushar Kumar
Tushar Kumar
Tushar | DevOps Engineer ๐จโ๐ป | Theatre Enthusiast ๐ญ Passionate DevOps Engineer skilled in CI/CD, infrastructure-as-code, and cloud solutions. Experience with Docker, Kubernetes, AWS, Git, linux and Terraform. Committed to optimizing workflows and driving innovation. A theatre enthusiast with strong communication skills gained through active participation in college theatre society.