Developing (CLI & SDK) Flashcards
How can you develop and perform AWS tasks against AWS?
- Using the AWS CLI on our local computer
- Using the AWS CLI on our EC2 machines
- Using the AWS SDK on our local computer
- Using the AWS SDK on our EC2 machines
- Using the AWS Instance Metadata Service for EC2
What is CLI?
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts
What is your first step to use the CLI on your computer?
Download and install it. Run aws –version to see if it was installed successfully
What you need to do if you want to upgrade your CLI on your computer?
Download it and install it once again
What is your next step after you install CLI on your computer?
Download an access key from your IAM user
What is your next step on CLI after you installed and downloaded your access key on your computer?
1- You need to run “aws configure” in your pc console.
2- type your access key (id and secret) downloaded
3- type the default region
4- type the default format or leave empty
How can you use CLI on your EC2 instances (the bad way)?
you could run “aws configure” just like you do on your personal computer
How can you use CLI on your EC2 instances (the right way)?
you can attach an IAM Role to your EC2 instances. IAM Rol can come with a policy authorizing exactly what the EC2 instance should be able to do
In general terms what you need to do if you want your EC2 instance to perform something?
Use IAM Roles!! Never put your credentials there!
How can you test your IAM policies?
Using AWS Policy Simulator
What is EC2 Instance Metadata?
Instance metadata is data about your instance that you can use to configure or manage the running instance
How can you retrieve your Instance metadata?
You must run from your terminal curl http://169.254.169.254/latest/meta-data/
Ending in / is a folder, otherwise a file
What can you not retrieve from the Instance metadata?
The IAM policies
Do you need an IAM role to access your instance metadata?
No needed
What is AWS SDK?
The software development kit (SDK) helps make AWS applications and services available to your applications across many devices and operating systems without using the CLI
How many SDKs are?
A lot, because there are un-official SDKs as well
What region is used by default by SDK?
us-east-1
What happens behind scenes when you configure the CLI in your computer?
A directory is created at ~/.aws/credentials where all the information is stored
What you should do for intermittent errors received from API Rate Limits?
Exponential Backoff
How works retry mechanism in Exponential Backoff?
You set a constant and use exponential values i.e.
- for 2: 1, 2, 4, 8, 16, 32…
- for 3: 1, 3, 9, 27, 81, 243…
What are the 2 types of AWS Limits (Quotas)?
- API Rate Limits
- Service Quota Limits