Advanced EC2 Flashcards
EC2 User Data
anything in the user Data is executed by the instance OS
but Only on Lunch
EC2 doesn’t interpret the OS needs to understand the User data
Adress for EC2 User data
http://169.254.169.254/Latest/user-data
CFN-INIT
helper script - installed on EC2 OS
simple configuration management system
procedural(User Data) vs Desired State(cfn-init)
it can control what packages gets installed, Groups, user, files commands and services
What makes CFN-INIT so powerful ?
can be used to rerun scripts through metadata and cloud formation making it more reactive than if you were to bootstrap through just EC2 user data
and it works with stack updates
creationPolicy and signals
by default cloud formation doesn’t know if the instance bootstrapping data fails
creating a creationPolicy with a resouceSignal enables cloud formation to wait for a signal from the instance itself before it moves to create complete
EC2 Instance Roles
How EC2 instances get permissions
How is an instance role attached to an EC2 instance ?
when you create an instance role in the UI a Instance Profile gets created of the same name it’s that profile that gets attached to an instance then temp credentials are delivered via meta-data
System Manager Parameter Store
storage for configuration and secrets
string, stringlist and secureString
Hierarchies and versioning
store plaintext and cipher (through KMS permission need to be added)
Public parameters - latest AMIs per region
What is CloudWatch used for ?
Metrics
what is Cloud Watch Logs user for ?
logging
If you want to captured data inside an instance which service would you user cloudWatch or CloudWatch logs ?
CloudWatch Logs but neither can natively capture data inside an instance you have to install CloudWatch agent on an EC2 instance to do that
Placement Groups : Cluster
Pack instance close together
Placement Group: Spread
Keep instances separated
Placement Groups: Partition
groups of instance spread apart
What can impact the performance of an Clust Placement groups ?
can span VPC peers - but impacts performance
us the same type of instance (not mandatory)
Launch at the same time(not mandatory … very recommended)
Draw backs to a cluster placement group?
can’t span AZs - one AZ only locked when launching first instance
requires a support instance type
What are the benefits of a Cluster placement group ?
10GBps p/ stream vs 5gbps normally
all members have a direct connection to each other
same Rack and sometime same host
Spread placement group benefits
provides infrastructure Isolation
each instance runs from a different rack
each rack has it’s own networking and power source
Drawback of a spread placement group ?
7 instances per Az(hard limit )
Not supported for dedicated instances or host
Cluster placement Group use cases
high performance, fast speed and low latency
Spread Placement Group
small number of critical instances that need to be kept separate from each other
Partition Placement Groups Drawbacks
7 partitions per Az
Use case for a Partition Placement Groups ?
contain the impact of a failure to a part of an application
Benefits of a partition placement Group ?
greate for topology(application with it’s own networks or nodes) aware applications like HFFS,HBase and Cassandra
Dedicated Hosts
Host dedicated to you, you pay for the host no instance charge
Drawback of dedicated host
older version of dedicated host the instance family has to has to be specified when making host new host instance families don’t have to be specified
Payment types for Decificate Host ?
on-demand and reserved options (1yr or 3 yrs )
Benefits of dedicated Host
Host hardware has physical sockets and cores
EBS Optimized
dedicated bandwidth for storage networking - separate from data networking.
generally enabled and comes built in for all modern instances
older instances enabling cost extra