Set up an AWS CLI

Maitrayee Khalasi
3 min readJul 25, 2023

--

The AWS Command Line Interface (AWS CLI) is an open-source tool that enables you to interact with AWS services using commands in your command-line shell. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your terminal program

So Let’s install the AWS CLI and configure it.

To install the AWS CLI you can refer to this link

👉🏻https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Install the CLI based on your operating system. here, I’m installing it for windows,

Install the msi directly from the above link and double click on the installed msi or else you can run the following command,

msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

After installation check whether aws cli is installed or not with the command,

aws

To, Configure the AWS CLI we will need the IAM user with its access key and secret access key to log in to the AWS account and manage the services.

Firstly, let’s create an IAM user,

Go to the IAM service from the AWS management console, and click on Users from the left navbar. then click on Add Users from the dashboard.

Create a user and configure the user’s permission as per your requirement.

After creating user, click on that user’s username from user list, go to the Security Credentials tab,

Scroll down and go through the Access keys block, From that click on Create access key,

A new window will be open with options, our purpose is to use aws cli so will select Command Line Interface(CLI).

We can also create access keys for different purposes.

Click on Next, and give a description tag if you want otherwise click on Create access key button.

That’s it your access key and secret access key are generated. copy and store your access key and secret access key.

Let’s move to the second part, configure your AWS CLI using this IAM user and its access and secret access key.

To configure AWS CLI we need to run only one following command,

aws configure

After running the above command it will ask for an access key, secret key, and the default region(By default whichever service will be launched from the cli that will be launched from this region).

That’s it !!

Now we are ready to use the AWS CLI to work with AWS.

Thank you for reading!

--

--