AWS EC2 Flashcards
What does EC2 stand for?
Elastic Computer Cloud
EC2 provides _____ and _____ compute capacity in the cloud.
- Secure
2. Resizable
True or False: EC2 is a VM hosted on premises in your own data center.
False.
EC2 is like a VM, but is hosted in AWS’s datacenters.
EC2 instances are restricted in capacity and processing power.
No, you get the capacity & compute power your want when you need it.
What level of control do you have over your own EC2 instances?
Complete control
With EC2, you pay ____________.
You pay only for what you use.
With EC2, you can _____ and _____ your EC2 instances whenever you need.
Grow and Shrink
What are the 4 pricing options for EC2?
- On-Demand
- Reserved
- Spot
- Dedicated
What is the key value of the On-Demand Pricing Option in EC2?
Pay by the hour or the second, depending on the type of instance you run.
What is the key value of the Reserved Pricing Option in EC2?
Reserve capacity for 1 or 3 years. Up to 72% discount on the hourly charge.
Spot Pricing Option in EC2 value?
Purchase unused capacity at a discount of up to 90%. Prices fluctuate with supply & demand.
Dedicated Pricing Option in EC value?
A physical EC2 server dedicated for your use. Most expensive option.
What’s the most expensive pricing option available for EC2?
Dedicated
What’s the least expensive pricing option available for EC2?
Depends on work-load. If small, intermittent loads then On-Demand. If consistent, long-term loads, then Reserved.
When you attach or detach roles to running EC2 instances, do you need to stop or terminate the instances?
No. You can attach or detach roles to running EC2 instances without having to stop or terminate those instances.
What category of services does EC2 fall under?
Compute
SSH is what port?
22 (Linux)
Port 3389 is used by what application and OS?
Windows RDP (Remote Desktop Connection)
HTTP is for what and uses what port?
Web browsing and port 80.
What port and purpose does HTTPS serve?
Encrypted Web Browsing (SSL) and Port 443.
What is are Security Groups in regards to EC2?
Security groups are virtual firewalls for your EC2 instance. By default, everything is blocked.
In order to be able to communicate to your EC2 instances via SSH/RDP/HTTP, you will need to __________?
Open up the correct ports.
In order to let anyone/anything have access to your EC2 instance, you must designate this IP address:
To let everything in, you use
0.0.0.0/0
What is a bootstrap script?
A script that runs when the instance first runs.
When you add a bootstrap script, what impact does it have on booting up the EC2 instance? What does it allow you to do?
- Adds to the amount of time it takes to boot the instance.
2. Automate the installation of application.
What does the following bootstrap script do? --------------- #!/bin/bash yum update -y yum install httpd -y service httpd start cd /var/www/html echo "<h1>Hello Cloud Gurus</h1>" > index.html
- Updates the operating system
- Installs web service httpd
- Starts the web service
- changes directory to main location for web service files.
- Creates index.html file
When creating a new instance, how can you apply a bootstrap script?
When creating a new instance, you can either:
- Paste the bootstrap.sh text into “Advanced Details” under “Configure Instance Details”
- Attach the file (in the same location
Changes to security groups take effect ___________.
Immediately.
You can have _______ EC2 instances within a security group.
Any number
You can have ________ security groups attached to EC2 instances.
Multiple
For an EC2 instance, what’s the default setting on allowing inbound traffic?
All inbound traffic is blocked by default.
For an EC2 instance, what’s the default setting on outbound traffic?
All outbound traffic is allowed.
A ________ script is a script that runs when the instance first runs.
bootstrap
What does a bootstrap script do?
Passes user data to the EC2 instance and can be used to install applications (like web servers and databases), as well as do updates and more.
What is EC2 metadata?
Data about your EC2 instance.
What can EC2 metadata provide?
It can include information such as private IP address, public IP address, hostname, security groups, etc.
What application do you use to retrieve metadata about your EC2 instance?
Use the curl command to query metadata about your EC2 instance.
curl http://169.254.169.254/latest/meta-data/local-ipv4 > myIP.txt
It uses curl to connect to an API that returns your local-ipv4 values and writes your outbound IP address to a text file called myIP.txt
What is this script useful for and final result? ------------ #!/bin/bash yum update -y yum install httpd -y service httpd start cd /var/www/html echo "<h1>My IP is" > index.html curl http://169.254.169.254/latest/meta-data/public-ipv4 >> index.html echo "</h1>" >> index.html
- Bootstrap script for EC2 instance.
- Installs a webservice and builds an index.html file.
- Uses curl to grab the user’s IP address
- Displays the IP address.
In EC2, what is user data?
User data is simply bootstrap scripts.
In EC2, what is metadata
Metadata is data about your EC2 instance.
You can use ___________ (______) to access metadata.
You can use bootstrap scripts (user data) to access metadata.
Define ENI.
ENI - Elastic Network Interface
. Can but used in networking w/ EC.
. Used for basic, day-to-day networking.
You can attached ____ different types of virtual networking cards to your EC2 instances.
3 - three
ENI - Elastic Network Interface
EN - Enhanced Networking
EFA - Elastic Fabric Adapter
Define EN.
EN - Enhanced Networking
Uses single root I/o virtualization (SR-IOV) to provide high performance.
When you’re concerned about special licensing requirements in regards to an EC2 instance, think of this kind of pricing model.
Dedicated.
An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts allow you to use your existing per-sock, per-core or per-VM software licenses, including Windows Server, Microsoft SQL Server and SUS Linux Enterprise Server.
An Amazon EC2 _________ is a physical server with EC2 instance capacity fully dedicated to your use.
Dedicated Host
__________ allow you to use your existing per-sock, per-core or per-VM software licenses, including Windows Server, Microsoft SQL Server and SUS Linux Enterprise Server.
Dedicated Hosts
If you have an existing per-core license for Microsoft SQL Server that you’d need to use on EC2, you should use this pricing method.
Dedicated Host
What are the three types of placement groups in EC2?
- Cluster
- Spread
- Partition
What kind of placement group is a grouping of instances within a single Availability Zone? How are these recommended to be used? Are there any limitations on this grouping?
- Cluster Placement Group
- Recommended for applications that need low network latency, high network throughput, or both.
- Only certain instance types can be launched into a cluster placement group.
What kind of placement group is a group of instances that are each placed on distinct underlying hardware? How are these recommended to be used? And what’s the study tip for scenario questions?
- Spread placement groups
- Spread placement groups are recommended for applications that have a small number of critical instances that should be kept separate from each other.
- Used for Individual Instances
What kind of placement group is a grouping of instances has its own set of racks with their own network and power source?
- Partition Placement Groups
Each partition placement group has its own set of racks. Each rack has its own network and power source. No two partitions within a placement group share the same racks, allowing you to isolate the impact of hardware failure within your application.
EC2 divides each group into logical segments called partitions.
Study Tip: Used for Multiple Instances
What are the 3 types of placement groups?
- Cluster Placement Groups - low network latency, high network throughput
- Spread Placement Groups - individual critical EC2 instances
- Partition Placement Groups - multiple EC2 instances; HDFS, HBase and Cassandra
A ______ placement group can’t span multiple Availability Zones, whereas a ______ placement group and _______ placement group can.
A cluster placement group can’t span multiple Availability Zones, whereas a spread placement group and partition placement group can.
Only _____ _____ __ ________ can be launched in a placement group (compute optimized, GPU, memory optimized, storage optimized).
Only certain types of instances can be launched in a placement group (compute optimized, GPU, memory optimized, storage optimized).
AWS recommends ___________ instances within cluster placement groups.
homogenous
You can move an existing instance into a placement group. Before you can move the instance, the instance ___________________. You can move the instance using AWS ____ or an AWS ____, but you can’t do it via the console yet.
must be in a stopped state
AWS CLI or AWS SDK
These EC2 instances let you take advantage of unused EC2 capacity in the AWS Cloud.
Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS Cloud.
Spot Instances are available at up to a 90% discount compared to On-Demand prices.
When do you use spot instances?
For stateless, fault-tolerant or flexible applications.
Applications such as big data, containerized workloads, CI/CD, high-performance computing (HPC), and other test and development workloads.
To use Spot Instances, you must first decide on your ___________.
Maximum Spot price.
The instance will be provisioned as long as the Spot price is BELOW your maximum Spot price.
You may also use a _____ ______ to stop your Spot Instances from being terminated even if the Spot price goes over your max Spot price. You can set this for between ______________ (currently).
Spot block. Lasts 1 to 6 hours.
Spot instances are useful for these tasks:
- Big data and analytics
- Containerized workloads
- CI/CD and testing
- Image and media rendering
- High-Performance Computing (HPC)
Spot instances are not good for:
- Persistent workloads
- Critical Jobs
- Databases
A ____ ____ is a collection of Spot instances and (optionally) on-demand instances.
Spot fleet
What does the Spot Fleet attempt to do? How is the request for Spot Instances fulfilled? What does the Spot Fleet attempt to maintain?
- The Spot Fleet attempts to launch the number of Spot instances and On-Demand instances to meet the target capacity you specified in the Spot Fleet request.
- The request for Spot Instances is fulfilled if there is available capacity and the maximum price you specified in the request exceeds the current Spot price.
- The Spot Fleet also attempts to maintain its target capacity fleet if your Spot Instances are interrupted.
Spot Fleets will try and match the __________ with your price restraints.
Target capacity
What are 3 important points about launch pools?
- Setup different launch pools. Define things like EC2 instance type, operating system, and Availability Zone.
- You can have multiple pools, and the fleet will choose the best way to implement depending on the strategy you define.
- Spot fleets will stop launching instances once you reach your price threshold or capacity desire.
Name the strategies for using Spot Fleets. Which is the most popular? What’s the default strategy?
- capacityOptimized
- diversified
- lowestPrice
- InstancePoolsToUseCount
Most popular = lowestPrice
Default = lowestPrice
Define capacityOptimized strategy for EC2 Spot Fleets.
The spot instances come from the pool with optimal capacity for the number of instances launching.
Define “diversified” strategy for EC2 Spot Fleets.
The Spot Instances are distributed across all pools.
Define “lowestPrice” strategy for EC2 Spot Fleets.
The Spot Instances come from the pool with the lowest price. This is the default strategy.
Define “InstancePoolsToUseCount” strategy for EC2 Spot Fleets.
The Spot Instances are distributed across the number of Spot instance pools you specify. This parameter is only valid when used in combination with lowestPrice.
Spot Instances save up to ____% of the cost of On-Demand instances.
90%
True or False: Spot Instances are useful for any type of computing where you don’t need persistent storage.
True
What do you use to keep spot instances from terminating?
Spot Block
A ____ _____ is a collection of Spot Instances and (optionally) On-Demand Instances.
Spot Fleet
Can you merge EC2 placement groups?
No. You cannot merge placement groups.
True or False: EC2 Hibernation is available for On-Demand instances, but not for Reserved instances.
False.
EC2 Hibernation is available for On-Demand instances AND for Reserved instances.
EC2 Hibernation instance can’t be hibernated for more than _______ days.
EC2 Hibernation instance can’t be hibernated for more than 60 days.
What operating systems allow EC2 hibernation?
Windows, Amazon Linux 2 AMI, and Ubuntu.
What instance families allow EC2 Hibernation?
C3, C4, C5, M3, M4, M5, R3, R4, and R3 instance families allow EC2 hibernation.
For EC2 Hibernation, what’s the upper value for the amount of instance RAM allowed?
For EC2 Hibernation, instance RAM must be less than 150 GB.
Why is a hibernated EC2 instance faster to boot up?
With EC2 Hibernation, it is much faster to boot up because you do not need to reload the operating system.
EC2 ________ preserves the in-memory RAM on persistent storage (EBS).
EC2 hibernation preserves the in-memory RAM on persistent storage (EBS).