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)