28
DecChristmas Special : Upto 40% OFF! + 2 free courses - SCHEDULE CALL
Amazon Web Services is one of the top market leaders in the era of cloud computing. It helps in the different sectors of technology like gaming, data processing, data warehousing, development, etc. Amazon’s Command Line interface is also the top eye-catcher of the browser console. Using the command line interface, a developer can type a command to designate a profile, region, or output format that is different than default configurations. Today, we’ll discuss the basic terminology associated with AWS CLI, its usage, installation, and a few of the AWS CLI commands. Before you proceed further, consider going for a trending AWS Certification Course.
The AWS CLI is an open-source tool that enables you to communicate with AWS services using commands in your command-line shell. You may start using the functionality of AWS CLI with theminimal configuration only. The AWS CLI manages your AWS services from a terminal session on your own client and allows you to control and configure multiple AWS services. However, to be a reputed AWS professional much depends on the certification you hold, consider going for industry-recognized Cloud computing certifications.
However, if you are a beginner and want to know how to create your own first amazon ec2 instance and gain in-depth knowledge on What Is AWS Lambda? We recommend you check out these blogs.
Pip is the primary distribution method for the AWS CLI on Linux, Windows, and macOS. This is said to be a package manager for Python that provides an easy way to install, upgrade, and remove Python packages and their dependencies.
Tip: The AWS Command Line Interface (CLI) is an instrument given by AWS to deal with our AWS administrations. Utilizing this single instrument, you can oversee diverse AWS administrations from the order line. Check out How to Install the AWS Command Line Interface in various systems.
If you confront issues while installing the AWS CLI with pip3, you can install the AWS CLI in a virtual environment to isolate the tool and its dependencies. Or you can use a different version of Python than you normally do. For offline or automated installations on Linux, macOS, or Unix, try the bundled installer. The bundled installer incorporates the AWS CLI, its dependencies, and a shell script that installs for you.
On Windows, you can also use the MSI installer. Both of these methods simplify the initial installation. However, the tradeoff is that it's more difficult to upgrade when a new version of the AWS CLI is released.
Note: If you are a beginner looking to excel in your career in AWS. Check out the best High-Paying Cloud Certifications in 2022 that can remarkably boost your career. You can verify the AWS CLI is installed correctly by running AWS --version command. $ aws --version aws-cli/1.16.116 Python/3.6.8 Linux/4.14.77-81.59-amzn2.x86_64 botocore/1.12.106
You can perform the following steps from the command line to install the AWS CLI using the bundled installer:
$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
In the context of AWS CLI, AWS Step Functions were one of the most applauded announcements in 2022 which lets you coordinate multiple AWS services into serverless workflows to build and update apps quickly. Check out the AWS Step Functions Concepts with Example to gain complete insight o this domain.
The AWS CLI is updated frequently with the support for new services and commands. If you have already installed pip and a supported version of Python in your system, then you can install the AWS CLI by using the following command. If you have installed Python version 3+, then it is recommended to use the ‘pip3 command’.
$ pip3 install awscli --upgrade --user
The --upgrade option notifies the pip3 to upgrade any requirements that are already installed.
The --user option notifies pip3 to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.
We recommend that you regularly check to see if there is a new version of the AWS CLI and upgrade to it when you can. You can use pip list ‘-o command’
to check which packages are "outdated': $ aws --version was-cli/1.16.170 Python/3.7.3 Linux/4.14.123-111.109.amzn2.x86_64 botocore/1.12.160 $ pip3 list -o Package Version Latest Type ---------- -------- -------- ----- awscli 1.16.170 1.16.198 wheel botocore 1.12.160 1.12.188 wheel
The AWS CLI is updated frequently to add support for new services and commands. If you want to update the latest version of the AWS CLI, run the install command again.
$ pip3 install awscli --upgrade –user
If you need to uninstall the AWS CLI, then use pip uninstall. $ pip3 uninstall awscli
If you don't have Python and pip, use the procedure for your environment.
The installation of AWS Command Line Interface (AWS CLI) can be done on Windows by using a standalone installer or pip, which is a package manager for Python. The AWS CLI is supported on Windows XP or later. For the users of Windows, the MSI installation package can be used as a convenient way to install the AWS CLI without installing any other prerequisites. When you find the release of updates, then you have to repeat the installation process to get the latest version of the AWS CLI. To update frequently, it would be better to consider using pip for easier updates.
Note: The MSI installer for the AWS CLI doesn't work with Windows Server 2008 (version 6.0.6002). You have to use pip to to install with this version of Windows Server
By default, the CLI installs to C:\Program Files\Amazon\AWSCLI (64-bit version)
or C:\Program Files (x86)\Amazon\AWSCLI (32-bit version)
. To confirm the installation, use the aws --version command at a command prompt (open the Start menu and search for cmd to start a command prompt). C:\> aws --version aws-cli/1.16.116 Python/3.6.8 Windows/10 botocore/1.12.106
Don't attach the prompt symbol (C:\>, shown above) when you type a command. These are attached in program listings to differentiate commands that you type from output returned by the CLI.
If Windows is unable to find the program, you might need to close and reopen the command prompt to refresh the path, or add the installation directory to your PATH environment variable manually.
Updating an MSI Installation
The AWS CLI is updated regularly. If you want to update your previous AWS CLI to the latest version, download and run the MSI installer again, as described previously.
Uninstalling the AWS CLI
To uninstall the AWS CLI from the system, open Control Panel, and then choose Programs and Features. Select AWS Command Line Interface, and then choose Uninstall to launch the uninstaller. Confirm the uninstallation of AWS CLI when you're prompted.
You can also originate the Programs and Features program from the command line with the following command:
C:\> appwiz.cpl
Now, that you have got a taste of this, take this 2-minute free AWS Quiz to check your Cloud computing knowledge and stay updated with the latest updates and innovations in AWS.
The installation of AWS CLI and its dependencies on most Linux distributions is performed by using pip, a package manager for Python.
The AWS CLI package can be availed through various repositories for other package managers like apt and yum, but you cannot get the latest version unless you get it from pip or use the bundled installer.
Run pip -- version to see if your version of Linux already includes Python and pip. It is recommended to have Python version 3+ installed in your system so that you use the pip3 command.
$ pip3 --version
If you don't already have pip installed, check which version of Python is installed in your system.
$ python --version
or
$ python3 --version
Tip: AWS is a big domain with multiple career options. Yet, for the maximum impact learning, AWS from scratch is important, check out our complete AWS Training & Certification Guide for a rewarding career ahead
The paths that show up depending on which method you used to install the AWS CLI.
Typical paths include:
C:\Program Files\Python37\Scripts\
%USERPROFILE%\AppData \Local\Programs\Python\Python37\Scripts
%USERPROFILE%\AppData\Roaming\Python \Python37\Scripts
C:\Program Files\Amazon\AWSCLI\bin
C:\Program Files (x86)\Amazon\AWSCLI\bin
Note: Folder names that include version numbers can vary. The examples above reflect the use of Python version 3.7. Replace as needed with the version number you are using.
To modify your PATH variable (Windows)
Important: The bundled installer doesn't support installing on the paths that contain spaces.
Prerequisites
$ python --version
If you have not installed Python in your system or, if you want to install a different version of Python, then follow the procedure of installation of of the AWS CLI on Linux. Further, if you are looking to garner more information, check out our blog on How to use Amazon EKS and deploy a Kubernetes application to gain better insight.
After walking through the AWS CLI user guide and performing the installation and configuration of the tool, you can begin making calls to your AWS services from the command line. $ aws ec2 describe-instances $ aws ec2 start-instances --instance-ids i-1348636c $ aws sns publish --topic-arn arn:aws:sns:us-east-1:546419318123:OperationsError --message "Script Failure" $ aws sqs receive-message --queue-url https://queue.amazonaws.com/546419318123/Test
You can take help from the command line to view the supported services,
$ aws help
the operations for a service,
$ aws autoscaling help
and the parameters for a service operation.
$ aws autoscaling create-auto-scaling-group help
So, this is how to use AWS CLI. Joining JanBask Training can help you learn more about the platform and get a better understanding of it
list-commands
[--command-id ]
[--instance-id ]
[--filters ]
[--cli-input-json ]
[--starting-token ]
[--page-size ]
[--max-items ]
[--generate-cli-skeleton ]
Options
--command-id (string)
(Optional) If provided, lists only the specified command.
--instance-id (string)
(Optional) Lists commands issued against this instance ID.
--filters (list)
(Optional) One or more filters. Use filters to return a more specific list of results.
Shorthand Syntax:
key=string,value=string ...
--cli-input-json (string)
You can use the service operation based on the JSON string provided which follows the format provided by --generate-cli-skeleton.
--starting-token (string)
A token to specify where to start paginating. This is the NextToken from a previously truncated response.
--page-size (integer)
The size of each page to get in the AWS service call. There is no effect on the number of items returned in the command's output by using this command. This command can set a smaller page size results in more calls to the AWS service by retrieving fewer items in each call. This can help in the prevention of AWS service calls from timing out.
--max-items (integer)
It is the total number of items to return in the command's output. If the total number of items available is more than the value specified, then the NextToken is provided in the command's output.
--generate-cli-skeleton (string)
It prints a JSON skeleton to standard output without sending an API request. If there is no value or the value input, then it prints a sample input JSON that can be used as an argument for --cli-input-json.
Key -> (string)
It is the user-defined criteria for sending commands that target instances that meet the criteria.
Values -> (list)
It is a user-defined criterion that maps to Key. For example, if you have specified tag: ServerRole, you could specify value: WebServer to run a command on instances that include Amazon EC2 tags of ServerRole, WebServer.
(string)
RequestedDateTime -> (timestamp)
The date and time the command was requested.
Status -> (string)
The status of the command.
StatusDetails -> (string)
A detailed status of the command execution. StatusDetails includes more information than Status because it includes states resulting from error and concurrency control parameters. StatusDetails can show different results than Status.
StatusDetails can be one of the following values:
OutputS3Region -> (string)
(Deprecated) You can no longer specify this parameter as the system ignores it. Instead, the Systems Manager automatically determines the Amazon S3 bucket region.
OutputS3BucketName -> (string)
It is the S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.
OutputS3KeyPrefix -> (string)
It is the S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.
MaxConcurrency -> (string)
It is the maximum number of instances that are allowed to run the command at the same time. You can specify the number of instances, such as 10, or a percentage of instances, such as 10%. The default value is 50.
MaxErrors -> (string)
It is the maximum number of errors allowed before the system stops sending the command to additional targets. You can specify the number of errors, such as 10, or a percentage or errors, such as 10%. The default value is 0.
MaxErrors -> (string)
It is the maximum number of errors allowed before the system stops sending the command to additional targets. You can specify the number of errors, such as 10, or a percentage or errors, such as 10%. The default value is 0.
TargetCount -> (integer)
It is the number of targets for the command.
CompletedCount -> (integer)
It is the number of targets for which the command invocation reached a terminal state. Terminal states include the following: Success, Failed, Execution Timed Out, Delivery Timed Out, Canceled, Terminated, or Undeliverable.
ErrorCount -> (integer)
It is the number of targets for which the status is Failed or Execution Timed Out.
DeliveryTimedOutCount -> (integer)
It is the number of targets for which the status is Delivery Timed Out.
ServiceRole -> (string)
It is the IAM service role that Run Command uses to act on your behalf when sending notifications about command status changes.
NotificationConfig -> (structure)
Configurations for sending notifications about command status changes.
NotificationArn -> (string)
It is an Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.
NotificationEvents -> (list)
These are the different events for which you can receive notifications. These events include the following: All (events), InProgress, Success, TimedOut, Cancelled, Failed.
NotificationType -> (string)
The command receives a notification when the status of a command changes. The invocation of this command is to send to multiple instances and receive a notification on a per-instance basis when the status of a command changes.
CloudWatchOutputConfig -> (structure)
The CloudWatch Logs to the information where you want the Systems to send the command output.
CloudWatchLogGroupName -> (string)
The name of the CloudWatch log group where you want to send command output. If you don't specify a group name, Systems Manager automatically creates a log group for you. The log group uses the following naming format: AWS/ssm/SystemsManagerDocumentName.
CloudWatchOutputEnabled -> (boolean)
This command sanctions the Systems to send command output to CloudWatch Logs.
NextToken -> (string)
(Optional) This is the token for the next set of items to return.
AWS is a secure cloud service platform that offers infrastructure services to developers. On the other hand, AWS CLI is like honey for the bee that controls all those services together into a simple command-line interface and eases the task of the developer. So, gear up and give a jumpstart to your AWS professional career by enrolling yourself in a comprehensive AWS Certification Course, today! If you have any questions for us? Feel free to ask or talk to our counselor; we’ll get back to you! Also, don’t forget to join the professional JanBask AWS Community to get professional guidance and the best career advice.
FaceBook Twitter LinkedIn Pinterest EmailA dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.
Cyber Security
QA
Salesforce
Business Analyst
MS SQL Server
Data Science
DevOps
Hadoop
Python
Artificial Intelligence
Machine Learning
Tableau
Search Posts
Related Posts
Receive Latest Materials and Offers on AWS Course
Interviews