AWS CLI: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 29: Line 29:


=Configuration=
=Configuration=
==Configuration Procedure==


Once installed, AWS CLI can be configured by running:
Once installed, AWS CLI can be configured by running:
Line 35: Line 37:


It will interactively inquire for AWS Access Key ID, etc.
It will interactively inquire for AWS Access Key ID, etc.
==Configuration Files==
AWS CLI organizes configuration and credentials in two separate files placed in $USER/.aws. They are separated to isolate credentials for less sensitive options of region and output.
===~/.aws/config===


AWS CLI configuration file is maintained by default in ~/.aws/config:
AWS CLI configuration file is maintained by default in ~/.aws/config:
Line 42: Line 50:
region = us-west-2
region = us-west-2
ca_bundle = /path/to/ca-bundle.pem
ca_bundle = /path/to/ca-bundle.pem
output=json


[profile testing]
[profile testing]
Line 52: Line 61:
cloudsearch = true
cloudsearch = true
</syntaxhighlight>
</syntaxhighlight>
===~/.aws/credentials===


AWS CLI credentials are maintained by default in ~/.aws/credentials:
AWS CLI credentials are maintained by default in ~/.aws/credentials:

Revision as of 16:48, 26 November 2019

External

Internal

Overview

AWS CLI is a package that provides commands for interacting with the AWS services. All functionality available on the web Amazon Management Console is made available from command line.

Installation

https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html
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

Result (it should be already in PATH):

aws --version
aws-cli/1.16.25 Python/2.7.10 Darwin/17.7.0 botocore/1.12.15

Configuration

Configuration Procedure

Once installed, AWS CLI can be configured by running:

aws configure

It will interactively inquire for AWS Access Key ID, etc.

Configuration Files

AWS CLI organizes configuration and credentials in two separate files placed in $USER/.aws. They are separated to isolate credentials for less sensitive options of region and output.

~/.aws/config

AWS CLI configuration file is maintained by default in ~/.aws/config:

[default]
region = us-west-2
ca_bundle = /path/to/ca-bundle.pem
output=json

[profile testing]
region = us-west-1

[profile testing2]
region = eu-west-1

[preview]
cloudsearch = true

~/.aws/credentials

AWS CLI credentials are maintained by default in ~/.aws/credentials:

[default]
aws_access_key_id=...
aws_secret_access_key=...

Test Installation

aws ec2 describe-regions
aws ec2 describe-hosts

TODO

Define the relationship between the AWS CLI and EC2 CLI