AWS EC2 Flashcards

1
Q

What is EC2 in AWS?

A

EC2 stands for Elastic Compute Cloud, a highly configurable virtual server.

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

What is Cloud-Init?

A

Cloud-init is the industry-standard multi-distribution method for cross-platform cloud instance initialization.

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

What are the three types of data Cloud-init uses to initialize cloud instances?

A

Meta-data, User-data, Vendor-data.

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

How can you retrieve metadata about an EC2 instance?

A

By making a call to the Metadata Service (MDS) at the special endpoint http://169.254.169.254/latest/meta-data/ for IPv4 or http://[fd00:ec2::254]/latest/meta-data/ for IPv6.

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

What are the two versions of the EC2 Instance Metadata Service (MDS)?

A

IMDSv1 (request/response method) and IMDSv2 (session-oriented method requiring a token).

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

How is an EC2 instance type name structured?

A

The name includes the instance family, generation, processor family, additional capabilities, and available virtual resources (e.g., c7gn.xlarge).

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

What are the five main EC2 Instance Family categories and their designations?

A

General Purpose: A, T, M
Compute Optimized: C
Memory Optimized: R, X, High Memory, Z
Accelerated Optimized: P, G, F, Inf, VT
Storage Optimized: I, D, H

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

What is an EC2 Instance Profile?

A

A reference to an IAM role that is assumed by the EC2 instance upon creation to avoid passing long-lived AWS credentials.

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

What are some key points about EC2 Instance Profiles?

A

They can be associated at any time, only one IAM role can be associated, changing roles is not instantaneous, and they can be listed only via API.

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

What does the EC2 Instance Console Screenshot feature do?

A

It takes a screenshot of the current state of the instance.

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

What must be configured for hostname preserving in EC2?

A

Cloud-Init must be configured for hostname preserving, and a reboot is required after changing the hostname.

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

What are the two types of hostnames in EC2?

A

IP Name (legacy) and Resource Name.

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

What does disabling source/destination checks on an EC2 instance allow?

A

It allows the instance to pass through traffic, useful for Network Address Translation (NAT).

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

What is a Placement Group in EC2?

A

A feature that lets you choose the logical placement of your instances for communication, performance, or durability

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

What are the three types of Placement Groups in EC2?

A

Cluster, Partition, and Spread.

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

Which type of Placement Group is ideal for tightly-coupled node-to-node communication?

A

Cluster Placement Group, where instances are packed together in one Availability Zone (AZ).

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

Which Placement Group type spreads instances across different logical partitions to avoid shared hardware?

A

Partition Placement Group.

18
Q

Which Placement Group type allows placing instances on different racks and is ideal for critical instances?

A

Spread Placement Group.

19
Q

What is an Amazon Machine Image (AMI)?

A

AMI provides the information required to launch an EC2 instance.

20
Q

What are some actions you can perform with an AMI?

A
  • Turn EC2 instances into AMIs
  • AMIs are region-specific; to move between regions, create a copy.
  • Purchase or sell AMIs on AWS Marketplace.
  • Store and restore AMIs from an S3 bucket.
  • Deregister, deprecate, or disable AMIs.
  • Share AMIs with public, explicit, or implicit settings.
21
Q

What information does an AMI hold?

A

Template for the root volume (e.g., operating system, applications)
Permissions controlling who can use the AMI
Block device mapping specifying the volumes to attach.

22
Q

What are some use cases for AMIs?

A

Keep incremental changes to OS, application code, and system packages.
Routine patching with System Manager Automation.
Use with Launch Configurations or Launch Templates for managing revisions.

23
Q

What are the two boot modes for AMIs, and which one should be used unless there is a reason to use the other?

A

Legacy BIOS (Basic Input/Output System) and UEFI (Unified Extensible Firmware Interface). UEFI should be used unless there is a reason to use Legacy BIOS.

24
Q

What are the characteristics of Legacy BIOS?

A

Initializes hardware during boot-up and provides runtime services.
No secure boot.
May be required for legacy OS or software.

25
Q

What are the characteristics of UEFI?

A

Supports secure boot.
Faster startup.
Supports drives larger than 2TB.
Pre-boot environment with Graphical UI and network capabilities.

26
Q

What are the two root device types for AMIs?

A

EBS-backed: EBS volume is attached at launch and is independent of the instance.
Instance-backed: Native volumes are used; data is lost when the instance is stopped or terminated.

27
Q

What are the two virtualization types in AMIs?

A

Hardware Virtual Machine (HVM) and Paravirtualization (PV).

28
Q

What is the difference between HVM and PV virtualization?

A

HVM is full virtualization with hardware assistance; PV is software-assisted.
HVM uses hardware-assist technology; PV relies on the hypervisor.
HVM has potentially higher performance and broader OS options.
HVM can boot from EBS or instance store; PV can only boot from instance store.
HVM is recommended for modern operating systems.

29
Q

What is an Auto Scaling Group (ASG) in AWS?

A

An ASG contains a group of EC2 instances for automatic scaling and management.

30
Q

What factors can trigger scaling in an Auto Scaling Group (ASG)?

A

Capacity settings
Health check replacements (EC2 or ELB Health Checks)
Scaling policies (user-defined or AWS managed)

31
Q

What are the three adjustment types in Simple and Step Scaling policies for ASGs?

A

ChangeInCapacity - change capacity based on scaling adjustment.
ExactCapacity - change capacity to match the exact number.
PercentChangeInCapacity - change capacity by a percentage.

32
Q

What is AWS Predictive Scaling in an ASG?

A

Analyzes historical load to detect daily and weekly patterns.
Requires a forecast of 24 hours of CloudWatch data.
Uses the last 14 days of data to adjust policy.
Produces a forecast for the next 48 hours, updated every 6 hours.

33
Q

What are the capacity settings for an Auto Scaling Group?

A

Min Size
Max Size
Desired Capacity
Changing these metrics is considered manual scaling, and ASG will launch instances to meet the minimum size capacity.

34
Q

What is an Elastic Load Balancer (ELB) in AWS?

A

ELB is a suite of load balancers that distribute traffic to EC2, ECS, EKS, and Fargate instances.

35
Q

What are the types of Elastic Load Balancers (ELB) in AWS?

A

Application Load Balancer (ALB)
Network Load Balancer (NLB)
Gateway Load Balancer (GWLB)
Classic Load Balancer (CLB)

36
Q

What does a Listener do in the context of a Load Balancer?

A

Listeners evaluate any traffic that matches its port.

37
Q

What are Target Groups in AWS Load Balancing (excluding CLB)?

A

Target Groups are a logical group of possible targets, such as EC2 instances or IP addresses.

38
Q

What are the key characteristics of an Application Load Balancer (ALB)?

A

Operates on OSI Layer 7
Designed to balance HTTP and HTTPS traffic
Supports Path-Based and Host-Based routing
Can handle SSL/TLS termination
Can only be accessed by its hostname

39
Q

What are the key characteristics of a Network Load Balancer (NLB)?

A

Operates on OSI Layer 4
Designed to balance TCP/UDP traffic
Can handle millions of requests per second
Preserves the client source IP
Can be accessed by its IP, useful when a static IP is needed for a load balancer

40
Q

What are the characteristics of a Classic Load Balancer (CLB)?

A

Can use Layer 7-specific features and Layer 4 balancing for purely TCP applications.
Balances HTTP or TCP traffic but not at the same time.
Is a legacy feature and not recommended for use anymore.