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
Spread Placement Groups
Individual Critical EC2 instances
Partition Placement Groups
Multiple EC2 instances, HDFS, Hbase, & Cassandra
Spreads instances across logical partitions such that groups of instances in one partition don’t share underlying hardware with groups of instances in different partitions.
Typically used by large distributed replicated workloads like Hadoop, Cassandra, and Kafka
What is an EC2 Placement Group?
Placement groups are just logical groupings for EC2 instances
What are the important things to know about a placement group?
A cluster group can’t span AZs but a spread or partition placement group can
Only certain types of instances can be launched into a placement group (cpu, memory or storage optimized)
You can’t merge placement groups
You can move an existing instance into or out of a placement group. It must be in a stopped state and it can only be done using CLI or SDK
Dedicated Hosts
Any question talking about specific licensing requirements
Allows use of existing per socket, per core, or per VM software licensing
Including Windows server, my sql, Susie Linux enterprise, etc
What is a spot fleet
A spot fleet is a collection of spot instances & optionally on-demand instances
You can use block spot instances from terminating using spot block