Section - EC2 Flashcards
What is a EC2?
Amazon Elastic Compute Cloud (EC2)
- Cloud virtual servers
- Use preconfigured template called Amazon Machine Image (AMI) to luch instances
- Deploy applications directly to EC2 instances
- You receive 750 Compute hours per month on Free Tier plan
- EC2 offers Loading balancing and Auto Scalling
Category: Compute
List 5 EC2 pricing plans?
- On-Demand - Fixed price billed down to the second
- Spot instances - Unused EC2 capacity, only if capacity is vailable (Cheapest option)(Work loads can be interrrupted) (can save up 90% off On-Demand prices)
- Reserved Instances (1 year or 3 years contracts)(can save up 75% off On-Demand prices)(Pay all upront, Partially upfront, No upfront ) (provides convertible types at 54% discount)
- Dedicated Hosts - Fully dedicated physical server to you (You can bring your own license)(can save up 70%off On-Demand prices)
- Savings plans - commit to compute usage (measured per hour) (1 to 3 years contract) (Does not provide capacity reservation)(can save up 72% off On-Demand prices)
EC2 pricing plan - On Demand Model?
- With On-Demand instances, you pay for compute capacity by the hour or the second depending on which instances you run.
- No longer-term commitments or upfront payments are needed.
- You can increase or decrease your compute capacity depending on the demands of your application and only pay the specified per hourly rates for the instance you use.
On-Demand instances are recommended for:
- Users that prefer the low cost and flexibility of Amazon EC2 without any up-front payment or long-term commitment
- Applications with short-term, spiky, or unpredictable workloads that cannot be interrupted
- Applications being developed or tested on Amazon EC2 for the first time
EC2 pricing plan - Spot instances Model?
- Amazon EC2 Spot instances allow you to request spare Amazon EC2 computing capacity for up to 90% off the On-Demand price.
- You can use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and test & development workloads.
- You also have the option to hibernate, stop or terminate your Spot Instances when EC2 reclaims the capacity back with two-minutes of notice.
Spot instances are recommended for:
- Applications that have flexible start and end times
- Applications that are only feasible at very low compute prices
- Users with urgent computing needs for large amounts of additional capacity

EC2 pricing plan - Dedicated Hosts Model?
- Amazon EC2 Dedicated Hosts allow you to use your eligible software licenses from vendors such as Microsoft and Oracle on Amazon EC2, so that you get the flexibility and cost effectiveness of using your own licenses, but with the resiliency, simplicity and elasticity of AWS.
- An Amazon EC2 Dedicated Host is a physical server fully dedicated for your use, so you can help address corporate compliance requirements.
- Amazon EC2 Dedicated Host is also integrated with AWS License Manager, a service which helps you manage your software licenses, including Microsoft Windows Server and Microsoft SQL Server licenses.
- Can be purchased On-Demand (hourly).
- Can be purchased as a Reservation for up to 70% off the On-Demand price.
- Can be used for regulatory requirements that may not support multi-tenant virtualization

EC2 pricing plan - Savings Plans Model?
- Savings Plans is a flexible pricing model offering lower prices compared to On-Demand pricing, in exchange for a specific usage commitment (measured in $/hour) for a one or three-year period.
- AWS offers three types of Savings Plans – Compute Savings Plans, EC2 Instance Savings Plans, and Amazon SageMaker Savings Plans.
- Compute Savings Plans apply to usage across Amazon EC2, AWS Lambda, and AWS Fargate.
- The EC2 Instance Savings Plans apply to EC2 usage, and Amazon SageMaker Savings Plans apply to Amazon SageMaker usage.
- You can easily sign up a 1- or 3-year term Savings Plans in AWS Cost Explorer and manage your plans by taking advantage of recommendations, performance reporting, and budget alerts.
- Savings Plans offers significant cost savings in exchange for a commitment to consistent amount of usage for a 1- or 3-year term.
- For example, the EC2 Instance Savings Plans offer up to 72% savings compared to On-Demand pricing on your Amazon EC2 Instances usage.
- The Amazon SageMaker Savings Plans offer up to 64% savings on your Amazon SageMaker services usage.

EC2 pricing plan - Reserved Instance Model?
- Reserved Instances provide you with a significant discount (up to 72%) compared to On-Demand Instance pricing.
- Reserved Instances are assigned to a specific Availability Zone, they provide a capacity reservation, giving you additional confidence in your ability to launch instances when you need them.
-
Standard Reserved Instances
- provide you with a significant discount (up to 72%) compared to On-Demand Instance pricing, and can be purchased for a 1-year or 3-year term.
- Customers have the flexibility to change the Availability Zone, the instance size, and networking type of their Standard Reserved Instances.
-
Purchase Convertible Reserved Instances
- If you need additional flexibility, such as the ability to use different instance families, operating systems, or tenancies over the Reserved Instance term.
- Convertible Reserved Instances provide you with a significant discount (up to 54%) compared to On-Demand Instances and can be purchased for a 1-year or 3-year term.
-
Scheduled Reserved Instances
- Purchasing Reserved Instances on a recurring schedule lets you pay for compute capacity by the hour and obtain a capacity reservation ahead of time for only the time periods you will need it.
- Example, Think of a heavy capacity requiring exercise a company would have to perform a couple of days every month.
- You can choose between three payment options when you purchase a Standard or Convertible Reserved Instance.
- With the All Upfront option, you pay for the entire Reserved Instance term with one upfront payment. This option provides you with the largest discount compared to On-Demand Instance pricing.
- With the Partial Upfront option, you make a low upfront payment and are then charged a discounted hourly rate for the instance for the duration of the Reserved Instance term.
- The No Upfront option does not require any upfront payment and provides a discounted hourly rate for the duration of the term.
EC2 Instance Types - General Purpose?
General purpose instances provide a balance of compute, memory and networking resources, and can be used for a variety of diverse workloads. These instances are ideal for applications that use these resources in equal proportions such as web servers and code repositories.
EC2 Instance Types - Compute Optimized?
Compute Optimized instances are ideal for compute bound applications that benefit from high performance processors. Instances belonging to this family are well suited for batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines, machine learning inference and other compute intensive applications.
EC2 Instance Types - Memory Optimized?
Memory optimized instances are designed to deliver fast performance for workloads that process large data sets in memory. in memory caching applications.
EC2 Instance Types - Accelerated Computing?
Accelerated computing instances use hardware accelerators, or co-processors, to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.
EC2 Instance Types - Storage Optimized?
Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications. e.g. No SQL
Bootstrap scripts?
- A bootstrap script is a script that runs when the instance first runs;
- It passes user data to the EC2 instance and can be used to install applications(Like web server and databases), as well as do updates and more.

What is EC2 Metadata?

- EC2 metadat is simple data about your EC2 instance.
- This can include information such as private IP address, public IP address, hostname, security groups etc..

User Data vs. Metadata ?
- User data is simple bootstrap scripts
- Metadata is data about your EC2 instances
- You can use bootstrap scripts(user data) to access metadata.
What the 3 types of virtual networking cards for AWS EC2?
-
ENI (Elastic Network Interface)
- For basic; day-to-day networking
-
EN (Enhanced Networking)
- Uses single root I/O virtualization (SR-IOV) to provide high performance.
-
EFA (Elastic Fabric Adapter)
- Accelerates High Performance Computing (HPC) and machine learning applications.

What is an ENI (Elastic Network Interface)?
An ENI is simply a virtual network card that allows:
- Private IPv4 Addresses
- Public IPv4 Address
- MAC Address
- 1 or More Security Groups
- Many IPv6 Addresses
Common ENI (Elastic Network Interface) Use cases?
- Create a management network
- Use network and security appliances in your VPC.
- Create dual-homed instances with workloads / roles on distinct subnets.
- Create a low-budget; high-availability solution.
What is an EN (Enhanced Networking)?
- For High-Performance Networking between 10 Gbps - 100 Gbps
- Single Root I/O Virtualization (SR-IOV)
- SR-IOV provides higher I/O performance and lower CPU utilization
- Performance
- Provides higher bandwidth, higher Packet Per Second (PPS) performance; and consistently lower inter-instance latencies.
ENA Vs. VF?
Depending on your instance type; enhanced networking can be enabled using:
- ELASTIC NETWORK ADAPTER (ENA)
- Supports network speeds of up to 100 Gbps for supported instance types.
- INTEL 82599 VIRTUAL FUNCTION (VF) INTERFACE
- Supports network speeds of up to 10 Gbps for supported instance types.
- Typically used on older instances
- In any scenario question:
- Choose ENA over VF interface

What is an EFA (Elastic Fabric Adapter)?
- A network device you can attach to your Amazon EC2 instance to accelerate High Performance Computing (HPC) and machine learning applications.
- Provides lower and more consistent latency and higher throughput than the TCP transport traditional used in cloud-based HPC systems.

EFA (Elastic Fabric Adapter) can use OS-BYPASS
- It makes it a lot faster with much lower latency.
- OS-bypass enables HPC and machine learning application to bypass the operating system system kernel and communicate directly with the EFA device. Not currently supported with Windows - Only Linux.
What are the 3 Types of Placement Groups?
- Cluster
- Spead
- Partition
Cluster Placement groups?
- Grouping of instances within a single Availability Zone.
- Recommended for applications that need low network latency; high network throughput or both.
- NB: Only certain instance types can launched into cluster placement group



