EC2 - Elastic Compute Cloud Flashcards
What service does EC2 provide?
EC2 provides Infrastructure as a Service (IaaS)
What does an EC2 Instance include?
- AMI (Operating System)
- Instance Size (CPU + RAM)
- Storage
- Security Groups
- EC2 User Data
What is a Security Group?
- Security Groups act as a ‘firewall’ for the EC2 instance
- Control the traffic that is allowed into or out of the EC2 instance (control the inbound & outbound network)
What is EC2 User Data?
A script launched at the first start of an EC2 instance
What is Port 22?
Port 22 = SSH (Secure Shell), which is used to log into a Linux instance. Additionally, Port 22 = SFTP (Secure File Transfer Protocol), which uploads files using SSH
What is Port 21?
Port 21 = FTP (File Transfer Protocol), which uploads files into a file share
What is Port 80?
Port 80 = HTTP, which is used to access unsecured websites
What is Port 443?
Port 443 = HTTPS, which is used to access secured websites
What does an On-Demand EC2 Instance offer?
- Short workload
- Predictable pricing: pay for what you use, and pay by the second/hour
- Has the highest cost
- No upfront payment and no long-term commitment
- Ideal for short-term and uninterrupted workloads
What does a Reserved EC2 Instance offer?
- Long workloads (1 & 3 years)
- Up to 72% cheaper than On-Demand instances
- Specific instance attributes are reserved (instance type, region, tenancy, OS)
- Can pay as no upfront, partial upfront, or all upfront (to save the most)
- Ideal for steady-state applications
What does a Convertible Reserved EC2 Instance offer?
- Long workloads, but with flexible instances
- Up to 66% cheaper than On-Demand instances
What do Savings Plans EC2 Instances offer?
- Commit to an amount of usage (e.g. $10/hour for 1 or 3 years), instead of committing to a specific instance type
- Up to 72% cheaper than On-Demand instances (but any usage beyond the Savings Plan is billed at On-Demand rate)
- Locked into a specific instance family & region
What do Spot Instances offer?
- Short, cheap workloads - up to 90% cheaper than On-Demand instances
- Less reliable, as instances can be lost at any time if the defined max price is less than the current spot price
- Useful for workloads that are resilient to failure
- Not suitable for critical jobs or databases
What does a Dedicated Host offer?
- Book an entire physical server, and control instance placement
- Pay either On-Demand (pay per second), or Reserved (1 or 3 years - no upfront, partial upfront, or all upfront)
- The most expensive option for AWS EC2 instances
What do Dedicated Instances offer?
Instances run on hardware dedicated to you (no customers share your hardware, but you may share hardware with other instances in the same account)