EC2 - Elastic Compute Cloud Flashcards
What OS you can not use to SSH into your instance?
- Windows < 10, you can use any other OS including - - - Windows >= 10
In what OS can you use Putty?
any Windows version
In what OS you can use Instance Connect?
All, don’t get confused with AMI
What is Instance Connect used for?
Connecting to your instance within your browser
Do you need your key file for Instance Connect?
No, your key file is only needed for SSH and/or Putty
Does Instance Connect need port 22 open?
Yes, same as SSH and/or Putty
Does Instance Connect work with any AMI?
Works only out-of-the-box with Amazon Linux 2
What can you use to bootstrap your instance?
EC2 User Data script
How many times does EC2 User Data run?
only once at the first start
What is used #!/bin/bash for?
It is the beginning of EC2 user data script
Which are the Instance Launch Types?
- On Demand Instances
- Reserved Instances (Regular, Convertible, Scheduled)
- Spot Instances
- Dedicated Instances
- Dedicated Hosts
What is the commitment term of On demand Instances
no long term
What is the commitment term of Reserved Instances
long term, 1 to 3 years.
What is the cost of Convertible Reserved Instances compared to On Demand Instances and Regular Reserved Instances?
Cheaper than On-Demand but more expensive than Regular Reserved
What is a Convertible Reserved Instance?
A reserved instance that you can change its instance type
What is a Scheduled Reserved Instance?
A reserved instance that you can launch within time window you reserve
What is the cost of Spot Instances compared to the other Instance Launch types?
the most cost-efficient
What is a Spot Instance?
An instance that you can “lose” at any point of time if
your max price is < current spot price
What is a Dedicated Host?
It is a physical dedicated EC2 server for your use
What is the cost of Dedicated Hosts?
The most expensive
What is the cost of On demand instances
the highest ignoring Dedicated Hosts but no upfront payment, pay for what you use
What is recommended for On demand instances
for short, predictable workloads
What is the cost of Reserved Instances compared to On Demand Instances?
< On-demand and you pay upfront for what you use
What is recommended for Reserved Instances?
long workloads, databases
What is recommended for Spot Instances?
for Batch jobs, data analysis, image processing, not for critical jobs
What is the period that a Dedicated Hosts is allocated for your account?
Allocated for your account for 3 years.
Mention 2 things that Dedicated Hosts allow you to do
- Full control of instance placement.
- Visibility into the underlying sockets, physical cores of the hardware
What is specially useful for Dedicated Hosts?
For software that have complicated licensing model (BYOL - Bring Your Own License) or for companies that have strong regulatory or compliance needs
What is a Dedicated Instance?
Instances running on hardware that’s dedicated to your account
Which are the 7 main EC2 instance types?
R (RAM) - in memory caches C (CPU) - compute / db M (Medium) - general / web app I (I/O) - good local I/O G (GPU) - video rendering / machine learning T2/T3 (Burstable Instances) T2/T3 unlimited
What is a burstable instance (T2/T3)
if machine needs to process something unexpected (a spike in load for example), it can burst, and CPU can be VERY good.
What are burst credits?
It is what burstable instances uses when bursting and it is accumulated. If all credits are gone the CPU becomes BAD
What to do if you are always running low on burst credit?
you need to move to a different kind of non-burstable instance
What is a burstable instance (T2/T3 UNLIMITED)
It is a burstable instance but you don’t lose the burst by paying extra money if you go over your burst credit
What is an AMI?
Amazon Machine Image is used to create out instances from it and can be built on Linux or Windows machines
Are AMIs region-scoped?
Yes
What are the advantages of AMIs?
- Faster boot time.
- Pre-installed packages.
- Active Directory integration out of the box.
- Using someone else’s optimised AMIs for different purposes
Where can I find an AMI?
On the Amazon Marketplace
Would you need to pay for other people’s AMI?
Yes, by the hour
Where are AMIs placed?
in S3, but they are not visible on the console
How are AMIs by default? private or public?
private, locked for account / region
What is an ENI?
Elastic Network Interface is a logical component that represents a virtual network card
Name the attributes of an ENI:
- 1 primary private IPv4, one or more secondary IPv4
- One Elastic IP (IPv4) per private IPv4
- One Public IPv4
- One or more security groups
- A MAC address
Can you re use an ENI?
You can create ENI independently and attach them on the fly (move them) on EC2 instances for failover
Are ENIs multi AZ?
They are bound to a specific AZ
How are you billed in EC2?
by the second, with a minimum of 60 seconds
When you do not pay for the instance?
if it is stopped
EC2 instances prices (per hour) varies based on:
- Region
- Instance Type
- Instance Launch Type
- Linux vs Windows vs Private OS (RHEL, SLES, Windows SQL
Suppose t2.small in US-EAST-1 (VIRGINIA), cost $0.023 per Hour.
If used for 6 seconds, how much is it?
6 seconds, it costs $0.023/60 = $0.000383 (minimum of 60 seconds)
Suppose t2.small in US-EAST-1 (VIRGINIA), cost $0.023 per Hour.
If used for 60 seconds, how much is it?
60 seconds, it costs $0.023/60 = $0.000383 (minimum of 60 seconds)
Suppose t2.small in US-EAST-1 (VIRGINIA), cost $0.023 per Hour.
If used for 30 minutes, how much is it?
30 minutes, it costs $0.023/2 = $0.0115