EC2 Flashcards

1
Q

EC2 Pricing

A
  • On Demand - pay by the hour or second
  • Reserved - 1-3 years, up to 72% discount on hourly charge
  • Spot - purchase unused capacity, up to 90% discount, prices fluctuate w/ supply and demand
  • Dedicated - a physical EC2 server, dedicated for your use. The most expensive option.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

On Demand Benefits

A

1) Flexible - low cost + no upfront payment/commitment
2) For Short Term, spiky or unpredictable workloads
3) For testing the water, apps being developed or tested for the first time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Reserved Instances Benefits

A

1) For predictable usage
2) Specific capacity requirements
3) Pay up front (helps reduce computing costs)
4) Commit to 1 or 3 years
5) Super flexible (can also use with Lambda and Fargate)
6) Can be shared across accounts with in an Organization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Types of Reserved Instances

A
  • Standard RI: up to 72% off the On Demand price
  • Convertible RI: up to 54% off the On Demand price with option to change to a different RI of equatl or greater value
  • Scheduled RI: match your capacity needs to a predictable, recurring schedule that only needs a fraction of a day, week or month
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

At what level do Reserved Instance operate?

A

at the regional level

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Spot Instances Benefits

A

1) Flexible - apps that have flexible start and end times
2) Cost sensitive - apps that are only feasible at low compute prices
3) Urgent Capacity - users with urgent need for large amounts of compute (Image rendering, genomic sequencing, algorithmic trading engines)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Dedicated Hosts

A
  • for compliance needs where you need dedicated hardware
  • for licensing restrictions
  • can be On Demand - reserved hourly
  • can be Reserved - purchased as a reservation for up to 70% of the on-demand price
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can you figure out what your hypothetical infrastructure might cost?

A

AWS Pricing Calculator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

AWS CLI Exam Tips

A

AWS Command Line Interface

  • Principle of Least Privilege
  • use IAM groups
  • Secret Access Key - you only see it once, better save it
  • don’t share key pairs
  • supported on Linux, Windows, MacOS, and EC2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

IAM Roles

A
  • an identity that has specific permissions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Ways IAM Roles are similar to a user

A
  • both are created in IAM
  • permission policies determine what it can/cannot do
  • IAM policies are global
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Ways IAM Roles are different from a user

A
  • not uniquely identified with a person
  • intended to be assumed by anyone who needs it
  • temporary - when you assume a role it provides you temporary security credentials for your role session
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Who can assume roles?

A
  • people
  • AWS architecture
  • other system-level accounts
  • other AWS accounts (for cross-account access)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Example of using an IAM role

A

1) Create IAM role
2) Create EC2 instance
3) Create S3 bucket
4) Access S3 from the EC2 instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

IAM Roles Exam Tips

A
  • Roles are the preferred option from a security standpoint
  • always choose roles over hard-coding credentials
  • provide access without using access key IDs and secret access keys
  • made up of policies, changes take effect immediately
  • you can attach and detach roles without having to stop the EC2 instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Bootstrap Scripts

A
  • a script that runs when the instance first starts up
  • has root permissions
  • adds to the time it takes to boot the instance
  • allows you to automate the installation of your applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Example of a Bootstrap Script

A
  • automatically install apache webserver
  • when originally configuring your instance, there is a ‘user data’ box at the bottom where you can paste your startup script
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Security Group Exam Tips

A

1) Changes to security groups take effect immediately
2) you can have any number of EC2 instances within a security group
3) you can have multiple security groups attached to an EC2 instance
4) all inbound traffic is blocked by default
5) all outbound traffic is allowed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

EC2 Metadata

A

Data about your EC2 Instances

  • private IP address
  • public IP address
  • hostname
  • security groups, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you retrieve Metadata?

A

with a curl call

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

User Data vs MetaData Exam tips

A

User data is bootstrap scripts

  • meta data is data about your EC2 instances
  • you can use bootstrap scripts to access metadata
22
Q

3 Types of virtual networking cards for EC2

A

1) ENI
2) EN
3) EFA

23
Q

ENI

A

Elastic Networking Interface

  • for basic day-to-day networking
  • the default network card for EC2 instances
  • private IPv4 addresses
  • public IPv4 addresses
  • many IPv6 addresses
  • MAC addresses
  • 1 or more security groups
24
Q

EN

A

Enhanced Networking

- uses single root I/O virtualization (SR-IOV) to provide higher performance

25
Q

EFA

A

Elastic Fabric Adapter

  • accelerates High Performance Computing (HPC) and machine learning applications
  • a network device you can attach to your EC2 instance to accelerate HPC computing and machine learning
  • provides lower and more consistent latency and higher throughput than TCP transport
  • can use OS-bypass to be faster and lower latency**
  • bypass the OS Kernel and communicate with the EFA device
  • not supported on Windows
26
Q

ENI use cases

A
  • Create a management network
  • use network and security appliances in your VPC
  • create dual-homed instances with workloads/roles on distinct subnets
  • create a low-budget, high-availability solution
27
Q

EN use cases

A
  • for high performance networking between 10GBPS and 100 GBPS
  • provides higher bandwidth
  • higher packet per second performance
  • consistently lower inter-instance latencies
28
Q

Two types of EN

A

1) ENA - Elastic Network Adapter - supports speeds up to 100 GBPS for supported instance types
2) Intel 82599 Virtual Function Interface (older, don’t choose on exam)

29
Q

ENI Exam Scenarios

A
  • for basic networking
  • if you need a separate management network from your production network, or a separate logging network
  • need to do it at low cost
    Solution: Use multiple ENIs for each network
30
Q

EN Exam Scenarios

A
  • for when you need speeds between 10 - 100 GBPS

- when you need reliable high throughput

31
Q

EFA Exam Scenarios

A
  • for HPC and machine learning

- for OS bypass

32
Q

3 types of EC2 Placement Groups

A

1) Cluster Placement Groups
2) Spread Placement Groups
3) Partition Placement Groups

33
Q

Cluster Placement Groups

A
  • instances grouped within a single AZ

- Recommended for: applications that need low latency, high network throughput, or both*

34
Q

Spread Placement Groups

A
  • used for individual or critical instances*
  • can span AZs
  • each instance is on distinct physical hardware
  • recommended for: applications that have a small # of critical instances that should be kept separate
35
Q

Partition Placement Groups

A
  • for multiple instances
  • each partition placement group has its own set of racks with distinct network and power
  • used for : HDFS (Hadoop), H Base (big data db), Cassandra (fast NoSQL), multiple EC2 instances
  • can span multiple AZs*
36
Q

What types of instances can be launched in a placement group?*

A
  • Compute optimized
  • GPU
  • Memory optimized
  • Storage optimized
37
Q

What does AWS recommend within Cluster Placement Groups

A

homogeneous instances (all same kind)

38
Q

Can you merge Placement Groups?

A

No

39
Q

Can you move an instance into an existing Placement Group?

A

Yes, but instance must be in a stopped state. Can be done via the CLI or SDK, but not the Console yet.

40
Q

Maximum Spot Price

A

A price you specify that determines whether your Spot Instance will be provisioned

41
Q

How many minutes do you have to accept or terminate if your instance goes above the maximum spot price?

A

2 minutes

42
Q

Spot Block*

A
  • for workloads that absolutely cannot be terminated
  • keeps your spot instance from being terminated if price goes above your max
  • can be set for 1 to 6 hours
43
Q

How can you compare different AZs and time of day to find the best Spot Instance?

A

Spot Instance Pricing History

44
Q

Spot Instance Use Cases

A
  • big data
  • HPC
  • containerized workloads
  • CI/CD and testing
  • image/media rendering/encoding
45
Q

What are Spot Instances NOT recommended for?

A
  • persistent workloads
  • critical jobs
  • databases
46
Q

How to terminate a one time spot instance?

A

instance is terminated when it is done, or when the max spot price threshold is hit

47
Q

How to terminate recurring spot instances?

A

1) go in and cancel your request
2) then go in and terminate your instance
* * must do this is the right order, otherwise you’ll end up in an endless loop of it re-creating your instance

48
Q

Spot Fleets*

A
  • a collection of spot instances (and optionally, On Demand instances)
  • attempts to launch the number of spot and on-demand instances to meet your target capacity while honoring your maximum spot price
  • attempts to maintain target capacity fleet if your instances are interrupted.
49
Q

Spot Fleet Strategy - Capacity Optimized

A

spot instances come from the pool with optimal capacity for the number of instances launching

50
Q

Spot Fleet Strategy - Lowest Price

A

spot instances come from the pool with the lowest price (default strategy)

51
Q

Spot Fleet Stratey - Diversified

A

Spot instances are distributed across all pools

52
Q

Spot Fleet Strategy - Instance Pools to Use Count

A

Spot instances are distributed across the # of pools you specify. Only valid when used with the lowest price.