EC2 Fundamentals Flashcards
True or False:
Security groups only contain allow rules.
True
What are security groups?
They act as a “firewall” on EC2 instances.
What do security groups regulate?
Access to ports
Authorized IP ranges - IPv4 and IPv6
Control of inbound network
Control of outbound network
Can a security group be attached to multiple instances?
Yes
Are security groups locked to a region / VPC combination?
Yes
Do security groups live “inside” or “outside” the EC2 instance?
Outside. If traffic is blocked, EC2 won’t see it.
What is port for SSH to log into Linux instance?
22
What is port to for FTP?
21
What is port for SFTP?
22
What is port for HTTP and HTTPS websites?
80 for HTTP
443 for HTTPS
What is port for RDP (remote desktop protocol) to log into a Windows isntance?
3389
When you get timeout when connecting to EC2 instance, where is the issue?
Within security groups
When you first download a SSH file with permissions 0644, and get “permissions too open” error, how do you fix?
chmod 0400
What user do you use to login to EC2 via SSH?
ec2-user@
What is EC2 Instance Connect?
Allows you to connect to an EC2 instance within the web browser
What is the best way to provide AWS credentials to our EC2 instances?
IAM roles
What are the 4 types of EC2 instance purchasing options?
- On-demand instances
- Reserved instances
- Spot instances
- Dedicated hosts
Describe EC2 on demand, it’s pros/cons, and best use cases
Pay for what you use. Billing per second on Windows/Linux, otherwise per hour use.
Has the highest cost but no upfront costs or long term commitment
Recommended for:
Short -term and un-interrupted workloads, where you can’t predict how the application will behave
Describe EC2 reserved instances, pros / cons, and it’s best use cases
Reserved for 1-3 years. Bigger discounts for longer time commitments, or paying more upfront.
Upfront costs can be none, partial, or all. Must reserve a specific instance type.
Recommended for steady-state usage applications (think database)
What is a convertible reserved instance?
Allows you to change the EC2 instance type during your reserved period. Up to 54% discount.
What is a scheduled reserved instance?
Launched only within time window you reserve. Best for when you only need for fraction of day / month / year.
Still requires time commitment of 1-3 years.
Describe EC2 spot instance, pros/cons, and best use cases
Instance that you can “lose” when your max price is less than the current spot price.
MOST cost efficient option. Best for workloads resilient to failure, such as: batch jobs, data analysis, image processing, distributed workloads, workloads with flexible start/end time.
NOT for databases or citical jobs.
Describe EC2 dedicated hosts, pros/cons, and best use cases
Entire physical server fully dedicated for your use. 3 year time commitment.
Most expensive options.
Best for addressing compliance requirements or for using your existing server-bound software licenses. Good for companies with strong regulatory or compliance needs, or complicated licensing models.
dedicated instances vs. dedicated hosts
Hosts are much more involved than instances.
Instances run on hardware that’s dedicated to you, but don’t have access to the underlying hardware.