AWS EC2 - part 2 Flashcards
What is EC2 user data
possible to bootstrap instances using an EC2 user data script
what is bootstrapping?
launching commands when a machine starts
How often is EC2 user data script run?
Only once, when machine starts
What are some examples of how UC2 user data is used to automate boot tasks?
Installing Updates
Installing Software
Downloading common files from the internet
Anything you can think of
What user does EC2 user data script run under?
root/admin
What can you configure for an EC2 instance?
CPU
Memory
Storage
Network performance
EBS bandwidth
What does the EC2 instance naming convention?
m:instance class, 5:generation, 2xlarge: size of instance class
What is a Security Group?
A firewall on our EC2 instance.
Regulate access to ports
authorized IP ranges
control inbond netowrk
control outbound network
type: protocol, port range, source
How many instances can a security group to be associated?
many
If app gets a timeout (not accessible) what is the likely cause of the errror?
Security group issue
If your app give “connection refused” error, what is the likely cause?
An application error or it is not launched
What is port 22 for?
SSH
What is port 21 for?
FTP
What is port 22 for?
Secure File Transfer Protocol (upload files using SSH)
what is port 80 and 443 for?
http/https
What is port 3389 for?
RDP for windows instances
What do you use for SSH for?
To remote into servers (mac, linux, windows >= 10)
What is EC2 instance connect?
Remote into to any OS
What is the command line to SSH to an instance?
ssh usersname@IPaddress, example ssh ec2-users@3.250.26.200
How to use EC2 .pem file?
ssh -i <*.pem> ec2-users@<publicip> in directory with pem file (after chmod 0400 pem file)</publicip>
How to you provide aws permissions to an EC2 instance?
Attach an IAM role (in the EC2 instance UI for example)
How are you charged for an on-demand instance?
By the second
How are you charged for reserved instances?
Up to 72% discount, pay by the year or 3 years, pay no upfront, partial upfront, all upfront
What is EC2 spot instance
can get 90% discount, instance you can lose at any time if your max price is less than spot price
What is EC2 dedicated host?
A physical server dedicated, address compliance or use existing licenses
What is ElasticIP
Public IP that doesn’t change when EC2 stops and starts. (Can only have 5 per AWS account) Should not use, use DNS instead
What is ElasticIP
Public IP that doesn’t change when EC2 stops and starts. (Can only have 5 per AWS account) Should not use, use DNS instead
What is a placement group?
can control EC2 placement strategy, (cluster(availability zone), spread, partition
What is cluster placement group?
Same hardward/rack and availabiliy zone? pro, great network, con: single point of failure. use case(big data job, or needs high network throughput)
What is spread placement group?
EC2 instances spread across machine and availability zones. Pro: availability. Con: limit to 7 instances. Use case: max high availability
What is partition placement group?
Instances spread across multiple availability zones. Each partition represents a rack. Safe from rack failure. Up to 100s of instances. Use case: Big data, Kafka, Cassandra…