Working With AWS Cloud Services Flashcards
Understand how to access and manage AWS services
Different ways to manage AWS resources
AWS management console (Web application)
AWS command line interface (CLI )
AWS Software Development Kit (SDK)
AWS Tools for powershell
Installing AWS CLI in windows/MAC/Linux
Windows OS have 32 bit/ 64 bit installer.
For MAC/Linux OS, you need to have pip and python available and then run the below command.
“pip install aws cli”
Upgrading AWS CLI
“pip install –upgrade awscli” is the command required to upgrade AWS CLI on a linux or MAC OS running machines.
For windows, download the latest installer and install the latest version.
$ aws configure
New configuration can be created using the ‘aws configure’ command.
$ aws configure
This will ask us to set “AWS Access Key ID” and “Default region name”.
By default both values are set to ‘None’
There are two keys created for your IAM user by IAM service initially during configuration.
1) Access key
2) Secret Key
AWS profiles
Profiles are used to define access previleges for different environments (like stage,dev and prod).
$aws configure –profile
Location of AWS credentials and configuration
AWS credentials are stored in “credentials” file located in “.aws” subdirectory under home directory of the user. Configuration is stored in “config” file in “.aws” subdirectory.
Location in linux
Path for Credentials: ~/.aws/credentials
Path for Configuration: ~/.aws/config
Location in windows
Path for Credentials: %UserProfile%.aws/credentials
Path for Configuration: %UserProfile%.aws/config
CLI will check this file for credentials everytime.
Environment Variables
AWS CLI can also be configured with the help of Environment Variables.
Environment Variables can be set using following command in linux/mac.
“export environment_variable = option” to set the new variable.
Some of the environment Variables are
AWS_DEFAULT_PROFILE
AWS_DEFAULT_REGION
AWS_CONFIG_FILE
work with aws services in CLI
To work with aws services in CLI, we have to use the following command.
aws service parameter1 … parameter2…parameterN
For example: Command “aws ec2 describe-instances”, will return a list of EC2 instances, along with their properties running in your configured region.
Output types in CLI
We can configure “default output type” of CLI in aws config file.
You can represent the data retrieved using AWS CLI in three output formats.
1) JSON,
2) Text
3) Table
JSON is the default format.
Boto and its installation
AWS SDK for python is also know as “Boto”.
It is available as open source project.
Given that Boto is SDK for python, it requires python to be installed prior to its own installation.
Another prerequisite is “pip”, a python tool for installing packages.
Boto can be installed using pip command.
“pip install boto3” (current version of boto SDK is 3)
Features of Boto
Boto contains high level and low level APIs
Low level APIs (client API) are mapped to AWS cloud specific service APIs.
High level APIs (Resource API) are mapped to AWS cloud services, but a way (object oriented) it calls is different from Low level APIs.
Waiter: waiter allows structure that allows for code to wait for changes to occur in the cloud.
Multithreading is possible in boto.
How to use Boto in python code.
You can start using by importing Boto SDK.
Command to import:
“Import boto3”
Number 3 points to boto version.