AWS EC2 Flashcards
What is EC2 in AWS?
EC2 stands for Elastic Compute Cloud, a highly configurable virtual server.
What is Cloud-Init?
Cloud-init is the industry-standard multi-distribution method for cross-platform cloud instance initialization.
What are the three types of data Cloud-init uses to initialize cloud instances?
Meta-data, User-data, Vendor-data.
How can you retrieve metadata about an EC2 instance?
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.
What are the two versions of the EC2 Instance Metadata Service (MDS)?
IMDSv1 (request/response method) and IMDSv2 (session-oriented method requiring a token).
How is an EC2 instance type name structured?
The name includes the instance family, generation, processor family, additional capabilities, and available virtual resources (e.g., c7gn.xlarge).
What are the five main EC2 Instance Family categories and their designations?
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
What is an EC2 Instance Profile?
A reference to an IAM role that is assumed by the EC2 instance upon creation to avoid passing long-lived AWS credentials.
What are some key points about EC2 Instance Profiles?
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.
What does the EC2 Instance Console Screenshot feature do?
It takes a screenshot of the current state of the instance.
What must be configured for hostname preserving in EC2?
Cloud-Init must be configured for hostname preserving, and a reboot is required after changing the hostname.
What are the two types of hostnames in EC2?
IP Name (legacy) and Resource Name.
What does disabling source/destination checks on an EC2 instance allow?
It allows the instance to pass through traffic, useful for Network Address Translation (NAT).
What is a Placement Group in EC2?
A feature that lets you choose the logical placement of your instances for communication, performance, or durability
What are the three types of Placement Groups in EC2?
Cluster, Partition, and Spread.
Which type of Placement Group is ideal for tightly-coupled node-to-node communication?
Cluster Placement Group, where instances are packed together in one Availability Zone (AZ).
Which Placement Group type spreads instances across different logical partitions to avoid shared hardware?
Partition Placement Group.
Which Placement Group type allows placing instances on different racks and is ideal for critical instances?
Spread Placement Group.
What is an Amazon Machine Image (AMI)?
AMI provides the information required to launch an EC2 instance.
What are some actions you can perform with an AMI?
- 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.
What information does an AMI hold?
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.
What are some use cases for AMIs?
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.
What are the two boot modes for AMIs, and which one should be used unless there is a reason to use the other?
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.
What are the characteristics of Legacy BIOS?
Initializes hardware during boot-up and provides runtime services.
No secure boot.
May be required for legacy OS or software.
What are the characteristics of UEFI?
Supports secure boot.
Faster startup.
Supports drives larger than 2TB.
Pre-boot environment with Graphical UI and network capabilities.
What are the two root device types for AMIs?
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.
What are the two virtualization types in AMIs?
Hardware Virtual Machine (HVM) and Paravirtualization (PV).
What is the difference between HVM and PV virtualization?
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.
What is an Auto Scaling Group (ASG) in AWS?
An ASG contains a group of EC2 instances for automatic scaling and management.
What factors can trigger scaling in an Auto Scaling Group (ASG)?
Capacity settings
Health check replacements (EC2 or ELB Health Checks)
Scaling policies (user-defined or AWS managed)
What are the three adjustment types in Simple and Step Scaling policies for ASGs?
ChangeInCapacity - change capacity based on scaling adjustment.
ExactCapacity - change capacity to match the exact number.
PercentChangeInCapacity - change capacity by a percentage.
What is AWS Predictive Scaling in an ASG?
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.
What are the capacity settings for an Auto Scaling Group?
Min Size
Max Size
Desired Capacity
Changing these metrics is considered manual scaling, and ASG will launch instances to meet the minimum size capacity.
What is an Elastic Load Balancer (ELB) in AWS?
ELB is a suite of load balancers that distribute traffic to EC2, ECS, EKS, and Fargate instances.
What are the types of Elastic Load Balancers (ELB) in AWS?
Application Load Balancer (ALB)
Network Load Balancer (NLB)
Gateway Load Balancer (GWLB)
Classic Load Balancer (CLB)
What does a Listener do in the context of a Load Balancer?
Listeners evaluate any traffic that matches its port.
What are Target Groups in AWS Load Balancing (excluding CLB)?
Target Groups are a logical group of possible targets, such as EC2 instances or IP addresses.
What are the key characteristics of an Application Load Balancer (ALB)?
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
What are the key characteristics of a Network Load Balancer (NLB)?
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
What are the characteristics of a Classic Load Balancer (CLB)?
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.