EC2 Flashcards
This deck aims to help retain concepts related to the AWS EC2 service.
What AWS service provides secure, scalable compute capacity in the cloud?
AWS Elastic Compute Cloud (EC2)
What is the resiliency posture of EC2 service?
EC2 is an Availability Zone-resilient service
Can an EC2 instance be connected to ENI, or EBS volume, which exists in different Availability Zones?
No, they must be in the same Availability Zone
What events might cause an EC2 instance to be moved to a different EC2 host?
- The host is down for maintenance by AWS
- The instance is restarted (stopped and started again)
What are some common use cases for EC2 instances?
Usually the default choice for most cases (or a good starting point)
1. Traditional services (OS + App)
2. Long-running compute (months/years 24/7)
3. Server-style applications (burst, steady-state)
4. Monolithic applications
5. Application migration from on-prem
6. Disaster recovery
What are the different types of EC2 hosts?
Shared Host (default)
Dedicated Instance
Dedicated Host
Name the EC2 host type where the physical server is shared with other customer instances.
Shared Host (default)
Name the EC2 host type where the instance can be moved to a different physical server.
Dedicated Instance
Name the EC2 host type where the physical server does not change.
Dedicated Host
What are the different types of EC2 instances?
General Purpose (default)
Compute Optimized
Memory Optimized
Accelerated Computing
Storage Optimized
HPC Optimized
Why does AWS offer so many different EC2 instance types?
Instance types consist of various combinations of CPU, memory, storage, and networking capacity, allowing the selection of the most appropriate mix of resources for the use case
Which EC2 instance type would be appropriate for diverse workloads that require an equal resource ratio?
General Purpose (default)
A1, M6g, T3, T3a, M5, M5a, M5n
Which EC2 instance type would be appropriate for media processing, high-performance computing (HPC), science modelling, gaming, or machine learning workloads?
Compute Optimized
C5, C5n
Which EC2 instance type would be appropriate for processing large in-memory datasets, or database workloads?
Memory Optimized
R5, R5a, X1, X1e, u-Xtb1, z1d
List the most popular EC2 instance families for the General Purpose instance type.
A1, M6g: Graviton, Graviton 2, arm-based processors
T3, T3a: Burst pools, normal usage with occasional peaks
M5, M5a, M5n: steady-state workloads (Intel/AMD arch)
Which EC2 instance type would be appropriate for Hardware GPU, or field programmable gate arrays (FPGAs) workloads?
Accelerated Computing
P3, G4, F1, Inf1
Which EC2 instance type would be appropriate for sequential and random IO, transactional database scaling, data warehousing, elastic search, and analytics workloads?
Storage Optimized
I3/I3en, D2, H1
Decode the following instance type: r5d.8xlarge
r - instance family
5 - instance generation
d - instance additional features
8xlarge - instance size
Which EC2 instance type would be appropriate for applications such as large, complex simulations and deep learning workloads?
HPC Optimized
List the most popular EC2 instance families for the Compute Optimised instance type.
C5, C5n: media encoding, scientific modelling, gaming, machine learning
List the most popular EC2 instance families for the Memory Optimised instance type.
R5, R5a: real-time analytics, in-memory cache, in-memory operations
X1, X1e: large-scale in-memory applications, lowest $/GiB memory in AWS
u-Xtb1: highest memory of all AWS instances
z1d: large memory and CPU with directly attached NVMe
List the most popular EC2 instance families for the Accelerated Computing instance type.
P3: GPU instances (Tesla v100 GPUs) for parallel processing and machine learning
G4: GPU instances (NVIDIA T4 Tensor) for graphic intensive and machine learning
F1: field programming gate arrays (FPGA) genomic, financial analysis, big data
Inf1: machine learning, recommendation, forecasting, analysis, voice, conversation
List the most popular EC2 instance families for the Storage Optimised instance type
I3/I3en: local high-performance SSD (NVMe), NoSQL databases, warehousing, analytics
D2: Dense Storage (HDD) - data warehousing, HADOOP, distributed file systems, data processing (lowest price disk throughput)
H1: high throughput, balance CPU/Memory, HDFS, MAPR-FS, file systems, apache Kafka, big data
What is the difference between the following PUBLIC EC2 connection methods: Client SSH and EC2 Instance Connect?
- Client SSH: requires an SSH key and the connection must originate from the client’s (your) IP address
- EC2 Instance Connect: does not require an SSH key, uses IAM to determine permissions, and the connection originates from an AWS IP address
Name a vital network component designed to provide high-level network performance and security for EC2 instances.
Elastic Network Interface (ENI)
How many ENIs does an EC2 instance have by default?
One primary ENI
Is it possible to attach more than one ENI to an EC2 instance?
Yes, EC2 instances can have secondary ENIs attached (depending on the instance type), these ENIs can be in different subnets but must be in the same Availability Zone
Is it possible to detach an ENI from an EC2 instance?
Secondary ENIs can be detached from one EC2 instance and attached to another, however, the primary ENI cannot be detached
List the main components of an ENI.
MAC address
1 primary private IPv4 address
0 or more secondary private IPv4 addresses
0 or 1 IPv4 public address (optional)
1 or more Elastic IPs (one per private IPv4 address, optional)
0 or more IPv6 addresses (by default, publicly routable)
Security group attachment
Source/destination check (disable for instances used as NAT)
What is the purpose of the EC2 source and destination check feature?
When enabled, the EC2 instance must be the source or the destination of the traffic that reaches it or leaves it
Can an Elastic IP be associated with a secondary ENI on an EC2 instance?
Yes, an Elastic IP is allocated to the AWS account and can be associated with a private IPv4 address on either the primary or secondary ENI
Once the Elastic IP association is removed from the primary ENI on the EC2 instance, will the ENI get the previously replaced dynamic IPv4 address back?
No, the original dynamic IP will be replaced with a new dynamic IPv4 address
Once an Elastic IP is associated with the primary ENI on the EC2 instance, what happens to the dynamic public IPv4 address of that instance?
The dynamic public IPv4 address on the EC2 instance will be replaced with the Elastic IP address
Why would you use multiple ENIs over multiple IP addresses with one ENI?
Multiple ENIs can be used for a multi-homed (multi-subnet) architecture, one for management and one for data, as Security Groups attached to ENIs this approach provides an additional layer of security
Is the operating system of the EC2 instance aware of its public IPv4 address?
The operating system of the EC2 instance is not aware of its public IPv4 address; the Internet Gateway (IGW) performs address translation
Do public IPv4 addresses on EC2 instances persist through instance restarts (start/stop)?
Public IPv4 addresses are dynamic and do not persist through instance restarts, to achieve persistence for a public IPv4 address, you should use an Elastic IP (a static public IPv4 address)
How is an AWS EC2 instance’s private DNS name resolved?
A private DNS name is resolvable only within the VPC
Name a special type of virtual appliance that represents a template (or image) of an AWS EC2 instance configuration and is used to create one or more EC2 instances.
Amazon Machine Image (AMI)
How is an AWS EC2 instance’s public DNS name resolved within the VPC and outside of the VPC?
Within the VPC, the public DNS name resolves to a private IP address, outside of the VPC, it resolves to a public IP address
Is it possible to create an AMI from an existing EC2 instance?
Yes, it is common practice to create an AMI from an existing EC2 instance to capture its current configuration
Can an AMI created in one region be used to launch an AWS EC2 instance in another region?
AMIs are regional and can only be used in the region where they reside, however, they can be copied to another region (each AMI has a unique ID)
What types of launch permissions do AMIs have?
- Public: permissions granted to all AWS accounts
- Explicit: permissions granted to specific AWS accounts
- Implicit: permissions granted to the owner of the AWS account (default)
What are the different types of AMIs available in AWS?
- AWS AMIs
- Community-provided AMIs
- Marketplace AMIs (which can include commercial software)
What are the steps in the AMI lifecycle?
- Launch: using the AMI to initially launch the EC2 instance
- Configure: installing software, attaching volumes, and applying configurations
- Create AMI: creating a custom AMI from a pre-configured EC2 instance
- Launch: launching an EC2 instance using the new AMI with installed software and attached volumes
Can you create an AMI from a running AWS EC2 instance?
Yes, but it is better practice to create the AMI when the instance is stopped to avoid consistency issues
What happens to EBS volumes during AMI creation from the EC2 instance?
Snapshots of EBS volumes are created along with the block device mapping
What happens to EBS volumes when a new AWS EC2 instance is launched from an AMI containing EBS volume snapshots and block device mapping?
EBS volumes will be created from the snapshots and attached to the EC2 instance in the launching AZ
What does AMI baking mean?
AMI baking refers to configuring an EC2 instance and creating an AMI from it
Can an AMI be edited?
An AMI cannot be edited directly, instead, you can launch an EC2 instance using the current AMI, make adjustments, and then create a new AMI from the modified instance
What types of automated checks do EC2 instances perform to identify hardware and software issues?
- System Status Check: Detects issues with the underlying hardware, network connectivity, or host software.
- Instance Status Check: Detects issues with the instance’s operating system, file system, or instance networking