AWS EC2 Flashcards
List the EC2 instance categories.
Spot Instance
On-Demand Instances
Reserved Instances
Explain what an AWS ec2 spot instance is and how it functions?
An AWS EC2 Spot Instance is a type of virtual machine in Amazon EC2 that allows you to use spare Amazon EC2 computing capacity at up to 90% discount compared to On-Demand pricing. However, they come with the trade-off of being interruptible by AWS when the capacity is needed for On-Demand instances.
🧠 Key Concepts:
✅ What is it?
A Spot Instance is an EC2 instance that AWS can terminate with a 2-minute warning when it needs the capacity back. You can request these instances at a lower price, making them great for cost-saving in non-critical or flexible workloads.
⚙️ How it Functions:
Requesting a Spot Instance: You request a Spot Instance like any other EC2 instance, but you specify that it's a Spot Instance. You can either specify the maximum price you're willing to pay or use the default setting (pay current spot price). AWS Matches Supply & Demand: When AWS has excess capacity, it fulfills your request at the current Spot price, which fluctuates based on availability and demand. Instance is Launched: If capacity is available and your bid is high enough (or the default pricing is sufficient), the Spot Instance is launched. Possible Interruption: If AWS needs the capacity back (e.g., for On-Demand usage), your Spot Instance is terminated, stopped, or hibernated with a 2-minute warning. You should always design your applications to handle interruptions gracefully.
Explain what an ec2 reserved instances?
An EC2 Reserved Instance (RI) is a pricing option in Amazon EC2 (Elastic Compute Cloud) that allows you to commit to using a specific instance type in a particular region or Availability Zone for a 1- or 3-year term in exchange for significant cost savings (up to 75%) compared to On-Demand instance pricing.
Key Concepts:
- ✅ Reservation, not a physical instance: A Reserved Instance is not a separate EC2 instance, but a billing discount applied to matching On-Demand usage.
- 💸 Lower cost: You pay less compared to On-Demand prices because you commit to using it long-term.
- 📍 Scoped to Region or Availability Zone:
- Regional RIs give flexibility across AZs.
- Zonal RIs reserve capacity in a specific AZ.
- ⚙️ Attributes must match for the discount to apply:
- Instance type (e.g.,
t3.medium
) - Platform (Linux/Windows)
- Tenancy (Shared or Dedicated)
- Scope (Region/AZ)
- Instance type (e.g.,
Payment Options:
1. All Upfront (AURI) – Pay everything at once.
2. Partial Upfront (PURI) – Pay some now, rest monthly.
3. No Upfront (NURI) – Pay monthly, no initial payment.
Use Cases:
- Predictable workloads
- Applications with steady-state usage
- Long-running production systems
If you’d like, I can quiz you on this to reinforce your understanding. Want a question?
What is a on demand instance?
You use what you need and pay as you go.
When using a reserved instance are you guaranteed you will be able to provision the EC2 instance when need, even if the AWS region is at 100% capacity.
Yes
When using spot instances are you gaurenteed resources?
no the instance may be taken back at any point in time with 2 minutes warning
When using spot instance can the instance be stoped at any time?
yes, the instance can be stopped at any time and recovered by AWS
When using reserved instance can the instance be stoped at any time?
No reserved instances are guaranteed and will not be recovered by AWS at any point unless there’s a failure
When using on-demand instance can the instance be stoped at any time?
No.
With on demand instance are you gaurenteed resources
No.
Is a spot instance the best choice for a situation where the load is constantly changing and the workload cannot be interrupted?
no this is not a good choice to use a sparked instance in this situation as the Lord um says that it cannot be interrupted and this could be the case for a spot instance and an On-Demand instance is probably better or a reserved instance
Is spot instances a lower cost then other instance types?
yes spot instance is a lower cost than the on-demand or reserved
What sort of processes are best suited to spot instances?
The process is best suited to using spot instances are where the process can be interrupted at any point in time and recovered at a later point, started tart again
If you know you will need an instance 24/7 365, what instance type is best suited to get the best value? The workload can not be interrupted.
Reserved as it gives you the low price as you pay upfront and are guarantee the resources.
For AWS Ec2 instances, when you buy a reserved instance is it in all availability zones?
Great question!
When you purchase an AWS EC2 Reserved Instance (RI), it is not automatically available in all Availability Zones (AZs). Here’s how it works:
✅ Scope of Reserved Instances
You can choose one of two scopes when purchasing a Reserved Instance:
-
Availability Zone (AZ) Scoped
- Bound to a specific Availability Zone (e.g.,us-east-1a
)
- Provides a capacity reservation, ensuring availability of the instance in that AZ.
- Best when you need guaranteed capacity in a specific AZ.
-
Region Scoped
- Applies to any Availability Zone within the region (e.g.,us-east-1
)
- Does not reserve capacity (i.e., no guaranteed availability)
- More flexible — EC2 usage across any AZ in the region can use the discounted rate.
Summary Table:
Let me know if you’d like a follow-up question on EC2 RIs or a scenario-based quiz to test your understanding!
Scope | Applies To | Capacity Reservation | Flexibility |
|——-|————|———————-|————-|
| AZ Scoped | Specific Availability Zone | ✅ Yes | ❌ Less flexible |
| Region Scoped | Any AZ in the region | ❌ No | ✅ More flexible |
In AWS and EC2, can you transfer a reserved instances from one availability zone to another ?
No, you cannot transfer a Reserved Instance (RI) directly between Availability Zones.
However, you can modify a Zonal Reserved Instance to change its Availability Zone within the same region.
This flexibility applies only to Standard RIs, not Convertible RIs.
In AWS and EC2, if you have a large reserved instance and no longer need it but need a number of smaller instances, what can you do?
You can create a number of small instances from a large reserved instance.
In AWS and EC2, what is the default number of instances you can create ?
20
In AWS and EC2, how many elastic IPs do you get by default?
5
In AWS and EC2, when you reach the default max limits of EIPs or Instances, what can you do to get more resources?
You can create a service quota increase from AWS to give you more resources
Is ES2 instances fault tolerant?
No, you have to architect a solution with fault tolerance; no, it’s a single virtual machine sitting on a server in a rack and susceptible to fault, um, according to the rack. very little guarantees are given by AWS
Explain how ES2 instances integrate with AWS IAM?
- Amazon EC2 (ES2) instances integrate with AWS IAM using IAM roles that provide temporary credentials to applications on the instance.
- These roles are assigned when launching the instance, and credentials are automatically rotated and made available via the instance metadata service.
- This allows secure, keyless access to AWS services like S3 or DynamoDB from EC2 without hardcoding credentials.
What is the easiest way for application running on a EC2 instance to use the AWS service API’s with out needing IAM keys?
Create a IAM role for EC2 instance.
What is EC2?
Elastic cloud compute.