AWS CLI and Python SDK

We can also manage the AWS services via the command-line interface. The AWS CLI is a Python package that can be installed via PIP (https://docs.aws.amazon.com/cli/latest/userguide/installing.html). Let's install it on our Ubuntu host: 

$ sudo pip3 install awscli
$ aws --version
aws-cli/1.15.59 Python/3.5.2 Linux/4.15.0-30-generic botocore/1.10.58

Once the AWS CLI is installed, for easier and more secure access, we will create a user and configure AWS CLI with the user credentials. Let's go back to the AWS console and select IAM for user and access management: 

 
AWS IAM

We can choose Users on the left panel to create a user: 

Select programmatic access and assign the user to the default administrator group:

The last step will show an Access key ID and a Secret access key. Copy them into a text file and keep it in a safe place: 

We will complete the AWS CLI authentication credential setup via aws configure in the terminal. We will go over AWS regions in the upcoming section; we will use us-east-1 for now, but feel free to come back and change this value later: 

$ aws configure
AWS Access Key ID [None]: <key>
AWS Secret Access Key [None]: <secret>
Default region name [None]: us-east-1
Default output format [None]: json

We will also install the AWS Python SDK, Boto3 (https://boto3.readthedocs.io/en/latest/): 

$ sudo pip install boto3
$ sudo pip3 install boto3

# verification
$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto3
>>> exit()

We are now ready to move on to the subsequent sections, starting with an introduction to AWS cloud networking services. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset