Skip to main content

Command Palette

Search for a command to run...

AWS Made Easy: Getting Started with CLI

Updated
3 min read
AWS Made Easy: Getting Started with CLI

Hello, amazing community! I'm kicking off this blog to not only share knowledge but also to serve as a handy reference for my own forgetful brain. I often find myself repeatedly searching the internet for the same solutions. It's time-consuming and inefficient. So, I'm on a mission to help both myself and the entire community navigate cloud infrastructures more smoothly. Let's dive into the AWS CLI together!

AWS CLI

AWS CLI (Command Line Interface) is a software that lets you manage your AWS infrastructure using the command line (terminal in macOS and Linux, PowerShell or cmd in Windows). It is essential for getting started on your AWS journey. I don't know if this is the optimal way, but we will figure this out as we go along in our journey.

Installing AWS CLI

Windows

In Windows, it is quite easy to install. Just download the installer and run it. Alternatively, run the following code in PowerShell, and it will install:

C:\> msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
C:\> aws --version
# Sample Output:
aws-cli/2.15.30 Python/3.11.6 Windows/10 exe/AMD64 prompt/off

You are all set.

Linux

In Linux, the easiest way to install AWS CLI is using package managers. If you are using Ubuntu or an OS that is based on Ubuntu, just use the apt package manager. Here is the code for it:

sudo apt update
sudo apt install awscli

Now check if the CLI is installed:

aws --version
# Output:
aws-cli/2.15.30 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/2.4.5

I will provide links for other platforms below in the references.

macOS

In macOS, it is also very easy. Just grab the .pkg file from this link. Once downloaded, follow the onscreen instructions, and you should be able to install it.

Once installed, you can verify it using the following command:

aws --version
# Sample Output:
aws-cli/2.15.30 Python/3.11.6 Darwin/23.3.0 botocore/2.4.5

Configuration

Once the above steps are completed, you are all set to use the CLI tool. The tool can be used to manipulate all the permitted services or infrastructure according to your IAM (Identity and Access Management - AWS uses this to manage access to resources) role using the tool itself. To configure, just run the command:

aws configure

This command gives you an output similar to the following picture.

Here you can see the access key ID, secret access key, default region input, and default output format as input. The access key ID and the secret key are stored in the AWS console. You can create these on demand. Stay tuned to see how these access keys and secret keys are created and how resources are provisioned using AWS CLI. For now, if you already have an access key ID and secret access key, you can go ahead and create resources in AWS.

References

  1. Install or update to the latest version of the AWS CLI.

  2. AWS Command Line Interface

  3. How to Install AWS CLI on Ubuntu 22.04

AWS: From Begineer to Solution Architect

Part 1 of 1

In this series we dive into the realm of Amazon web services, explore the services they provide and help viewers realize a scalable systems that can be created through them.