Section 3: EC2 Flashcards

1
Q

General Purpose instance

A

t2.micro (1 vCPU, 1GB)

Lesson 28

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

Compute Optimized instance

A

c5n.large (2 vCPU, 5.25GB)

Lesson 28

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

Memory Optimized instance

A

r5ad.large (2 vCPU, 16GB)

Lesson 28

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

Storage Optimized instance

A

d2.xlarge (4 vCPU, 30.5GB)

Lesson 28

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

GPU instance

A

g2.2xlarge (8vCPU, 15GB)

Lesson 28

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

Amazon Machine Image (AMI)

A

Includes:
- Template for the root volume of the image.
- Launch permissions.
- A block device mapping specifying the volumes to attach.

AMIs are regional. You can only launch an AMI from the region in which it is stored.

You can copy AMI’s to other regions using the console, command line, or the API.

Essentially an image that contains the operating system, and any configurations.

Defines the configuration of the instance.

An AMI is created from an EBS snapshot (a point in time backup of an instance).

Lesson 28

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

EC2 Benefits

A
  • Elastic computing
  • Complete control
  • Flexible
  • Reliable
  • Secure
  • Inexpensive

Lesson 28

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

Security Group

A

Instance-level Firewall.

Basically, a firewall, controlling inbound and outbound traffic.

Determines which ports, protocols, and IP addresses we can connect from.

It functions as a firewall securing access to our instances.

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

Internet Gateway

A

Attached to a VPC and enables access to/from internet.

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

Key pair

A

Used for connecting securely to our instances.

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

User data

A

Ability to run commands when the system is starting. Data limited to 16KB.

Lesson 33

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

Metadata

A

Data about your EC2 instance (e.g. private IPv4, public IPv4, etc.) that is recorded locally.

Lesson 33

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

Access Keys

A
  • Configured on the EC2 instance, and stored on the filesystem of the instance.
  • Associated with an IAM User Account (e.g. Eric)
  • Uses the permissions assigned to the IAM User.

Lesson 34

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

EC2 Instance Profile

A
  • the Role is assumed by the EC2 instance.
  • No credentials are stored on the instance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Cluster Placement Group

A

Packs instances close together in an AZ to achieve low-latency using enhanced networking, low network latency necessary for tight coupled node-to-node (inter-instance) communication typical in HPC applications.

Lesson 38

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

Partition Placement Group

A

Spreads instances across logical partitions (separate AWS rack) such that groups of instances in one partition do not share the underlying hardware with groups of instances in different partitions. Strategy typically used by large distributed and replicated workloads like Hadoop, Cassandra, and Kafka.

Neil used NoSQL as a use case.

Partitions can be in multiple AZs (up to 7 per AZ).

Lesson 38

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

Spread Placement Group

A

Strictly places a small group of instances across distinct underlying hardware (separate AWS rack) to reduce correlated failures.

Lesson 38

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

Network Interface (ENI, ENA, EFA)

A
  • EC2 is within AZ (data center), not a public or private subnet.
  • EC2 can be attached to multiple subnets through different adapters.
  • The (auto) primary network interface has a private IP address and optional public IP address.
  • EC2 can have another network interface but it has to be in same AZ.
  • Cannot attach ENIs from subnets in different AZs.

Lesson 39

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

Elastic Network Interface (ENI)

A
  • Basic adapter for non HPC requirements.
  • Supports all instance types.

Lesson 39

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

Elastic Network Adapter (ENA)

A
  • Enhanced network performance.
  • Higher bandwidth and lower inter-instance latency.
  • Must select a supported instance type.

Lesson 39

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

Elastic Fabric Adapter (EFA)

A
  • Use with HPC and Message Passing Interface (MPI) and ML use cases.
  • Tightly coupled (low latency) applications.
  • Supports all instance types.

Lesson 39

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

Public, Private, and Elastic IP Addresses (EIP)

A

Public - dynamic. Changes on restart.
Elastic- public and static. Associate with network interface.

ENIs can be remapped to a different instance in the same AZ.

EIPs can be remapped in the same **or across* different AZs.

Lesson 41

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

Public IP Address

A
  • Lost when the instance is stopped but not restarted/rebooted.
  • Used in public subnets.
  • No charge.
  • Associated with a private IP address on the instance.
  • Cannot be moved between instances.

Lesson 41

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

Private IP Address

A
  • Retained when the instance is stopped.
  • Used in public and private subnets. Always have a private IP address.

Lesson 41

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

Elastic IP (EIP) Address

A
  • Static public IP address.
  • Available within a region when allocated.
  • Charged even if not used.
  • Associated with a private IP address on the instance.
  • Can be moved between instances and Elastic Network Adapters.

Lesson 41

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

Network Address Translation (NAT) for Public Adresses

A
  • On EC2, you only see the private IP address and knows nothing about the public IP address.
  • The public IP addesss is associated to the adapter and private IP adress.
  • The Internet Gateway (IG) performs NAT.
  • The NAT gateway will change the private IP address source address to the public IP address and vice-versa coming back inbound.

Lesson 42

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

Bastion Host / Jump Host

A
  • Using instance in public subnet to connect to instance in private subnet.
    -Helps connect to instances in a private subnet.

Lesson 44

28
Q

0.0.0.0/0

A

Anything source / anything else.

Lesson 44

29
Q

Private subnet

A
  • Don’t have a public IP address l. No public IP address assigned.
  • Don’t have a route. Route table associated has no Internet Gateway attached to it.
  • Because no public IP address, an Internet Gateway (IG) cannot be attached.

Lesson 44

30
Q

Local

A

Route within the VPC.

Lesson 45

31
Q

Classless Inter-Domain Routing (CIDR)

A

Lesson 45

32
Q

NAT Gateways and NAT Instances Overview

A
  • Purpose to enable instances deployed in private subnets to connect to the Internet. Outbound only.
  • If we needed bi-directional, we would deploy the instances to a public subnet with a public IP address and use the Internet Gateway.
  • Use cases like a connect to an outbound service or download software to install for updates.

Lesson 46

33
Q

NAT Gateway

A
  • AWS service.
  • Highly available and automatic scaling.
  • NAT Gateway is created in public subnet.
  • deployed to a public subnet. It will have an Elastic IP Address (EIP) used to talk the Internet Gateway (attached to the VPC) on behalf of the private instance.
  • the NAT Gateway ID must be specified in the private subnet Route Table.

Lesson 46

34
Q

NAT Instance

A
  • Used a lot before NAT Gateways came along.
  • EC2 instance, not an AWS service.
  • Uses a special AMI with the string ”amzn-ami-vpc-nat” in the name.
  • Must disable source/destination checks.
  • the NAT Instance ID must be specified in the private subnet Route Table.

Lesson 46

35
Q

NAT Instance vs NAT Gateway

A

NAT Instance:
- Manged by you (e.g. operating system, software updates).
- Scale up (instance type) manually and use enhanced networking.
- No high availability - scripted/auto-scaled HA possible using multiple NATs in multiple subnets.
- Need to assign Security Group.
- Can use a a bastion host.
- Use and Elastic IP Adress or Public IP Address with a NAT Instance.
- Can implement port forwarding through manual customization.

Lesson 46

36
Q

NAT Gateway vs NAT Instance

A

NAT Gateway:
- Managed by AWS.
- Elastic scalability up to 45 Gbps.
- Provides automatic high availability within an AZ and can be placed in multiple AZs.
- No Security Groups.
- Cannot access through SSH.
- Choose the Elastic IP Address to associate with a NAT Gateway at creation.
- Does not support port forwarding.

Lesson 46

37
Q

EC2 Instance Lifecycle

A

AMI:
- Launch -> Pending state -> Running state
- Reboot -> Rebooting state -> Running state
1. Terminate -> Shutting Down state -> Terminated state
2. Stop -> Stopping state -> Stopped state ( Terminate -> Terminated state | Start -> Pending state )
3. Stop-Hibernate

Note: Stopping and Stop-Hibernate is only applicable to EBS-backed volumes, not Instance store volumes.

Lesson 48

38
Q

Stopping EC2 Instance

A
  • EBS backed instances only.
  • No charge for stopped instances.
  • EBS volumes remain attached (chargeable).
  • Data in RAM lost.
  • Instance is migrated to a different host (e.g. scheduled hardware maintenance).
  • Private IPv4 and IPv6 addresses retained; public IPv4 addresses released.
  • Associated Elastic IP Addresses retained.

Lesson 48

39
Q

Hibernating EC2 Instances

A
  • Applies to an on-demand or reserved Linux instances.
  • Contents of RAM saved to EBS volume.
  • Must be enabled for hibernation when launched.
  • Specific prerequisites apply.
  • When started (after hibernation):
  • The EBS root volume is restored to its previous state.
  • The RAM contents are reloaded.
  • The processes that were previously running on the instance are resumed.
  • Previously attached data volumes are reattached and the instance retains its instance ID.

Lesson 48

40
Q

Rebooting EC2 Instances

A
  • Equivalent to an OS reboot.
  • DNS name and all IPv4 and IPv6 adresses are retained.
  • Does not affect billing

Lesson 48

41
Q

Retiring EC2 Instances

A
  • Instances can be retired if AWS detects irreparable failure of the underlying hardware that hosts the instance.
  • When an instance reaches its scheduled retirement date, it is stopped or terminated by AWS.

Lesson 48

42
Q

Terminating EC2 Instances

A
  • Means deleting the EC2 instance.
  • Cannot recover a terminated instance.
  • By default, root EBS volumes are deleted.

Lesson 48

43
Q

Recovering EC2 Instances

A
  • CloudWatch can be used to monitor system status to check and recover instance if needed.
  • Applies if the instance becomes impaired due to underlying hardware / platform issues.
  • Recovered instance is identical to original instance.

Lesson 48

44
Q

AWS Nitro System

A
  • underlying platform for the next generation of EC2 instances.
  • support very many virtualized and bare metal instance types.
  • breaks functions into specialized hardware with a Nitro Hypervisor.
  • Specialized hardware includes:
  • Niteo cards for VPC.
  • Niteo cards for EBS.
  • Niteo cards for Instance Storage.
  • Nitro cars controller.
  • Nitro security chip.
  • Nitro Hypervisor.
  • Nitro Enclaves.

Lesson 49

45
Q

AWS Nitro System Benefits

A
  • Improves security, performance, and innovation:
  • Performance close to bare metal for virtualized instances.
  • Elastic Network Adapter and Elastic Fabric Adapter.
  • More bare metal instance types.
  • Higher network performance (e.g. 100 Gbps).
  • HPC optimizations.
  • Dense storage instances (e.g. 60 TB).

Lesson 49

46
Q

AWS Nitro Enclaves

A
  • Really about security.
  • Isolated compute environments.
  • Runs on isolated and hardened virtual machines.
  • No persistent storage, interactive access, or external networking.
  • Uses cryptographic attestation to ensure only authorized code is running.
  • Integrates with AWS KMS.
  • Protect and securely process highly sensitive data (PII, Healthcare, Financial, and Intellectual Property data).

Lesson 49

47
Q

On-Demand EC2 Pricing

A

Standard rate - no discount, no commitment; dev/test, short term or unpredictable workloads.

Lesson 50

48
Q

Reserved EC2 Pricing

A

1 or 3 year commitment; up to 75% discount; steady-state, predictable workloads and reserved capacity.

Lesson 50

49
Q

Spot EC2 Pricing

A

Get discounts of up to 90% for unused capacity; Can be terminated at any time.

Lesson 50

50
Q

Dedicated Instances (Pricing)

A

Physical isolation at the host hardware level from instances belonging to other customer.

Lesson 50

51
Q

Dedicated Hosts (Pricing)

A

Physical server dedicated for your use; Socket/core visibility, host affinity; pay per host; workloads with server bound software licenses.

Lesson 50

52
Q

Savings Plans

A

Commitment to a consistent amount of usage (EC2 + Fargate + Lambda); Pay by $/hour; 1 or 3 year commitment.

Lesson 50

53
Q

Amazon EC2 Billing - Per Second

A
  • Billed per second; Minimum of 1 minute.
  • Per- second is for Amazon Linux and Ubuntu and also now Windows in On-Demand, Reserved, and Spot forms.

Lesson 50

54
Q

Amazon EC2 Billing - Per Hour

A
  • Billed per hour; Minimum of 1 hour
  • Windows, commercial distros such as Redhat Linux EL and SuSE Enterprise Server (ES)uses hourly pricing.

Lesson 50

55
Q

Amazon EBS Volume Pricing

A
  • Volumes billed per second; Minimum of 1 minute.

Lesson 50

56
Q

Amazon EC2 (Standard) Reserved Instances

A
  • Change AZ, instance size (Linux), networking type.
  • Use ModifyReserveInstances API.

Lesson 50

57
Q

Standard RI

A
  • Change AZ, instance size (Linux), networking type.
  • Use ModifyReserveInstances API.

Lesson 50

58
Q

Convertible RI

A
  • Change AZ, instance size (Linux), networking type.
  • Change family, OS, tenancy, payment option.
  • Use ExchangeReserveInstances API.

Lesson 50

59
Q

RI Terms and Payment Option

A
  • 1 or 3 year
  • All upfront, partial upfront, no upfront.

Lesson 50

60
Q

Amazon EC2 Reserved Instances (RIs)

A
  • When the attributes of a used instance match the attributes of an RI, the discount is applied.
  • Includes type of instance (e.g. A1, M4, R5a).
  • Can include operating system.
  • Tenancy - Default or Dedicated (hardware).
  • AZ - can specify when reserving capacity.
  • Region - does not reserve capacity; discount applies all AZs.

Lesson 50

61
Q

Scheduled RIs (deprecated)

A
  • Match capacity to reservation to recurring schedule.
    Minimum 1200 hours per year.
  • Example - Reporting app that runs 6 hours a day 4 days a week = 1248 hours per week.

Lesson 50

62
Q

AWS (Compute) Savings Plan

A
  • 1 or 3 yearly; hourly commitment to usage of Fargate, Lambda, and EC2; Any Region, family, size, tenancy, and OS.

Lesson 50

63
Q

AWS (EC2) Savings Plan

A
  • 1 or 3 year; hourly commitment to usage of EC2 within a selected Region and Instance Family; Any size, tenancy and OS.

Lesson 50

64
Q

Amazon EC2 Spot Instances (Spot, Spot Fleet, EC2 Fleet)

A
  • Spot Instances - one or more EC2 instances.
  • Spot Fleet - launches and maintains the number of Spot / On-Demand instances to meet specified target capacity.
  • EC2 Fleet - launches and maintains specified number of Spot / On-Demand / Reserved Instances in a single API call.

Note: with EC2 Fleet, can define separate OD/Spot capacity targets, bids, instance types, and AZs.

2 minute warning if AWS needs to reclaim capacity - available via instance metadata and CloudWatch Events.

Lesson 50

65
Q

Spot Block

A
  • Requirement: Uninterrupted for 1-6 hours.
  • Pricing is 30 - 45% less than On-Demand.

Lesson 50

66
Q

Dedicated Instances vs Dedicated Hosts

A

Dedicated Instances (3 benefits)
- Enables the use of dedicated physical servers.
- Per instance billing (subject to a $2 per region fee).
- Automatic instance placement.

Dedicated Hosts (7 benefits)
- Enables the use of dedicated physical servers.
- Per-host billing.
- Visibility of sockets, cores, host ID.
- Affinity between a host and instance (which instance the host will run on).
- Targeted instance placement.
- Automatic instance placement.
- Add capacity using an allocation request.

Lesson 50