EC2 Fundamentals Flashcards
Elastic Compute Cloud Services
- rent virtual machines (EC2)
- store data on virtual drives (EBS)
- distribute load across machines (ELB)
- scale services using auto scaling group (ASG)
EC2 Configuration
- OS, computer power & cores (CPU)
- RAM
- storage
- EBS & EFS (network attached)
- hardware (EC2 instance store)
- Security Groups - firewall
- regulate access to ports
- authorized IP ranges
- control of inbound AND outbound
- can be attached to multiple instances
- locked down to a specific region/vpc combination
- only contain ‘allow’ rules
- by default all inbound traffic is blocked
- by default all outbound traffic is authorized
- can reference by IP or security group
- if you app hangs, then it’s a security group issue
- if your app gives ‘connection refused’ then it’s an application error
- bootstrap script - configure at first launch: ec2 user data
EC2 User Data Script
- can bootstrap our instances using an EC2 user data script
- install updates, software, etc
- only ran once at startup
EC2 Instance Types
When does EC2 public IP change?
- public ip will change if you start/stop instance
- private ip will not change
Common EC2 ports
- 22 - SSH
- 21 - FTP
- 22 SFTP (Secure file transfer protocol) uses ssh
- 80 - HTTP
- 443 - HTTPS
- 3389 - RDP (remote desktop protocol) log into windows instance
EC2 reserved purchase option
- long workloads
- convertible reserved instances
- can change the ec2 instance type, family, os
- up to 72% discount compared to on-demand
- reserve instance type, region, os
- payment options
- up front, partial upfront, all upfront
- scope - regional or zonal
- recommended for steady state usage apps (think database)
- can buy and sell in the reserved instance marketplace
Ec2 on demand purchase option
on-demand instances - short workload, predictable, pay by second
Ec2 saving plan purchase option
- commit to certain types of usage (10%/hr for the next 1 or 3 years)
- additional usage is at the ‘on-demand’ price
- locked into a specific instance family and region (M5 in us-east-2)
- flexible across instance size (m5.xlarge, m5.2xlarge) and os (linux,windows)
Ec2 spot instances purchase option
- most cost-effective
- good for batch jobs, distributed workloads, data analysis
- not suitable for critical jobs and databases
- short workloads, cheap, less reliable
Ec2 dedicated hosts purchase option
- allows you to address compliance requirements and use existing server bound software licenses
- can pay as ‘on demand’ or reserved (1 or 3 years)
- most expensive
- book an entire physical server and control instance placement
Ec2 dedicated instances purchase option
- no other customers will share your hardware
- no control over instance placement
burstable performance instances
Burstable performance instances, which are T3, T3a, and T2 instances, are designed to provide a baseline level of CPU performance with the ability to burst to a higher level when required by your workload. Burstable performance instances are the only instance types that use credits for CPU usage.
EC2 Basic Monitoring
5 minute granularity (detailed is 1 min)
enabled by default using launch templates and through aws console when creating a launch configuration
EC2 detailed monitoring
1 min granularity
enabled by default when creating a launch configuration with the aws cli or sdk