EC2 - KeynesYouDigIt/Knowledge GitHub Wiki
- EC2 is the compute power, not the hard drive (that's the attached EBS)
To provision:
- Launch instance
- Choose an AMI
- Choose an instance type (t2, m1, etc.)
- Optionally, configure the instance, add storage, add tags, configure the security group
Open up the ports that you're going to use in the security group:
- SSH: 22
- HTTPS: 443
- HTTP: 80
You can also limit the IPs that are allowed to hit this server (eg. to another server, your home computer, etc). You can use the My IP tool to limit it to the computer you're using now.
To connect:
- Download your key
ssh -i my-key.pem [email protected]
Estimating usage: Use top
-
of vCPUs -
- Local storage (size of EBS) - Size of OS and local installations
- Memory - Size of concurrent traffic
- Bandwidth - Low/medium/high
Instance types:
T
- BurstableM
- General purposeC
- Compute-optimizedX
- Memory-optimized - in-memory appsR
- Memory-optimized - intensive applicationsP
- Graphics-optimized - GPU-intensive appsG
- Graphics-optimized - Graphics processingI
- Storage optimized - FastD
- Storage optimized - Big
CLI
- List instances:
aws ec2 describe-instances
- Creating an instance:
aws ec2 run-instances --security-group-ids sg-0448c212 --image-id ami-12b5f758 --instance-type t2.nano --count 1 --subnet-id subnet-bc4621db
- Terminating instances:
aws ec2 terminate-instances --instance-ids i-01d26164507118d30
Multiple Availability Zones
- When deploying, you can select a subnet for a different availability zone within the same VPC