AWS CLI - Installation, configuration
(Part-1)

AWS CLI - Installation, configuration (Part-1)

ยท

4 min read

Amazon Web Services, popularly known as AWS is a secure cloud services platform that provides compute power, database storage, content delivery, and other functionalities to help businesses grow and transform.

AWS offers an interface to its users through AWS Management Console and Command Line Interface, CLI.

This blog will cover the AWS CLI in detail and broadly touch on mentioned points at length.

What is a Command Line Interface?

Command Line Interface, i.e., CLI, is a command-line program that accepts the text input to execute the functions of an operating system. CLIs accept as input commands that are entered by the keyboard; the commands invoked at the command prompt are then run by the computer

What is an AWS Command Line Interface?

AWS CLI is an interface that allows users to manage AWS resources from the command prompt by using single command or script.

Benefits of Command Line Interface (CLI)

We will discuss the benefits of using AWS CLI

  • Supportive of all Amazon Web Services: It supports all the AWS services, Command Line Interface (CLI) allows the user to have a single tool to control all services of AWS.

  • Easy installation: It is very simple to install.

  • Allows scripting and automation: CLI allows automating the entire process of managing AWS services through writing scripts & helping in the repetitive task to manage by Automation.

Installation and configuration of the AWS Command Line Interface (CLI)

Installation of AWS CLI:

Installing the AWS CLI is very simple. The easiest way to do it is by following the instruction mentioned in the aws cli installation doc.

once the installation is done, open cmd or terminal and run the below command

$ aws --version
aws-cli/2.10.0 Python/3.11.2 Windows/10 exe/AMD64 prompt/off

Configuration of CLI:

AWS CLI interaction uses certain settings to interact with AWS and stores this information in credentials & config files. Run aws configure or aws configure sso command to configure the credentials.

The CLI would require this information for quick configuration.

$ aws configure
AWS Access Key ID [None]: AxyzxyzxyzxyzxyzE
AWS Secret Access Key [None]: wxyzxyxzxyzxyzY
Default region name [None]: us-west-2
Default output format [None]: json
  • Access key ID and Secret Access Key: It can be created from the AWS AWS management console. It will be displayed only once so make sure to save it securely. In case of loss of access and secret key, new keys have to be recreated. Access keys are associated with AWS CLI to ensure that all API requests made to AWS are signed in with a digital signature.

  • AWS region: a region where the request will be made, it can be default or value can be set such as us-east-1 etc.

  • Output format: The default output format specifies how the result is to be formatted. If you do not specify any format the output format is JSON, other output formats are YAML, YAML-stream, text, and table.

There are other ways to configure the AWS CLI authentication to AWS that can be referred to in the official AWS doc.

Once the AWS CLI has been installed and configured, the user can manage AWS services. AWS provides detailed AWS CLI documentation references and guides on its website for use.

AWS CLI uses?

The different tasks can be done by using the AWS CLI command like copying the files from one s3 bucket to another s3 bucket, launching or managing the list of running EC2.

AWS CLI can be used to access various AWS services like below:- Identity and Access Management (IAM), Amazon Elastic Cloud (EC2), Amazon Simple Storage Service (S3) etc.

AWS CLI is a powerful tool that helps manage cloud services very effectively. For an explanation of using the AWS CLI, we will understand it through examples in the next blog AWS CLI Command examples (Part-2).

ย