EC2 Flashcards

1
Q

Instance Type

A

Allows varying combinations of CPU, memory, storage, networking

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

Types of IP addresses on EC2

A

Public, Private, Elastic IP

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

Private IP address

A

IP address retained when instance is stopped
Used in public and private subnets

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

Public IP address

A

Dynamic address, Lost when the instance is stopped (not lost when instance is restarted)
Used in public subnet
No charge
Associated with private IP address on the instance
Cannot be moved between instances

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

Elastic IP address

A

Static public IP address
You are charged if not used
Associated with a private IP address on the instance
Can be moved between instances and Elastic Network Adapters
Can be moved across AZs and remapped to a different ENI

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

AMI

A

provides information required to launch an instance

Defines the OS, software, instance type, and storage for the instance

Includes:
A template for the root volume for the instance
Launch permissions
A block device mapping specifying the volumes to attach

AMIs are regional - can only launch an AMi from the region it is stored in

Can copy AMIs to other regions using console, CLI or API

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

EC2 Metadata and URL

A

instance metadata is data about the EC2 instance like ami-id, istance-id, hostname, etc.

http://169.254.169.254/latest/metadata

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

What are versions of Instance Metadata Service (IMDS) and what do they do?

A

IMDS v1 - older and less secure

IMDS v2 - newer, more secure and reqires a session token for authorization

Default launch settings for EC2 may disable IMDSv1 depending on settings

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

EC2 User Data

A

Script that runs when instance starts for the first time

must be base64 encoded

Limited to 16kb in raw form (before base 64 encoded)

http://169.254.169.254/latest/user-data

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

Elastic Placement Groups

A

Cluster, Spread, Partition

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

Elastic Placement Groups Cluster

A

Packs instances close together inside an AZ. This strategy enables workloads to achieve the low-latency networks network performance necessary for tightly coupled node to node communication that is typical of HPC applications

uses enhanced networking, low network latency and high throughput for inter-instance traffic

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

Elastic Placement Groups Partition

A

spreads your instances across logical partitions such that groups of instances in one partition do not share the underlying hardware with groups of instances in a different partitions. This strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra and Kafka

partitions are located in separate AWS rack, up to 7 AZs

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

Elastic Placement Groups Spread

A

strictly places a small group of instances across distinct underlying hardware to reduce correlated failures

each instance in different AWS rack

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

AWS Network Interface types?

A

ENI - Elastic Network Interface
ENA - Elastic Network Adapter
EFA - Elastic Fabric Adapter

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

ENI?

Can you have multiple ENI on one instance?

Can ENI be in different AZs?

Can you move an ENI to a different instance?

A

Elastic Network Interface

basic adapter type for when you don’t have any high performance requirements

can use with all instance types

if network interface attached to public subnet, the primary network interface has a private IP and optionally a public IP

Additional ENI can be attached from subnets within the same AZ

You can’t have nework interface span AZ

Yes, you can move an ENI to a different instance

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

ENA

A

Elastic Network Adapter

Enhanced network performance adapter for high bandwidth and low inter-instance latency

Must choose supported instance type

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

EFA

A

Elastic Fabric Adapter

Use with HPC or MPI (message passing interface) and ML use cases

Tightly coupled applications

Can use with all instance types

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

How does AWS perform NAT for Public addresses

A

When the instance makes a request, the traffic goes out with source as private IP to the IGW.

The IGW performs Network Address Translation by replacing the private IP with the public IP

When the request is returned it has the destination as the Public IP and the IGW replaces the destination with the corresponding Private IP

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

Private Subnet

A

By default all instances launched will not have a public IP

No route in route table pointing to IGW (igw-id)

20
Q

Public Subnet

A

By default all instances launched will have a public IP

Must have IGW attached to the VPC and NAT Gateway attached to public subnet

By default main Route table of VPC includes destination equal to subnet CIDR and target to Local (e.g. local to other subnets within the VPC) and all other traffic routed to the IGW

21
Q

How do you build a private EC2 instance(s) that can process outbound request but is unreachable from the internet?

A

Create VPC or use default
Create a public subnet and private subnet
Attach IGW to VPC
Deploy NGW into public subnet with an Elastic IP to communicate with the internet on behalf of instances in the private subnet
Create a route table different from the main RT
Configure RT with VPC cider as destination and Target as local
Configure RT for any other address to target NGW

private instance makes connects via NGW with private IP and NGW connects to IGW to make internet request

22
Q

NAT Instance

How do you use the instance vs NGW

What is preferred NAT instance or NGW

A

special AMI string that has “amzn-ami-vpc-nat” in the name; you must disable source and destination checks

In the custom route table instead of targetting the NGW for all other traffic outside the VPC CIDR, specify target as the NAT Instance

you should prefer NGW over NAT instance

23
Q

NAT GW vs NAT Instance

A

Instance
Instance managed by you
Scale up manually by changing the instance type and use enhanced networking
No HA, you can script to auto scale
HA possible using multiple NATs in multiple subnets
Need to assign security groups
Can use as bastion
Use EIP or public IP address
Can implement port forwarding through manual customization

NGW
Service managed by AWS
Fully elastic for scaling up to 45 Gbps
Provides automatic HA within an AZ and can be place in multiple AZs (different instance)
No need to assign security groups
Can’t access via SSH
Choose the EIP to associate at creation
Doesn’t support port fowarding

24
Q

What kind of EC2 instance can you stop?

What kind of EC2 instance can’t be stopped?

A

EBS instance backed

Instance store backed instance can’t be stopped

25
Q

What happens when an EC2 instance is that is stopped?

A

EBS volume remains which is chargeable, while instance changes stop
Data is lost in RAM
Instance is migrated to a different host if restarted
Private IPv4 or v6 addresses are retained; public addresses are released
Associated EIPs are retained

26
Q

What happens when you hibernate an EC2 instance and what types of instances can be hibernated?

A

Only applies to certain AMIs
Contents of RAM are saved to EBS
Must be enabled for hibernation

27
Q

What happens when you start an EC2 instance after hibernation?

A

The EBS root volume is restored to its previous state
The RAM contents re reloaded
The processes that were running previously on the instance are resumed

28
Q

What happens when you reboot an EC2 instances

A

Equivalent to an OS reboot (AWS recommends rebooting via EC2 not OS)
DNS name and all IPv2 or v6 addresses retained
Doesn’t affect billing

29
Q

What happens when you retire an EC2 instances? What other way is an instance reitred?

A

Instances may be retired if AWS detects irreparable failure of the underlying HW that hosts the instance

When an instance reaches its scheduled retirement date, it is stopped or terminated by AWS

30
Q

What is and what happens to terminated instances?

A

Terminating an instance is deleting it
Can’t be recovered once terminated
By default, the root EBS volumes are deleted

31
Q

How can you recover an EC2 instance?

A

CloudWatch can be used to monitor system status checks and recover the instance

Applies if the instance becomes impaired due to underlying HW or platform issues

Recovered instance is identical to original instance

32
Q

AWS Nitro

A

underlying platform for next generation EC2 instances

support for many virtualized or bare metal instance types

tries to eliminate performance penalty of virtualization by access bare metal

breaks functions into specialized HW with Nitro Hypervisor

specialized HW includes:
nitro cards for VPC
nitro cards for EBS
nitro cards for Instance Storage
nitro cards for controller
nitro security chip
nitro hypervisor
nitro enclaves

33
Q

Benefits of Nitro

A

Improves performance, security, and innovation:

performance close to bare meta for virtual instances
ENA and EFA use Nitro
more bare metal instance types
higher network performance
HPC optimizations
Dense storage instances

34
Q

Nitro Enclaves

A

isolated compute environments
runs on isolated hardened VMs
no persistent storage, interactive access or external networking
uses cryptographic attestation to ensure only authorized code is running
integrates with AWS KMS
protects and securely processes highly sensitive data (PII, PHI, Financial data and Intellectual property)

35
Q

EC2 Pricing Options

A

On-demand
Reserved
Spot
Dedicated Instances
Dedicated Hosts
Savings Plan

36
Q

Name and describe types of Reserved Instance ?

A

Standard RI - change AZ, instance size (Linux) and networking type - use ModifyReservedInstance API

Covertable RI - can change AZ, instance size (Linux) and networking type, change family, OS, tenancy and payment option - use ExchangeReservedInstances API

both terms are 1 or 3 years

Can pay all upfront, partial upfront or no upfront but discount of up to 75% will vary with lower upfront payments

37
Q

How is the discount applied for Reserved Instances?

A

When teh attributes of a used instance match the attributes of the RI the discount is applied

38
Q

EC2 On Demand Capacity Reservation

A

Reserve compute capacity for your EC2s in specific AZ
Any duration
Mitigates against risk of being unable to get on demand capacity
Doesn’t require any long term commitments and can be cancelled at any time

39
Q

When you create a reservation for EC2 On Demand what do you specify?

A

AZ
number of instances
instance attributes - type, tenancy, platform/OS

40
Q

What type of savings plans?

A

Compute Savings Plan
EC2 Savings Plan

41
Q

Compute Savings Plan

A

1 or 3 year commitment of usage of Fargate, Lambda, and EC2
Any region, family, size, tenancy and OS

42
Q

EC2 Savings Plan

A

1 or 3 year commitment of usage of EC2 within a selected region and instance family
Any size, tenancy and OS

43
Q

Spot Instances

A

One or more EC2 instances

up to 90% discount

can define separate OD/spot capacity targets, spot price, instance type and AZs

you get a 2 minute warning if AWS needs to reclaim capacity available via instance meta data and cloud watch events

44
Q

Spot Fleet

A

launces and maintains the number of Spot/on-demand instances to meet specified target capacity

45
Q

EC2 Fleet

A

launches and maintains specified number of spot / on-demand / RI in a single API call

46
Q

Spot Block

A

Need uninterrupted capacity for set duration of time

Pricing is 30-45% less than on demand