=

AWS configure cli : Configure your command line interface

Install aws cli on you device from 👉here

The AWS Command Line Interface (AWS CLI) is a cli tool that is used to manage almost all of the aws services usings commands. It helps to automate aws using scripts.

    Table of contents -

  1. Get aws access keys
  2. Configure cli

1. Get aws access keys

Before configuring your cli you need two keys -

  1. Access key
  2. Secret access key

And in aws there are 2 types of users -

  1. Root user
  2. IAM user

Get access keys of ROOT user from 👉 aws_homepage >> click on profile/user (top-right) >> Security credentials >> Access_keys > Create_access_key >> Confirm/check >> Create access key

You will get the keys similar as below :

aws root access keys

Get access keys of IAM user from 👉 iam_homepage >> users (under Access management) >> {YOUR_USERNAME} >> Access_keys > Create_access_key >>Select required use case >> Confirm/check >> Create access key

You will get the keys similar as below :

aws IAM access keys

Configure your command line environment with your aws account using following methods -

2. Configure Cli

To configure cli you have to run the command

Code bash
aws configure

It will ask you for Access key , Secret access key and Region (optional). Which you got priviously.

It will save these keys as default for the current user. It stores the keys into ~/.aws/credentials and extra configuratins into ~/.aws/config file.
If you want to work with multiple profiles , use --profile argument to store each user's access keys seperatly.

Use command :

Code bash
aws configure --profile NEW_NAME

After using this command you have to use --profile NEW_NAME with each upcomming commands to be execute as NEW_NAME.