The AWS CLI is a collection of tools for managing AWS services from the command-line. We can create the script using CLI to automate AWS resource management. AWS CLI can be installed with an installer (Windows) or by using a pip or a package manager for Python.
Configuring AWS CLI
Getting ready
Keep the user access key details handy that we created in the earlier section.
How to do it...
Here are the steps to follow:
- Installation for Windows:
- Download the installer compatible with your system:
- Windows 64-bit: https://s3.amazonaws.com/aws-cli/AWSCLI64.msi
- Windows 32-bit: https://s3.amazonaws.com/aws-cli/AWSCLI32.msi
- Run the installer and follow the instructions that appear
- Download the installer compatible with your system:
- Installation for Linux, macOS, or Unix:
You should have a working version of Python 2.6.5+ or 3.5+ in your system. Otherwise, install python in your system first. Check your Python installation:
$ python --version
Follow the given steps to install AWS CLI using bundled installer:
Download the AWS CLI bundled installer. For Linux flavor the command is as follows:
$ cURL "https://s3.amazonaws.com/aws-cli/aws-cli-bundle.zip" - "awscli-bundle.zip"
The package need to be unzipped. For Linux flavor the command is as following:
$sudo ./awscli-bundle/install –i /usr/local/aws -b /usr/local/bin/aws
- Configuration:
Type aws configure in command prompt or shell depending on your machine operating system. It will ask for the required details. Provide AWS Access Key ID and AWS Secret Access Key that were generated while creating an admin user. You can mention us-east-1 as the default region or choose any other region from the list given in the screenshot following and JSON as Default output format. Don't worry if you don't understand region for now. We shall take a detailed look at in the following section.
You are all set for creating, modifying and managing networking components through API/CLI call in AWS depending on AWS privilege that your user have.