EC2 Flashcards
What is EC2?
EC2 = Elastic Cloud Computing = Infrastructure as Service
One of the most popular AWS’s services
What does EC2 capability consist of?
/ What are you able to do with EC2?
(4 points)
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)
EC2 Sizing and Configuration Options
- What can we choose for our instances?
EC2 sizing & configuration options. We can choose:
• Operating System (OS): Linux or Windows
• How much compute power & cores (CPU)
• How much random-access memory (RAM)
- How much storage space:
- Network-attached (EBS & EFS)
- or hardware-attached (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
What type of instances do we get for EC2?
Instance vCPU Mem (GiB) Storage Network Performance EBS Bandwidth (Mbps)
t2. micro 1 1 EBS-Only Low to Moderate
t2. xlarge 4 16 EBS-Only Moderate
c5d. 4xlarge 16 32 1 x 400 NVMe SSD Up to 10 Gbps 4,750
r5. 16xlarge 64 512 EBS Only 20 Gbps 13,600
m5. 8xlarge 32 128 EBS Only 10 Gbps 6,800
** t2.micro is part of the AWS free tier (up to 750 hours per month) **
What is AMI?
AMI = Amazon Machine Image
AMI is a template that contains the software configuration (operating system, application server, and applications) required to launch your instance.
How can you select/get an AMI?
3 points
You can create your own AMI’s
You can buy AMIs from AWS Marketplace
Get AMI from the Community
Define Security Groups
What are they?
- 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 is the purpose of Security Groups?
5 points
• 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)
Name the Classic Ports (6 in total)
- 22 = SSH (Secure Shell) - log into a Linux instance
- 21 = FTP (FileTransport Protocol) – upload files into a file share
- 22 = SFTP (Secure FileTransport 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
EC2 instant connect
Uses your web browser to connect to your EC2 instance
Valid for Mac, Windows and Linux (all versions)
Works with Amazon NX2
puTTy
PuTTY allows you to use the SSH protocol to connect into your EC2 instances.
PuTTY is a free implementation of SSH and Telnet for Windows and Unix platforms, along with an xterm terminal emulator.
SSH
- Port 22
SSH is one of the most important function. It allows you to control a remote machine, all using the command line.
Mac/Linux Users:
We will see how we can configure OpenSSH ~/.ssh/config to facilitate the SSH into our EC2 instances
How to connect computer over the web to your EC2 instance
Mac User
ssh - key - IP
In terminal:
ssh -i ‘reference the key fil (.pem) ec2-user@ ‘add IPv4 address here’
if you have a permission denied
in terminal - chmod 0400 “reference the key file”
SSH Troubleshooting
1 - There’s a connection timeout
This is a security group issue. Any timeout (not just SSH) is related to security groups or a firewall. Ensure it is correctly assigned to your EC2 instance.
2 - Still a timeout issue
A corporate firewall or a personal firewall is blocking the connection. Please use EC2 instance Connect
EC2 Instance Connect
Browser based SSH Connection
- Note: EC2 Instance Connect may only work with Amazon Linux 2