Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

AWS - EC2

Back


Amazon EC2


EC2 sizing & configuration options


EC2 Instance Types

Type Feature Use Case Example
General Purpose for a diversity of workloads web servers t2
Compute Optimized for compute-intensive tasks ML, Gaming server C6g
Memory Optimized for workloads that process large data sets in memory In-memory databases R5
Storage Optimized for intensive access to large data sets on local storage OLTP I3

Purchasing Options

Option Feature
On-Demand Instances short workload, predictable pricing, pay by second
Reserved (1 & 3 years) - Reserved long workloads
Reserved (1 & 3 years) - Convertible Reserved Instances long workloads with flexible instances
Savings Plans (1 & 3 years) commitment to an amount of usage, long workload
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
Capacity Reservations reserve capacity in a specific AZ for any duration

On Demand


Reserved Instances


Hands-on: Reserved Instances

reserve_instance


Savings Plans


Hands-on: Savings Plans

ec2_saving_plan

saving_plan_compute


Spot Instances


Spot Instance Requests

terminate_spot_instance


Hand-on: Spot Instance Requests

spot_instances


Spot Fleets


Hands-on: Spot Fleets

spot_req

spot_Instance_pricing_history

allocation_strategy


Dedicated Hosts

Allocate_Dedicated_Host


Dedicated Instances


Capacity Reservations

Capacity_Reservation


Right Option


Advanced

Attach aws role to EC2 instance

role

role


User Data


Hands-on: User Data

#!/bin/bash
# Use this for your user data (script from top to bottom)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Hello World from $(hostname -f)</h1>" > /var/www/html/index.html

Placement Groups


Cluster

cluster


Spread

Spread


Partition

Partition


Hands-on: Placement group

placement


Hibernate


Hands-on: Hibernate

hiberante_storage

hiberante_enable

hiberante_instance


AMI


AMI Process (from an EC2 instance)

ami_diagram


Hands-on: AMI

ami_create

ami_create

ami_list


TOP