EC2 Flashcards
What does EC2 stand for ?
Elastic Compute Cloud
What kind of as a service is ec2?
IaaS
EC2 conists of what?
- renting virtual machines (ec2)
- storing data on virtual drives (EBS)
- distributing load across machines (ELB)
- scaling services using auto-scaling group (ASG)
Knowing EC2 is fundamental to understand what?
how the Cloud works
what OS are available in ec2?
Linux, Windows, Mac OS
What are the config and sizing options
CPU, RAM, storage space
how is the amount of storage space configured?
Network-Attached (EBS and EFS); hardware (ec2 instance store)
ec2 network card
speed of card; public ip address
firewall roles
security group
Bootstrap script (configure at first launch):
EC2 User Data
what does bootstrapping mean?
launching commands when a machine starts
What is EC2 User Data Script for?
bootstrap our instances
When is the ec2 user data script run and how many times?
script is only run once at the instance first start
EC2 user data is used to automate boot tasks such as:
- Installing updates
- Installing software
- Downloading common files from the internet
- Anything you can think of
The EC2 User Data Script runs with
the root user
what is the naming convention for aws ec2 instance types?
instance class (letter), generation (number), size within the instance class name (example: m5.2xlarge)
what are ec2 instance general purpose type?
Great for a diversity of workloads such as web servers or code repositories
ec2 general purpose type balance between:
- Compute
- Memory
- Networking
ec2 compute optimized type
Great for compute-intensive tasks that require high performance processors: • Batch processing workloads • Media transcoding • High performance web servers • High performance computing (HPC) • Scientific modeling & machine learning • Dedicated gaming servers
EC2 Instance Types – Memory Optimized
Fast performance for workloads that process large data sets in memory
use cases for memory optimized
Use cases:
• 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
EC2 Instance Types – Storage Optimized
Great for storage-intensive tasks that require high, sequential read and write access to large data sets on local storage
storage optimized use cases
Use cases:
• High frequency online transaction processing (OLTP) systems
• Relational & NoSQL databases
• Cache for in-memory databases (for example, Redis)
• Data warehousing applications
• Distributed file systems
what are the ec2 instance types?
general-purpose, compute-optimized, memory-optimized, storage optimized
Security Groups are the fundamental of
network security in AWS
security groups control what in ec2?
control how traffic is allowed into or out of our EC2 Instances.
Security groups only contain ___ rules
allow rules
Security groups rules can reference by
IP or by security group
Security groups are acting as a
“firewall” on EC2 instances
Security groups regulate
- Access to Ports
- Authorised IP ranges – IPv4 and IPv6
- Control of inbound network (from other to the instance)
- Control of outbound network (from the instance to other)
Security groups can be attached to
multiple instances
Security groups are Locked down to a
region / VPC combination
Security groups Does live “outside” the EC2 – if
traffic is blocked the EC2 instance won’t see it
Security groups It’s good to maintain one separate security group for
SSH access
Security groups If your application is not accessible (time out), then it’s a
security group issue
Security groups If your application gives a “connection refused“ error, then it’s an
application error or it’s not launched
Security groups All inbound traffic is blocked
by default
Security groups All outbound traffic is authorised
by default
Security groups Classic Ports to know
- 22 = SSH (Secure Shell) - log into a Linux instance
- 21 = FTP (File Transfer Protocol) – upload files into a file share
- 22 = SFTP (Secure File Transfer Protocol) – upload files using SSH
- 80 = HTTP – access unsecured websites
- 443 = HTTPS – access secured websites
- 3389 = RDP (Remote Desktop Protocol) – log into a Windows instance
port 22 =
SSH (Secure Shell) - log into a Linux instance
port 21 =
FTP (File Transfer Protocol) – upload files into a file share
port 22 = SFTP (Secure File Transfer Protocol) –
upload files using SSH
port 80 =
HTTP – access unsecured websites
port 443 =
HTTPS – access secured websites
port 3389 =
RDP (Remote Desktop Protocol) – log into a Windows instance
ssh is available for what OS?
linux, macos, windows >=10
putty is available for what os?
windows
ec2 instance connect available for what os
linux, mac, windows
what is EC2 Instance Connect?
Connect to your EC2 instance within your browser with No need to use your key file that was downloaded
how does ec2 instance connect work? “magic”
temporary key is uploaded onto EC2 by AWS
EC2 Instance Connect works out of the box with
Amazon Linux 2
if using EC2 Instance Connect what port needs to be open?
22
What are the EC2 Instances Purchasing Options?
on-demand instances, reserved, spot instances, dedicated hosts, dedicated instances
what are On-Demand Instances?
short workload, predictable pricing
what is the minimum duration for reserved instances
1 year
what are the workloads for Reserved Instances:
long workloads
Convertible Reserved Instances:
long workloads with flexible instances
Scheduled Reserved Instances:
run a specific time and day
Spot Instances:
short workloads, cheap, can lose instances (less reliable)
Dedicated Hosts:
book an entire physical server, control instance placement
Dedicated Instances:
no other customers will share your hardware
for ec2 on demand you pay for
what you use
for ec2 on demand linux you pay for
billing per second, after the first minute
for ec2 on demand windows and macos you pay for
billing per hour
ec2 on demand has the highest __ BUT no __ __
cost but no upfront payment
ec2 on demand has no ___ ___ commitment
long term commitment
EC2 ondemand is recommended for what type of workloads where ___?
Recommended for short-term and un-interrupted workloads, where you can’t predict how the application will behave
what is the max discount percentage of reserved instances to on demand?
72%
what is the reservation period impact on discount?
1 year = discount, 3 = more
what are the purchasing options for ec2 reserved instance?
no upfront costs, partial upfront, or all upfront
when is reserved instance recommended?
for easy steady-state usage apps (db)
what is a convertible reserved instance?
can change ec2 instance type
max discount for convertible reserved instance?
up to 45%
What scheduled reserved instances?
launch within time window you reserve, require fraction of day/week/month
what is the time commitment for scheduled reserved instances?
1 year only
max discount for spot instances compareed to on-demand
90%
what are spot instances?
instances you can lose at any point of time if your max price is less than the current spot price
what is the most cost-efficient ec2 instance ?
spot instances
spot instances are useful for workloads that are
resilient to failure
what type of instance would you use for batch jobs?
spot instances
what type of instance would you use for Dataa analysis?
spot instances
what type of instance would you use for image processing?
spot instances
what type of instance would you use for ANY distributed workloads?
spot instances
what type of instance would you use for workloads with flex start and end time?
spot instances
what instance is not suitable for critical jobs or databases?
spot instances
what is amazon ec2 dedicated host?
physical server with ec2 instance capacity fully dedicated to your use
what can ec2 dedicated hosts help you address?
compliance requirements
how can ec2 dedicated hosts help you reduce costs?
by allowing you to use your existing server-bound software licenses
ec2 dedicated hosts is allocated to your account for how long?
3-year period reservation
ec2 dedicated hosts is useful for software that have complicated _______ ___ ___
licensing model, Bring your Own License (BYOL)
ec2 dedicated hosts is useful for companies that have strong ____ or _____ ___
regulatory or compliance needs
what are dedicated instances?
instances running on hardware thats dedicated to you and may share with other instances in same acct
dedicated instances have no control over
instance placement ( can move hardware after stop/start)
What type of dedicated instance/hosts enables the use of dedicated physical servers?
both dedicated instances and dedicated hosts
What type of dedicated instance/hosts has per instance billing ?
dedicated instances
What type of dedicated instance/hosts has per host billing?
dedicated hosts
What type of dedicated instance/hosts has visibility of sockets, cores, host ID?
dedicated hosts
What type of dedicated instance/hosts affinity btwn a host and instance?
dedicated hosts
What type of dedicated instance/hosts target instance placement
dedicated hosts
What type of dedicated instance/hosts automatic instance placement
both
What type of dedicated instance/hosts add capacity using an allocation request
dedicated hosts
What is the best instance to purchase if it is like: coming and staying in resort whenver we like, we pay full price
on demand
What is the best instance to purchase if it is like: planning ahead and if we plan to stay for a long time we may get a good discount
reserved
What is the best instance to purchase if it is like: hotel allows people to bid for the empty rooms and highest bidder keeps the rooms, you can get kicked out any time
spot instances
What is the best instance to purchase if it is like: we book an entire building of the resort
dedicated hosts
how to make a spot instance request
define max spot price and get the instance while current spot price < max
what does hourly spot instance price depend on?
varies based on offer and capacity
If the current spot price > your max price you can choose to
stop or terminate your instance with a 2 minute grace period
what is spot blocking for spot instances?
“block” spot instance during a specified time frame (1-6 hours) w/o interruptions
what are spot instances primarily used for?
batch jobs, data analysis, workloads that are resilient to failures
spot instances are not great for
critical jobs or databases
whenn can you cancel a spot instance requests?
requests that are open, active, or disabled
T/F: Canceling a spot request doesnt terminate instances
T
How do you terminate a spot request
first cancel, then terminate
what does a spot fleet consist of ?
set of Spot Instances, (optional) on-demand instances