Tuesday, 3 September 2024

How to Set Up and Use Amazon AWS CLI on Windows/Mac/Linux | AWS CLI Installation and Basic Usage

Ready to Level Up Your Cloud Skills? ☁️

Don't miss out on more AWS and Java tutorials. Join our growing community today!

👉 SUBSCRIBE TO RAM N JAVA

Introduction

The AWS Command Line Interface (CLI) is a unified tool that allows you to manage your AWS services from the terminal. Instead of clicking through the AWS Management Console, you can run powerful commands to automate your workflows and manage resources like S3, EC2, and SQS efficiently.

Step 1: Installing AWS CLI

Depending on your operating system, follow the steps below:

Windows

  • Download the AWS CLI MSI Installer from the official AWS website.
  • Run the installer and follow the "Next" prompts until finished.

macOS

brew install awscli

Linux

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Step 2: Configuring Your Credentials

Once installed, you need to link the CLI to your AWS account. First, create an IAM User in the AWS Console to get your Access Key and Secret Key. Then, run:

aws configure

Provide the following when prompted:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default region name (e.g., us-east-1)
  • Default output format (e.g., json)

Step 3: Essential AWS Commands

Amazon S3 (Storage)

List all your buckets:

aws s3 ls

Create a new bucket:

aws s3 mb s3://my-unique-bucket-name

Amazon EC2 (Servers)

List your running instances:

aws ec2 describe-instances

Amazon SQS (Queues)

Create a simple message queue:

aws sqs create-queue --queue-name MyQueue

Conclusion

Mastering the AWS CLI is a game-changer for cloud engineers. It allows for faster management, easy scripting, and powerful automation. Start practicing these commands today to streamline your cloud operations!

No comments:

Post a Comment

Tutorials