EC2 Flashcards
Instance Type
Allows varying combinations of CPU, memory, storage, networking
Types of IP addresses on EC2
Public, Private, Elastic IP
Private IP address
IP address retained when instance is stopped
Used in public and private subnets
Public IP address
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
Elastic IP address
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
AMI
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
EC2 Metadata and URL
instance metadata is data about the EC2 instance like ami-id, istance-id, hostname, etc.
http://169.254.169.254/latest/metadata
What are versions of Instance Metadata Service (IMDS) and what do they do?
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
EC2 User Data
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
Elastic Placement Groups
Cluster, Spread, Partition
Elastic Placement Groups Cluster
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
Elastic Placement Groups Partition
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
Elastic Placement Groups Spread
strictly places a small group of instances across distinct underlying hardware to reduce correlated failures
each instance in different AWS rack
AWS Network Interface types?
ENI - Elastic Network Interface
ENA - Elastic Network Adapter
EFA - Elastic Fabric Adapter
ENI?
Can you have multiple ENI on one instance?
Can ENI be in different AZs?
Can you move an ENI to a different instance?
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
ENA
Elastic Network Adapter
Enhanced network performance adapter for high bandwidth and low inter-instance latency
Must choose supported instance type
EFA
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 does AWS perform NAT for Public addresses
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