Elastic Cloud Compute (EC2) Flashcards
List the 4 Pricing Options for EC2 Instances Most expensive to Least expensive
(1) Dedicated Host
(2) On-Demand
(3) Reserved
(4) Spot
What is the use case for On Demand EC2 Instances
- General production workloads
- Pay as you go
- Pay only for what you use.
What is the use case for Reserved EC2 Instances
A variation on on-demand where you sign a contract for 1-3 years to get big discounts
You pay less the more you pay upfront, and the longer the term
What is the use case for Spot EC2 Instances? How does it work?
- How it works
- Analogous to eBay. you “bid” on unused compute capacity, getting up to a 90% discount. The prices fluctuate with supply and demand.
- Typical Use Cases
- Fault-tolerant apps with flexible use patterns
- Spikey workloads
- Stateless applications
What is the use case for Dedicated Host EC2 Instances
Physical EC2 Instance for your own use. Typically used for hardware bound licenses.
What is different about a convertible reserved instance?
Cheaper than on demand, more expensive than reserved instances. Allows you to change the class of the EC2 instance.
What is the preferred method for granting access to AWS resources to your EC2 Instance
- Assign policies to roles .. then
- Assign those roles to resources
What is a bootstrap script used for?
Runs with root access, runs commands in your EC2 instance when starting.
Are security groups open or closed by default?
- Default security groups are CLOSED (inbound) by default.
- You must add access to the ports you want access to the EC2 instance. Outbound traffic is allowed.
- Up to 5 security groups may be associated with an EC2 instance
What is user data vs metadata?
User data is the startup script. Metadata is the data about the server. Both can be accessed with a specific URL to the EC2 instance.
http://169.254.169.254/latest/meta-data
What are the networking options with EC2 ordered from least to most performant?
(1) ENI - elastic Network Interface
(2) EN = Enhanced Network
(3) EFA - Elastic Fabric Adapter
What is the use case for ENI (Elastic Network Interface)
- Basic networking
- Low budget, high availability
- < 10gbps network speed
- Allows you to set up separate networks (Example: Production vs QA)
What is the use case for EN (Enhanced Networking)? What are the two types of EN?
- Higher Performance
- Lower Latency
- Network speeds from 10-100Gbps
- Variants include
- ENA (better choice)
- VF
What is the use case for EFA and what does it stand for?
- Very high performance
- Used for HPC and Machine learning
- OS-bypass for Linux only
What are the types of EC2 Placement Groups
- Cluster
- Partition
- Spread
Describe an EC2 “Cluster” placement group and its use case
- A number of EC2 instances in the same Availability Zone
- Cluster placement groups are only within one availability zone
- High throughput
- Low latency
- Only certain EC2 types can be in a placement group
Describe an EC2 “Spread” placement group and its use case? Whats the max number of instances in a Spread placement group?
- A group of EC2 instances, each instance on separate hardware (Separate Racks)
- Each rack has its own network and power source
- Can be in separate Availability Zone
- Use Cases
- Machines must be separate from each other
- Redundancy
- Lowers the risk of simultaneous failures
- Only certain EC2 types can be in a placement group (C,M,R)
- You can have a maximum of seven running instances per Availability Zone per group.
Describe an EC2 “Partition” placement group and its use case
- Reduces the risk of correlated hardware failures for an application
- Partition Placement group is divided into partitions that are on separate racks
- Partitions (racks) do not share power or network
- Instances you launch are distributed among up to 7 partitions (per Z) within the partition placement group
- Partitions in the partition placement group may exist in multiple availability zones in a region
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#placement-groups-partition

What is a “Spot Block”? How long can it last? Why would you use it?
This is when you set a Spot instance to not be terminated when its price exceeds your desired spot price for
- 1-6 hours.
- Allows a critical workload to finish.
How do you terminate a Spot Instance with a persistent spot request? Why would you do it this way?
- Cancel the Spot Request
- Terminate the instance
- If the spot request price is still available… And you terminate an instance… It would respond the instance
What is an EC2 Spot Fleet?
- Collection of instances(Spot and Reserved)
- Tries to maintain capacity with price restraints
What is the most popular strategy options for Spot Fleet pools?
- lowestPrice
How many EC2 Instances are you allowed per region?
- This can be raised with a support request
What can you do with unneeded reserve instances?
- Sell them on the reserve marketplace.
- Note this is only for standard reserve instances
What is a bastion host and what is it for?
- EC2 instance meant to withstand attacks
- Lives in public subnet
- Has limited SSH or RDS access
- Public or elastic IP
- Users log into the bastion host to administer hosts in the public subnet
What must be true to ensure you are not charged for an EIP (Elastic IP Address)
An Elastic IP address does not incur charges as long as all the following conditions are true:
- The Elastic IP address is associated with an EC2 instance.
- The instance associated with the Elastic IP address is running.
- The instance has only one Elastic IP address attached to it.
- The Elastic IP address is associated with an attached network interface.
Can you specify DENY rules in a security group?
No
What does the “AWS Systems Manager Run Command” allow?
Lets you remotely configure EC2 instances without SSH or RDP
What’s a fun fact about EN vs EFA
An Elastic Fabric Adapter (EFA) is simply an Elastic Network Adapter (ENA) with added capabilities. It provides all of the functionality of an ENA, with additional OS-bypass functionality. OS-bypass is an access model that allows HPC and machine learning applications to communicate directly with the network interface hardware to provide low-latency, reliable transport functionality.
The OS-bypass capabilities of EFAs are not supported on Windows instances. If you attach an EFA to a Windows instance, the instance functions as an Elastic Network Adapter, without the added EFA capabilities.
What states are you BILLED for an EC2 Instance?
- Billed
- Running
- Stopping (if hibernating)
- Not Billed
- Pending
- Stopping (if truly stopping)
- Shutting Down
- Stopped
- Terminated - unless its a reserve instance