Day 51: AWS Access Keys & CLI

Day 51: AWS Access Keys & CLI

Creation of Access & CLI installation

Introduction

AWS provides two types of access – AWS Management Console and Programmatic Access. This access is provided by the user creator at the time of creating the user account and can also be modified later. While the management console requires the use of a password, the programmatic access requires the AWS access key.

The management console can be opened in the web browser, whereas the programmatic access allows the user to interact with AWS through programming languages and the Command Line Interface.


Create access keys for an IAM user:

Let us now look into the steps to create the access keys for an IAM user. The steps are very easy. All you need to do is follow through this guide.

Sign in to the AWS Management Console by clicking on this link – https://console.aws.amazon.com/ . This will open the AWS console page.

Click on your user, and choose "Security Credentials" from the drop-down menu.

A page will open with Security Credentials

Scroll down and click on "Create Access key " under Access Keys

Click on tick and "Create access key"

You have now successfully created the Access Key which can be downloaded

Important Note
This is the only time that the secret access key can be viewed or downloaded. You cannot recover it later. However, you can create a new access key any time. Thereby it is recommended to download the key to local machine.

Setup the AWS CLI

Install and Configure AWS CLI

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.

Install AWS CLI

Download the AWS CLI installer:

Go to the below link (Windows OS):

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

Use the below command to download (Ubuntu)

sudo apt install awscli

Configure AWS CLI

Once the CLI is installed, run the below command to configure

aws configure

You will prompted to enter the credentials that we have created earlier

Enter AWS access key and the Secret Access key. This can be retrieved from the downloaded CSV file

Enter the default region and the suitable output format

AWS Access Key ID [None]:

AWS Secret Access Key [None]:

Default region name [None]:

Default output format [None]:

Output Format of AWS CLI :

The Default output format specifies how the results are formatted. The value can be any of the values in the following list. If you don’t specify an output format, JSON is used as the default.


Conclusion:

In this guide, we've explored the essential steps for creating AWS access keys for an IAM user. These keys are crucial for enabling programmatic access to AWS services and play a fundamental role in the AWS CLI. By setting up access keys and configuring the AWS CLI, you've taken the first steps in harnessing the power of AWS services via command-line interactions. This knowledge opens the door to efficiently manage AWS resources and automate various tasks, contributing to your proficiency in cloud computing.

Hope you like my post. Don't forget to like, comment, and share.