-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Amazon EC2 Cookbook
By :
AWS CLI is a set of unified command-line tools to work with multiple AWS services. Using AWS CLI tools you can manage EC2 resources (such as instances, security groups, and volumes) and your VPC resources (such as VPCs, subnets, route tables, and Internet gateways).
In the following two sections, we list the set of instructions required to accomplish this on Linux and Windows/Mac platforms.
You need AWS access key ID and AWS secret access key to access AWS services. Instead of generating these credentials from the root account, it's always best practice to use IAM users. You should save these credentials in a secure location. If you lose these keys, you must delete the access key and then create a new key.
You can get the AWS credentials from AWS management portal by following these steps:
Don't upload your code base with AWS security credentials to public code repositories such as GitHub. Attackers are scraping GitHub for AWS credentials. If anyone gets access to these credentials, they can misuse your AWS account.
We can use the pip tool to install the Python packages.
pip installation step.$ python --help
$ sudo apt-get install gcc $ wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz $ tar -zxvf Python-2.7.8.tgz $ cd Python-2.7.8 $ ./configure $ make $ sudo make install
$ python –help
pip, please check whether pip is already installed on your machine or not by using the following command. If pip is already installed on your machine, then skip to the awscli installation step:$ pip –help
pip:$ sudo apt-get install pip
awscli, you can upgrade the installation using the –upgrade option.$ sudo pip install awscli
On the command prompt, type the following command, which will prompt for the AWSAccessKey ID, AWSSecretKey, default AWS region, and default output format.
$ sudo aws configure
$ sudo aws ec2 describe-regions
We can use the pip tool to install the Python packages.
pip installation step.$ python –help
$ python –help
pip, check whether pip is already installed on your machine or not by using the following command. If pip is already installed on your machine, skip to the awscli installation step.$ pip –help
pip. Download and run the installation script from https://bootstrap.pypa.io/get-pip.py. After that, run the following command:$ python get-pip.py
awscli, you can upgrade the installation using the –upgrade option.$ pip install awscli
$ aws configure
This command will then prompt you for the AWSAccessKey ID, AWSSecretKey, default AWS region, and default output format.
$ aws ec2 describe-regions
Change the font size
Change margin width
Change background colour