EC2 Flashcards
different types of EC2 instances (7)
What are the 4 most important?
General Purpose, Compute Optimized, Memory Optimized, Storage Optimized, Accelerated Computing, Instance Feature, Measuring Instance Performance
What are the (3) parts of the AWS EC2 instance type naming convention:
m5:large
Instance class, generation, size within the instance class
EC2 Instance Type Great for a diversity of workloads such as web servers or code repositories
General Purpose
General Purpose EC2 Instance Type are great at balancing between ____________ (3)
Compute, Memory, Networking
EC2 Instance Type Great for compute-intensive tasks that require high performance processors
Compute Optimized
Which EC2 Instance Type would use the following:
Batch processing workloads, Media transcoding, High performance web servers, High performance computing (HPC), Scientific modeling & machine learning, Dedicated gaming servers
Compute Optimized EC2 Instance Type
EC2 Instance Type - Fast performance for workloads that process large data sets in memory
Memory Optimized
Which EC2 Instance Type would use the following:
High performance, relational/non-relational databases, Distributed web scale cache stores, In-memory databases optimized for BI (business intelligence), Applications performing real-time processing of big unstructured data
Memory Optimized
EC2 Instance Type Great for storage-intensive tasks that require high, sequential read and write access to large data sets on local storage
Storage Optimized
Can Security Groups be attached to multiple instances
Yes
Security Groups are locked down to a ____________
region/VPC combination
For EC2, where does the Security Group live?
Outside of the EC2 (if traffic is blocked the EC2 instance won’t see it)
What is a good security group practice for SSH access?
to maintain a separate security group of SSH access
What is it if your application is not accessible (timeout)
it is a security group issue
What error is given if you have an application error or the EC2 is not launched?
connection refused
In EC2 security groups, All inbound traffic is _____________ by default
Blocked
EC2 security groups - All outbound traffic is ____________ by default
authorised
SSH (Secure Shell) - log into a Linux instance (Port)
22
FTP (File Transfer Protocol) – upload files into a file share (Port)
21
SFTP (Secure File Transfer Protocol) – upload files using SSH (Port)
22
HTTP – access unsecured websites (Port)
80
HTTPS – access secured websites (Port)
443
General Purpose EC2 Instance Type are great at balancing between ____________ (3)
Compute
Memory
Networking
EC2 Instances Purchasing Options (7)
On-Demand Instances
Reserved
Savings Plans
Spot Instances
Dedicated Hosts
Dedicated Instances
Capacity Reservations
EC2 Instances Purchasing Options - short workload, predictable pricing, pay by second
On-Demand Instances
EC2 Instances Purchasing Options - (1 & 3 years)
* long workloads
* long workloads with flexible instances
Reserved
EC2 Instances Purchasing Options - (1 & 3 years) –commitment to an amount of usage, long workload
Savings Plans
EC2 Instances Purchasing Options - short workloads, cheap, can lose instances (less reliable)
Spot Instances
EC2 Instances Purchasing Options - book an entire physical server, control instance placement
Dedicated Hosts
EC2 Instances Purchasing Options - no other customers will share your hardware
Dedicated Instances
EC2 Instances Purchasing Options
- Pay for what you use:
- Linux or Windows - billing per second, after the first minute
- All other operating systems - billing per hour
- Has the highest cost but no upfront payment
- No long-term commitment
- Recommended for short-term and un-interrupted workloads, where you can’t predict how the application will behave
EC2 On Demand
- Up to 72% discount compared to On-demand
- You reserve a specific instance attributes (Instance Type, Region,Tenancy, OS) * Reservation Period – 1 year (+discount) or 3 years (+++discount)
- Payment Options – No Upfront (+), Partial Upfront (++), All Upfront (+++) * Reserved Instance’s Scope – Regional or Zonal (reserve capacity in an AZ)
- Recommended for steady-state usage applications (think database)
- You can buy and sell in the Marketplace
- Convertible Reserved Instance
- Can change the EC2 instance type, instance family, OS, scope and
tenancy - Up to 66% discount
- Can change the EC2 instance type, instance family, OS, scope and
EC2 Reserved Instances
- Get a discount based on long-term usage (up to 72% - same as RIs)
- Commit to a certain type of usage ($10/hour for 1 or 3 years)
- Usage beyond this pricing option is billed at the On-Demand price
- Locked to a specific instance family & AWS region (e.g., M5 in us-east-1)
- Flexible across:
- Instance Size (e.g., m5.xlarge, m5.2xlarge)
- OS (e.g., Linux, Windows)
- Tenancy (Host, Dedicated, Default)
EC2 Savings Plans
- Can get a discount of up to 90% compared to On-demand
- Instances that you can “lose” at any point of time if your max price is less than the current spot price
- The MOST cost-efficient instances in AWS
- Useful for workloads that are resilient to failure
- Batch jobs
- Data analysis
- Image processing
- Any distributed workloads
- Workloads with a flexible start and end time
- Not suitable for critical jobs or databases
EC2 Spot Instances
- A physical server with EC2 instance capacity fully dedicated to your use
- Allows you address compliance requirements and use your existing server- bound software licenses (per-socket, per-core, pe—VM software licenses)
- Purchasing Options:
- On-demand – pay per second for active Dedicated Host
- Reserved - 1 or 3 years (No Upfront,Partial Upfront,All Upfront)
- The most expensive option
- Useful for software that have complicated licensing model (BYOL – Bring Your
Own License) - Or for companies that have strong regulatory or compliance needs
EC2 Dedicated Hosts
- Instances run on hardware that’s dedicated to you
- May share hardware with other instances in same account
- No control over instance placement (can move hardware after Stop / Start
EC2 Dedicated Instances
- Reserve On-Demand instances capacity in a specific AZ for any duration
- You always have access to EC2 capacity when you need it
- No time commitment (create/cancel anytime), no billing discounts
- Combine with Regional Reserved Instances and Savings Plans to benefit from billing discounts
- You’re charged at On-Demand rate whether you run instances or not
- Suitable for short-term, uninterrupted workloads that needs to be in a
specific AZ
EC2 Capacity Reservations
GO TO VIDEO 43 MIN 5:45
Control over the EC2 Instance placement strategy
Placement Groups
What are the 3 types of Placement Groups
Cluster
Spread
Partition
a Placement group that is a Low-latency group in a single Availability Zone
Cluster Placement Groups
Instances across underlying hardware (max 7 instances per group per AZ)
Spread Placement Group
Instances across many different partitions (which rely on different sets of racks) within an AZ. Scales to 100s of EC2 instances per group (Hadoop, Cassandra, Kafka)
Partition
Placement Group
- Pros: Great network (10 Gbps bandwidth between instances with Enhanced Networking enabled - recommended)
- Cons: If the rack fails, all instances fails at the same time
- Use case:
- Big Data job that needs to complete fast
- Application that needs extremely low latency and high network throughput
Cluster Placement Group
Placement Group
- Pros:
- Can span across Availability Zones (AZ)
- Reduced risk is simultaneous failure
- EC2 Instances are on different physical hardware
- Cons:
- Limited to 7 instances per AZ per placement group
- Use case:
- Application that needs to maximize high availability
- Critical Applications where each instance must be isolated from failure from each other
Spread PLACEMENT GROUP
- Up to 7 partitions per AZ
- Can span across multiple AZs in the
- Up to 100s of EC2 instances
- The instances in a partition do not share racks with the instances in the other partitions
- A partition failure can affect many EC2 but won’t affect other partitions
- EC2 instances get access to the partition information as metadata
- Use cases: HDFS, HBase, Cassandra, Kafka
Partition Placements Groups
What does ENI stand for?
Elastic Network Interfaces
Logical component in a VPC that represents a virtual network card
Elastic Network Interfaces (ENI)
The ENI can have the following attributes (5)
- 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
You CAN create ENI independently and attach them on the fly (move them) on EC2 instances for failover
True
You can create ENI independently and attach them on the fly (move them) on EC2 instances for failover
TRUE
Are ENI’s bound to a specific AZ
Yes
What does EBS stand for?
Elastic Block Store
A network drive you can attach to your instances while they run
EBS Volume
It allows your instances to persist data, even after their termination
EBS Volume
They can only be mounted to one EC2 instance at a time (at the CCP level)
EBS Volume
Are EBS volumes bound to a specific AZ?
YES
It can be detached from an EC2 instance and attached to another one quickly
EBS Volume
What type of drive is an EBS volume?
Network Drive (not physical drive)
How can you move an EBS volume across AZs?
You need to snapshot it
Can you increase the capacity of the EBS volume drive over time
YES
By default, the root EBS volume is _______?
Deleted (attribute enabled)
By default, any other attached EBS volume attached to the EC2 instance is ______?
NOT deleted (attribute disabled)
Make a backup of your EBS volume at a point in time
EBS Snapshot
Is It necessary to detach and EBS volume to do snapshot??
NO, But it is recommended
Can you copy snapshots across AZ or Region???
YES
- Move a Snapshot to an ”archive tier” that is 75% cheaper
- Takes within 24 to 72 hours for restoring the archive
EBS Snapshot Archive
- Setup rules to retain deleted snapshots so you can recover them after an accidental deletion
- Specify retention (from 1 day to 1 year)
Recycle Bin for EBS Snapshots
EBS Snapshots Features - Force full initialization of snapshot to have no latency on the first use ($$$)
Fast Snapshot Restore (FSR)
What does AMI stand for??
Amazon Machine Image
A customization of an EC2 instance
AMI
- You add your own software, configuration, operating system, monitoring…
- Faster boot / configuration time because all your software is pre-packaged
AMI (Amazon Machine Image)
Are AMI’s built for a specific region?
YES
Can AMI’s be copied across regions?
YES
Does an AMI create an EBS snapshot??
YES
What do you need to use if you need a high- performance hardware disk for your EC2 instance?
EC2 Instance Store
EC2 Instance Store - Backups and Replication are your responsibility
TRUE
EBS Volumes come in 6 types
gp2 / gp3 (SSD)
io1 / io2 (SSD)
st1 (HDD)
sc1 (HDD)
General purpose SSD volume that balances price and performance for a wide variety of workloads
gp2 / gp3 (SSD)
Highest-performance SSD volume for mission-critical low-latency or high-throughput workloads
io1 / io2 (SSD)
Low cost HDD volume designed for frequently accessed, throughput- intensive workloads
st1 (HDD):
Lowest cost HDD volume designed for less frequently accessed workloads
sc1 (HDD)
3 characteristics of EBS Volumes
Size
Throughput
IOPS (I/O Per second)
Which 2 EBS Volumes can be used as boot volumes?
gp2/gp3 and io1/io2
- Cost effective storage, low-latency
- System boot volumes,Virtual desktops, Development and test environments
- 1 GiB - 16TiB
General Purpose SSD
- Baseline of 3,000 IOPS and throughput of 125 MiB/s
- Can increase IOPS up to 16,000 and throughput up to 1000 MiB/s independently
gp3
- Small ______ volumes can burst IOPS to 3,000
- Size of the volume and IOPS are linked, max IOPS is 16,000
- 3 IOPS per GB, means at 5,334 GB we are at the max IOPS
gp2
- Critical business applications with sustained IOPS performance
- Or applications that need more than 16,000 IOPS
- Great for databases workloads (sensitive to storage perf and consistency)
Provisioned IOPS (PIOPS) SSD
- (4 GiB - 16 TiB)
- Max PIOPS: 64,000 for Nitro EC2 instances & 32,000 for other
- Can increase PIOPS independently from storage size
io1/io2
________ have more durability and more IOPS per GiB
io2
Whats the $ cost for the io2 to have more durability and more IOPS per GiB than the io1??
None, it’s the same price
- (4 GiB – 64 TiB)
- Sub-millisecond latency
- Max PIOPS: 256,000 with an IOPS:GiB ratio of 1,000:1
io2 Block Express
Which EBS volume types Supports EBS Multi-attach
Provisioned IOPS (PIOPS) SSD
- Cannot be a boot volume
- 125 GiB to 16TiB
Hard Disk Drives (HDD)
- Big Data, Data Warehouses, Log Processing
- Max throughput 500 MiB/s – max IOPS 500
Throughput Optimized HDD (st1)
- For data that is infrequently accessed
- Scenarios where lowest cost is important
- Max throughput 250 MiB/s – max IOPS 250
Cold HDD (sc1):
- Attach the same EBS volume to multiple EC2 instances in the same AZ
- Each instance has full read & write permissions to the high-performance volume
EBS Multi-Attach – io1/io2 family
How many EC2 Instances can you connected to a EBS Multi- Attach?
16
What type of files system must you use with a EBS Multi-Attach?
Cluster-Aware
When you create an encrypted EBS volume, you get the following:
- Data at rest is encrypted inside the volume
- All the data in flight moving between the instance and the volume is encrypted
- All snapshots are encrypted
- All volumes created from the snapshot
EBS Encryption has a minimal impact on ____?
latency
EBS Encryption leverages keys from ______?
KMS (AES-256)
Copying an _____ snapshot allows _______?
unencrypted, encryption
Snapshots of encrypted EBS volumes are _______?
encrypted
What are the 4 steps to encrypting and unencrypted EBS volume?
- Create an EBS snapshot of the volume
- Encrypt the EBS snapshot ( using copy )
- Create new ebs volume from the snapshot ( the volume will also be encrypted )
- Now you can attach the encrypted volume to the original instance
What does EFS stand for?
Elastic File System
- Managed NFS (network file system) that can be mounted on many EC2
- Works with EC2 instances in multi-AZ
- Highly available, scalable, expensive (3x gp2), pay per use
EFS
What are these use cases for??
EFS
EFS uses which kind of protocol?
NFSv4.1
How do you control the access of EFS?
Security Groups
EFS is only compatible with which type of AMI?
Linux
What type of Encryption does EFS use at rest?
KMS
READ SLIDE 111 and 112
What are the 3 ways to Instantiate EC2’s quickly
Golden AMI
Bootstrap Using User Data
Hybrid: mix Golden AMI and User Data (Elastic Beanstalk)
Instantiate EC2’s quickly … Install your applications, OS dependencies etc.. beforehand and launch your EC2 instance
Golden AMI
Instantiate EC2’s quickly … For dynamic configuration
Bootstrap Using User Data
Instantiate EC2’s quickly .. mix Golden AMI and User Data (Elastic Beanstalk)
Hybrid