EC2 101 Flashcards
EC2 High Level Principles, Pricing Models, Pricing Scenarios
What does EC2 stand for?
Elastic Compute Cloud
At a high level, what does EC2 provide?
EC2 is a web service that provides resizeable compute capacity in the cloud
Why is EC2 useful?
- EC2 reduces the time required to obtain & boot new server instances to minutes.
- This allows you to quickly scale capacity (both up and down) as computing requirements change
What are the 4 core principles behind the EC2 pricing model?
- Pay as you go
- Pay for what you use
- Pay less as you use more
- Pay even less as you reserve capacity
What are the 4 EC2 Pricing Models?
- On Demand
- Reserved
- Spot
- Dedicated Hosts
How does On Demand Pricing for EC2 instances work?
Pay a fixed rate by the hour (or second) with no time commitment
At a high level, how does Reserved Pricing for EC2 instances work?
Reserved Pricing provides you with a capacity reservation, at a significant discount on the hourly rate.
How long is the contract on a Reserved Instance in EC2?
Can be 1 year or 3 years
A user is developing and testing an application using EC2 for the first time. Which EC2 pricing model best suits their use case?
On Demand Pricing
A user’s application requires a reserved capacity, and they are able to make upfront payments to save money. Which pricing model makes the most sense in this scenario?
Reserved Pricing
What are the three types of Reserved Instances Classes?
- Standard Reserved Instances
- Convertible Reserved Instances
- Scheduled Reserved Instances
What is the key difference between a Standard Reserved Instance and a Convertible Reserved Instance?
- A Convertible Reserved Instance is more flexible on the fly.
- In general, you can change the attributes of a convertible reserved instance as long as the change results in a reserved instance class of equal or lesser value.
What is the best way to purchase compute capacity reservations that do not run continuously, but do recur on a regular schedule (daily, weekly, monthly)
Use Scheduled Reserved Instances
(Source)
How do EC2 Spot Instances work?
When EC2 has unusued capacity, Amazon drops the price of instances, so you can bid whatever price you want for instance capacity (“Free market”)
An application has an urgent computing need that calls for large amounts of additional compute capacity. Which EC2 pricing model makes the most sense for this use case?
Spot Instances
(On-Demand might also work here but will be costlier. Spot is better since we need additional compute. Spot should not handle 100% of your compute capacity)
If a Spot Instance is terminated by Amazon EC2 after you have used it for 2.5 hours, how much are you charged for it?
2 hours at whatever price you bid for it.
If a Spot instance is terminated by EC2 (called a Spot Instance Interruption), you are not charged for the partial hour in which it ran.
If you terminate a spot instance after using it for 2.5 hours, how much do you pay for using the instance?
3 hours at whatever price you bid for it.
If you terminate a spot instance, you are charged for any hour in which the instance ran.
What is a Dedicated Host?
A Dedicated Host is a physical EC2 server dedicated for your use.
A user wants to use an existing server-bound software license to reduce compute costs. Which pricing model makes the most sense for this use case?
Dedicated Hosts
What is the pricing model for Dedicated Hosts?
- Dedicated Hosts can be purchased on-demand (hourly)
- Dedicated Hosts can be purchased as a reservation for up to 70% off the on-demand price.
What is Termination Protection for EC2 instances?
- Termination Protection helps prevent you from accidentally terminating your instances
On an EBS-backed EC2 instance, assuming default settings, what happens to the root EBS volume once the instance is terminated?
The root EBS volume is deleted
An application has short-term, spiky, or unpredictable workloads that cannot be interrupted. Which EC2 pricing model makes the most sense for this use case?
On-Demand Pricing
(Spot would not work since it can be interrupted)
A user wants the low cost and flexibility of EC2 but does not want to make a long-term commitment or an up-front payment. Which EC2 pricing model makes the most sense for this use case?
On-Demand Pricing
(Reserved is a long-term commitment;
Spot is not as much flexibility)
An application has steady-state and predictable usage. Which EC2 pricing model makes the most sense for this use case?
Reserved Instances
A users application requires a reserved capacity. What is the best pricing model for this use case?
Reserved EC2 Pricing
A user’s application has flexible start and end times. Which pricing model makes the most sense in this scenario?
Spot Instance Pricing
A user’s application is only feasible at low compute prices. Which pricing model makes the most sense for this use case?
Spot Instances
A User’s license does not support multi-tenancy of cloud deployments. Which EC2 pricing model makes the most sense for this use case?
Dedicated Hosts
A User’s regulatory requirements do not support multi-tenant virtualization. Which pricing model makes the most sense for this use case?
Dedicated Hosts
Is Termination Protection for EC2 instances enabled by default?
No
What is bootstrapping?
Launching commands when (and only when) a machine starts
What is the purpose of EC2 User Data ?
EC2 User Data is used to automate bootstrap tasks for an EC2 instance
Suppose you want to execute a command right when your EC2 instance starts up. What is the best way to do that?
Put the command in the EC2 User Data