First, you need to install AWS on your desktop system.
To install aws cli using apt-get package on Ubuntu:
apt-get update
apt-get install awscli
check with:
root@len:/home/kevin# aws –version
aws-cli/1.18.69 Python/3.8.10 Linux/5.15.0-43-generic botocore/1.16.19
root@len:/home/kevin#
The cli-command “aws” is the tool command that is used to manage your AWS resources from the command-line.
kevin@len:~$ aws
usage: aws [options] <command> <subcommand> [<subcommand> …] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: the following arguments are required: command
kevin@len:~$
For detailed help see:
NAME
aws –
DESCRIPTION
The AWS Command Line Interface is a unified tool to manage your AWS
services.
SYNOPSIS
aws [options] <command> <subcommand> [parameters]
Use aws command help for information on a specific command. Use aws
help topics to view a list of available help topics. The synopsis for
each command shows its parameters and their usage. Optional parameters
are shown in square brackets.
The Three Ways of Accessing AWS
AWS Management Console (password + MFA)
AWS CLI Command Line Interface (via access keys)
- this can be via AWS Cloudshell from the AWS Management Console, or directly using SSH
AWS SDK Software Developer Kits – (via access keys)
Access keys are generated on the AWS Console
Access Key ID is your username
Secret Access Key is your password – don’t share this!
if you do:
root@len:/home/kevin# aws iam list-users
Unable to locate credentials. You can configure credentials by running “aws configure”.
root@len:/home/kevin#
you can see you have no credentials with AWS. So you first have to create them.
Obtain your access-key id and secret access key from your IAM Management Console for the required user.
then copy paste these keys into:
root@len:/home/kevin# aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]:
Default output format [None]:
root@len:/home/kevin#
Use access keys to make programmatic calls to AWS from the AWS CLI, Tools for PowerShell, AWS SDKs, or direct AWS API calls. You can have a maximum of two access keys (active or inactive) at a time.
For your protection, you should never share your secret keys with anyone. As a best practice, use frequent key rotation.
If you lose or forget your secret key, you cannot retrieve it. Instead, create a new access key and make the old key inactive.
You can also use the cloudshell on the aws system directly, via the aws website dashboard. You can perform pretty well the same actions on cloudshell as you can with the aws cli on your own machine.
AWS has different services such as EC2, S3, etc. To get help on configuring specific AWS services using AWS CLI, you can read the respective man pages as follows:
$ aws <service-name> help