Configure AWS CLI
This article is for those looking for a detailed and straightforward guide on configuring AWS CLI.
The AWS CLI is a single tool for managing AWS services. With just one tool download, you can control many AWS services from the command line and automate them with scripts.
IMPORTANTIn this guide, we will consider the case when you already have an operating system with AWS CLI installed on it.
For detailed instructions on installing the AWS CLI on macOS, see my guide: Install AWS CLI on macOS.
We need to create a new user and assign him an access policy. The user will be used to connect to AWS using AWS CLI.
Log in under your root account on AWS and search for âIAMâ in the main search bar on top of the AWS dashboard.

Go to the âUsersâ section and click on the âAdd usersâ button.

In the âUser nameâ field, specify the username for the new user and check âAccess key - Programmatic accessâ.
NOTEIn this manual, âvladimir_mikhalevâ will be used as the username.
Click on the âNext: Permissionsâ button.

Next, select âAttach existing policies directlyâ.
Select the âAdministratorAccessâ policy and Click on the âNext: Tagsâ button.

In the next step, you do not have to make any changes.
Click on the âNext: Reviewâ button.

Everything is ready to create a new user.
Click on the âCreate userâ button.

The user has been successfully created and has the necessary permissions.
Now you need to save the received âAccess key IDâ and âSecret access keyâ.
Click on the âShowâ button to display the contents of the âSecret access keyâ section and save the contents of the section to a safe place.
Click on the âCloseâ button.

Letâs configure AWS CLI with the command:
aws configure
In the âAWS Access Key IDâ field, specify the access key ID that you obtained earlier during user creation.
Press the âEnterâ button.

In the âAWS Secret Access Keyâ field, specify the secret access key that you obtained earlier during user creation.
Press the âEnterâ button.

In the âDefault region nameâ field, specify the AWS region in which you are planning to work.
Press the âEnterâ button.

In the âDefault output formatâ field, specify âjsonâ as a format.
Press the âEnterâ button.

Everything is ready to use the AWS CLI.
Letâs list all EC2 instances with the command:
aws ec2 describe-instances
Please note that I have just one EC2 instance.

Now press the âqâ button to close information about EC2 instances.
For step-by-step instructions on installing eksctl on macOS, see my guide: Install eksctl on macOS.
SIGNAL & INTEL
- The Order: Stop being a grunt. Become an Architect. Join The Private Order.