EC2 Flashcards
On Demand Instance
Pay by the hour or second, depending on the type of instance you run. Great for flexibility with no long term contract
Spot instance
Purchase unused capacity at discount of up to 90% Prices fluctuate with supply and demand
Reserved Instances
Reserved capacity for 1-3 years up to 72% discount on the hourly charge. Great if you have known fixed requirements.
Dedicated Hosts
A physical EC2 server dedicated for your use. Great if you have a server bound license to reuse or for compliance, no multi tenancy
Things to keep in mind for the AWS command line
Use principle or least privilege
Use IAM groups, & assign your users to them. Group permissions are assigned using IAM policy docs. Your users will automatically inherit the permissions of the group
3 Important tips for AWS CLI
- Use secret key access. Keep in mind you only see this key once so save it!
- Don’t share key pairs
- Can install the AWS cli on windows, Linux, and max as well as on EC2 servers
Roles
Preferred from a security perspective
Helps avoid hard coding credentials
Policies control a roles permission
Updating a policy attached to a role will take immediate effect
You can attach and detach roles on running ec2 instances without needing to take them down
Security Groups
- Changes to security groups take immediate effect
- You can have any # of EC2 instances in a security group
- You can have multiple security groups attached to ec2 instances
4 all inbound traffic is blocked by default
- All outbound traffic is allowed
Bootstrap Scripts
A bootstrap script is a script that runs when the instance first starts.
It passes user data to the instance & can be used to install apps (eg Apache or a db), as well as do updates & more
User Data
User data is just a boot strap script
EC2 Metadata
Data about your instance, you can use user data to access metadata
EC2 ENI
For basic networking.
Perhaps you need to separate your management network from prod, or separate a logging network & you need it at a low cost.
In this scenario use multiple ENIs for each EC2 instance
EC2 Advanced Networking
For when you need speeds between 10gbps and 100 gbps. Anywhere you need reliable high throughput
EC2 EFA
For when you need to accelerate high performance computing (hpc) & machine learning apps or if you need to do an ops bypass.
If you see a scenario question mentioning hpc or ml and asking what network adapter you want efa
Cluster Placement Groups
Low network latency, high network throughput