AWS Compute Services - EC2 Flashcards
Compute services: Amazon Elastic Compute Cloud (EC2) Amazon Elastic Container Service (ECS) Amazon Elastic Container Service with Kubernetes (EKS) Amazon Lightsail AWS Batch AWS Lambda
Compute services
Instances instead of servers
AWS programmatically creates a new virtual machine (VM) instance rather than providing an actual physical server when you launch and EC2 instance.
Instances instead of servers
Hypervisor
Each physical server has a host operating system that runs a virtual machine monitor (VMM) also known as a hypervisor which instantiates multiple VM instances that you can use. These instances use guest operating systems that you can manage.
Hypervisor
EC2
A linux-based/windows based/mac based virtual server that you can provision
You are limited to running on-demand instances per your vCPU based on demand instance limit, purchasing 20 reserved instances, and requesting spot instances per your dynamic spot limit per region
EC2
AWS Nitro System
the underlying platform of the next generation of EC2 instances. Traditionally hypervisors protect the physical hardware and bios, virtualize the CPU, storage, networking, and provide a rich set of management capabilities. With the Nitro system these functions are offloaded to dedicated hardware and software, thereby reducing costs of your instances in the process. The Nitro hypervisor delivers performance that is indistinguishable from bare metal and performs better than its predecessor
AWS Nitro System
Amazon Machine Images (AMI)
Package OS and additional installations in a reusable template
Amazon Machine Images
Instance types - various configurations of CPU, memory, storage, and networking capacity for your instances.
t-type and m-type for general purpose
c-type for compute optimized
r-type, x-type, and z-type for memory optimized
d-type, h-type, and i-type for storage optimized
f-type, g-type, p-type for accelerated computing
instance types
Key pairs - secure login information for your instances
key pairs
instance store volumes
storage volumes for temporary data that are deleted when you STOP or TERMINATE your instance, known as instance store volumes.
You can stop an EBS-backed instance but not an instance store backed instance. You can only either start or terminate an instance store backed instance
Instance store volumes
Persistent storage volumes for your data using Elastic Block Store (EBS) volumes
Persistent
Security groups
a firewall that enables you to specify the protocols, ports, and source IP ranges that can reach your instances using security groups
security groups
Elastic IP addresses
static IPv4 addresses for dynamic cloud computing
Elastic IP addresses
user-data
a script that will run on instance boot
user-data
Host recovery for EC2
automatically restarts your instances on a new host in the event of an unexpected hardware failure on a dedicated host
Host recovery for EC2
EC2 hibernation
available for on-demand and reserved instances. You can enable hibernation for your EBS-backed instances at launch. You can then hibernate and resume your instances through the AWS management console or through the AWS SDK and CLI using the existing stop-instances and start-instance commands. Hibernation requires an EC2 instance to be an encrypted EBS-backed instance
EC2 hibernation
Instance States
start - run your instance normally. You are continuously billed while your instance is running.
Stop - just a normal instance shutdown. You may restart it again anytime. All EBS volumes remain attached, but data in instance store volumes are deleted. You won’t be charged for usage while instance is stopped. You can attach or detach EBS volumes. You can also create an AMI from the instance, change the kernel, RAM disk, and instance type while in this state.
Terminate - instance performs a normal shutdown and gets deleted. You won’t be able to restart an instance once you terminate it. The root device volume is deleted by default, but any attached EBS volumes are preserved by default. Data in instance store volumes are deleted.
Instance states
Root Device volumes
the root device volume contains the image used to boot the instance.
Root device volumes
Instance store - backed instances
any data on the instance store volumes is deleted when the instance is terminated (instance store-backed instances do not support the stop action) or if it fails (such as if an underlying drive has issues). You should also backup critical data from your instance store volumes to persistent storage or a regular basis
instance store - backed instances
Amazon EBS-backed instances
an EBS backed instance can be stopped and later restarted without affecting data stored in the attached volumes. When in a stopped state, you can modify the properties of the instance, change its size, or update the kernel it is using, or you can attach your root volume to a different running instance for debugging or any other purpose.
by default the root device volume for an AMI backed by EBS is deleted when the instance terminates
Amazon EBS-backed instance
AMI
includes the following:
a template for the root volume for the instance (OS, application server, and applications)
launch permissions that control which AWS accounts can use the AMI to launch instances
A block device mapping that specifies the volumes to attach to the instance when it’s launched
AMI
AMI backed by EBS
root device for an instanced launched from the AMI is an EBS volume. AMIs backed by EBS snapshots can use EBS encryption
AMI backed by EBS
AMI backed by instance store
root device for an instance launched from the AMI is an instance store volume created from a template stored in S3
AMI backed by instance store
On-Demand pricing
pay for the instances that you use by the second, with no long-term commitments or upfront payments
On-Demand pricing
Reserved - make a low, one-time, up-front payment for an instance, reserve it for a one or three year term, and pay a significantly lower hourly rate for these instances. Standard class provides the most significant discount but you can only modify some of its attributes during the term. it can also be sold in the reserved instance marketplace. convertible class provides a lower discount than standard reserved instances but can be exchanged for another convertible reserved instance with different instance attributes. this one can not be sold on the reserved instance marketplace
reserved pricing