EC2 Flashcards
What is EC2?
A web service that provides secure, resizable compute capacity in the cloud
What’s the difference between a public and private IP address?
How does a private IP connect to the web?
What must be defined for a private IP?
How can you connect to a private IP?
A public IP must be unique on the web. A private IP must be unique within your VPC.
A private IP uses a NAT to connect to the web.
A private IP must have defined range
You must be connected to the private network via a VPN.
When would you use an elastic IP?
What should you typically do instead of using an elastic IP?
You would use an elastic IP to connect directly to connect a static IP address up to an EC2 instance. However, this is bad practice. Instead the DNS name should be used or a load balancer should expose the instance to the web and connect to the EC2 instance via a private IP
The DNS name should be used or a load balancer should expose the instance to the web and connect to the EC2 instance via a private IP
Which IP version does elastic IP use?
How many EC2 instances can an elastic IP be attached to at a time?
IPv4
1
What happens to the public IP address of an EC2 instance when it is restarted?
It can change.
What is a spot instance?
Compute that can be requested on demand with up to a 90% discount.
How does pricing work for an EC2 Spot instance?
What happens when you go over the max price threshold?
What two variables does the hourly price depend on?
What happens if the current spot price goes over your max price?
What are the types of requests available of spot instances?
How would you terminate a persistent spot request?
Define max spot price and get the instance while current spot price < max
You lose the spot instance when price goes over the max
Hourly spot price varies based on demand/availability
If the current spot price > your max price you can choose to stop or terminate you instance with a 2 minutes grace period
One time or persistent.
To terminate spot requests, you must first cancel your request, then terminate your instances.
What is a spot block instance?
Can the spot block instance be interrupted?
Spot blocks (Fixed duration instances) are designed not to be interrupted and will run continuously for the duration you select, even if the spot market price goes above your threshold.
In rare situations, Spot blocks may be interrupted due to Amazon Web Services capacity needs. In these cases, we will provide a two-minute warning before we terminate your instance (termination notice), and you will not be charged for the affected instance(s).
What is a spot fleet
How do you define a spot fleet launch pool?
When does a spot fleet stop launching instances?
What are the 3 strategies to allocate spot instances in a fleet and when would you use each?
Set of Spot Instances + (Optional) On-Demand Instances that will will try to meet the target capacity with price constraints
Pools are defined with instance types, OS and AZ. There can be multiple pools.
When the capacity or max cost is reached.
Lowest prices - Use for small jobs where the likelihood of interruption is low
Diversified - (The Spot Instances are distributed across all Spot capacity pools.) If your fleet is large or runs for a long time, you can improve the availability of your fleet by distributing the Spot Instances across multiple pools using the diversified strategy
Capacity - (pool with optimal number of instances). strategy for workloads where the possibility of disruption must be minimized because restarting the job would be expensive and the preference for certain instance types matters.
What is a placement group?
What are the types of placement groups and what are they good for?
A placement group gives you control over the EC2 Instance placement strategy.
Cluster - Cluster instances into a low latency group in a single AZ. Same rack. High failure risk
Useful for big data jobs that need to complete fast
Application that needs extremely low latency and high network throughput
Spread - Spreads instances across underlying hardware (max 7 instances per group per AZ) - Used to minimize the failure risk.
Critical applications
Minimize failure risk
Spans across AZs
Limit to how big your placement group can be (7 instances per AZ)
Partition - Spreads instances across many different partitions (Which rely on different sets of racks) within an AZ. Scales to 100s of EC2 instances per group
A partition failure won’t affect other partitions
Big data applications that are partition aware Hadoop, Cassandra, Kafka
What is an Elastic Network Interface (ENI)?
Represents a virtual network card
What are the 5 most important attributes that an ENI can have?
PEPSM
Has primary private IPv4 and one or more secondary IPv4 One elastic IP One public IP One or more security groups A mac address
How does attaching and detaching work?
Is an ENI bound to an AZ?
- You can create an ENI independently and attach them on the fly for failover
- Bound to a specific AZ
- Gives you more control than an automatically created network interface because they won’t be deleted when an instance is terminated
Yes
What happens when an EC2 instance is hibernated?
What are 2 use cases for EC2 instance hibernation?
What are the instance families that support hibernation?
How long can an instance be hibernated for?
OS is not stopped or restarted
The in-memory ram is preserved by writing it to an encrypted ESB
Allow long-running processing to continue running
Services that take a long time to initialize
General Purpose SSD (gp2 and gp3) or Provisioned IOPS SSD (io1 and io2).
60 Days
What is EC2 Nitro?
Why would you need EC2 Nitro?
Underlying Platform for the next gen or EC2 Instances.
Allows for better performance (64k EBS IOPS vs 32k). It also has better underlying security