Day 8: AWS | CLI (Command Line Interface)

Day 8: AWS | CLI (Command Line Interface)

Today, I am going to discuss about AWS CLI in detail.

Why AWS CLI is required when we have already AWS GUI?

  • One of the most important reason to use aws CLI is used for automation as GUI is not automation friendly.

  • Ex: suppose as an aws admin someone has requested to create 10 VM's to you in given time. How you will approach this task?

  • If you will keep using the GUI and creating the Instances one be one it may take couple of hours to solve this problem AWS come up with API(Application Programming Interface) using this API you can autmate your task.

How many tools do we have same as CLI?

  • Using this API there are many tools in the market which allows you to automate the resources.

  • Below are few most common tools.

    • AWS CLI

    • Terraform

    • Cloud Formation

    • CDK (Cloud Development Kit)

In this blog we are going to focus of AWS CLI.

  • AWS CLI : It is a python utility which is written by AWS engineers itself, using this utility you can pass the arguments to run the command.

  • AWS CLI act as a layer between user and API.

  • When you pass input to AWS CLI, it will translate you request into API which AWS does understand.

How to install the AWS CLI?

How to Verify and run the command in AWS CLI?

  • Once you have installed the aws cli run aws --version to check if aws cli has installed or not.

  • After verifying you have to logon in the AWS account using CLI.

How to login in AWS account using AWS CLI?

  • Run the command aws configure

  • Once you will run the command then you have to enter the access key and secret key for the user(IAM user) to access the particular account

  • then you have to enter the region in which region you want to create the resource.

  • You can follow the below URL for AWS CLI Command Reference.