EC2 Flashcards
What is Amazon EC2 ?
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It’s designed to simplify the process of obtaining and configuring scalable compute resources for all users.
- EC2 is one of the most popular of AWS’ offering
- EC2 = Elastic Compute Cloud = Infrastructure as a Service
- It mainly consists in the capability of :
- Renting virtual machines (EC2)
- Storing data on virtual drives (EBS)
- Distributing load across machines (ELB)
- Scaling the services using an auto-scaling group (ASG)
- Knowing EC2 is fundamental to understand how the Cloud works
What are the EC2 sizing & configuration options ?
- Operating System (OS): Linux, Windows or Mac OS
- How much compute power & cores (CPU)
- How much random-access memory (RAM)
- How much storage space:
- Network-attached (EBS & EFS)
- hardware (EC2 Instance Store)
- Network card: speed of the card, Public IP address
- Firewall rules: security group
- Bootstrap script (configure at first launch): EC2 User Data
Talk about EC2 User Data ?
- It is possible to bootstrap our instances using an EC2 User data script.
- bootstrapping means launching commands when a machine starts
- That 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 an EC2 instance type and what can be said about EC2 Instance Types - Overview ?
In Amazon EC2, an instance type essentially determines the hardware of the host computer used for the instance. Each instance type offers different compute, memory, and storage capabilities and is optimized to suit different types of applications.
You can use different types of EC2 instances that are optimised for
different use cases (https://aws.amazon.com/ec2/instance-types/)
* AWS has the following naming convention:
m5.2xlarge
- m: instance class
- 5: generation (AWS improves them over time)
- 2xlarge: size within the instance class
Which are the EC2 Instance Types ?
- General Purpose
- Compute Optimized
- Memory Optimized
- Storage Optimized
What is the General Purpose EC2 instance type good for?
- Great for a diversity of workloads such as web servers or code repositories
- Balance between:
- Compute
- Memory
- Networking
- We will be using the t2.micro which is a General Purpose EC2
instance
What is the Compute Optimized EC2 instance type good for?
- 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
What is the Memory Optimized EC2 instance type good for?
- Fast performance for workloads that process large data sets in memory
- 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
What is the Storage Optimized EC2 instance type good for?
- Great for storage-intensive tasks that require high, sequential read and write
access to large data sets on local storage - 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 Security Groups ?
- Security Groups are the fundamental of network security in AWS
- They control how traffic is allowed into or out of our EC2 Instances.
- Security groups only contain allow rules
- Security groups rules can reference by IP or by security group
What else is there regarding Security Groups ?
- Security groups are acting as a “firewall” on EC2 instances
- They 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)
What is a Security Groups
Diagram ?
A security group diagram would show how security groups control inbound and outbound traffic for AWS EC2 instances.
What are some good to know information about Security Groups?
- Can be attached to multiple instances
- Locked down to a region / VPC combination
- Does live “outside” the EC2 – if traffic is blocked the EC2 instance won’t see it
- It’s good to maintain one separate security group for SSH access
- If your application is not accessible (time out), then it’s a security group issue
- If your application gives a “connection refused“ error, then it’s an application
error or it’s not launched - All inbound traffic is blocked by default
- All outbound traffic is authorised by default
What are References to Other Security Groups ?
To depict referencing other security groups, you could have lines connecting one security group to another, with labels indicating whether this connection represents inbound or outbound traffic. The connected security groups indicate that the rules in one security group are referencing the rules in the other security group.
What are some Classic Ports that is recomended 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