First install pip:
apt-get install python-pip
And AWS command line tools:
pip install awscli
Check whether is fine:
After this commnad should be output like that:
NAME aws - DESCRIPTION The AWS Command Line Interface is a unified tool to manage your AWS services. SYNOPSIS aws [options] <command> <subcommand> [parameters] ......
Now we should configure awscli for work with AWS using AIM access/secret keys:
To connect to any of the supported services with the AWS CLI, you must provide your AWS credentials. The AWS CLI uses a provider chain to look for AWS credentials in a number of different places, including system or user environment variables and local AWS configuration files.
For information on creating access keys for your account, see Managing Access Keys in the IAM User Guide.
The AWS CLI looks for credentials and configuration settings in the following order:
Environment Variables –
The AWS credential profiles file – located at
~/.aws/credentials on Linux, OS X, or Unix, or or at
C:\Users\ on Windows. This file can contain multiple named profiles in addition to a default profile.
The CLI configuration file – typically located at
~/.aws/config. This file can contain a default profile, named profiles, and CLI specific configuration parameters for each.
Instance profile credentials – these credentials can be used on EC2 instances with an assigned instance role, and are delivered through the Amazon EC2 metadata service.
There are 3 approaches how to configure aws cli:
aws configure command.
AWS Access Key ID [None]: AKIAIXP35BJILHBP2BEQ
AWS Secret Access Key [None]: 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
Default region name [None]: us-east-1
Default output format [None]: text
Set credentials in the AWS credentials profile file on your local system, located at ~/.aws/credentials:
Set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.
You couldadd region profile config: