AWS2.0notes
AWS2.0notes
💡 How to Answer:
AWS offers different EC2 instance types based on use cases:
General Purpose (T3, M5) – Balanced CPU & memory, good for web servers.
Compute Optimized (C5, C6g) – For heavy processing tasks like gaming and analytics.
Storage Optimized (I3, D2) – Best for workloads needing fast disk access like big data.
Accelerated Computing (P4, G4) – For GPU-heavy tasks like AI/ML training.
🚀 Example: If I need a web app, I go for T3; if it’s a database server, I choose R5.
💡 How to Answer:
Both control traffic in a VPC, but their scope is different:
Security Groups – Work at instance level and are stateful (if inbound traffic is allowed, outbound is
automatically allowed).
Network ACLs (NACLs) – Work at subnet level and are stateless (need rules for both inbound &
outbound).
🚀 Example: If I need to block a specific IP for the whole subnet, I use NACLs. If I just want to allow SSH (port
22) on one instance, I configure its Security Group.
💡 How to Answer:
Amazon S3 has 99.999999999% (11 nines) durability, meaning data is almost never lost. It stores multiple
copies of files across multiple Availability Zones (AZs).
🚀 Example: If I upload a file to S3, AWS automatically stores copies in different locations. Even if one AZ fails,
my data is safe.
💡 How to Answer:
AWS provides three types:
Application Load Balancer (ALB) – Best for web applications (Layer 7).
Network Load Balancer (NLB) – Handles millions of requests per second (Layer 4).
Classic Load Balancer (CLB) – Oldest version, supports both Layers 4 & 7.
🚀 Example: If I need to route traffic based on URLs (e.g., /login vs /home), I use ALB. If I need high-speed TCP
traffic handling, NLB is the best.
Store data separately (EFS, RDS Multi-AZ) – Ensures data isn't lost if the instance goes down.
🚀 Example: For a web app, I configure ASG + ELB + Multi-AZ RDS so that traffic never stops.
💡 How to Answer:
RDS (Relational Database Service) – SQL-based (MySQL, PostgreSQL), used for structured data.
🚀 Example: If I need a structured banking system, I go with RDS. If I need a fast user session store,
DynamoDB is better.
💡 How to Answer:
Glacier & Glacier Deep Archive – For long-term backups (retrieval takes time).
🚀 Example: If I store daily logs, I use S3 Standard. For old backups, Glacier Deep Archive saves cost.
💡 How to Answer:
Auto Scaling adjusts EC2 instances automatically based on demand. It has:
🚀 Example: If I run an e-commerce site, I use Auto Scaling to add servers during sales and remove them
afterward.
💡 How to Answer:
CloudWatch – Monitors performance (CPU, memory, etc.).
🚀 Example: If my EC2 CPU is high, CloudWatch sends an alert, and I scale up instances automatically.
💡 How to Answer:
IAM (Identity and Access Management) controls who can access AWS resources using:
🚀 Example: If a developer needs S3 access, I create an IAM role with least privilege so they can only
perform required actions.
💡 How to Answer:
An Elastic IP (EIP) is a static, public IPv4 address that you can assign to an EC2 instance.
🚀 Example: If my web server crashes, I launch a new instance and attach the same Elastic IP so users don’t
see a change.
💡 How to Answer:
CloudFormation is an Infrastructure as Code (IaC) service that automates AWS resource provisioning using
JSON/YAML templates.
🚀 Example: Instead of manually creating an EC2 instance, I use CloudFormation to deploy it with all settings
pre-configured.
💡 How to Answer:
CloudFront is a Content Delivery Network (CDN) that speeds up content delivery using global edge locations.
🚀 Example: If my website has visitors worldwide, CloudFront caches content close to users, reducing load
time.
💡 How to Answer:
💡 How to Answer:
A VPC (Virtual Private Cloud) is a private network within AWS where you can launch EC2 instances and other
resources securely. It provides:
🚀 Example: If I host a web app, I put the web server in a public subnet and the database in a private subnet
for security.
16. What is AWS Lambda, and when should you use it?
💡 How to Answer:
AWS Lambda is a serverless computing service that runs code without managing servers. It executes functions
on demand in response to events.
🚀 Example: If I want to resize images when they are uploaded to S3, I create a Lambda function that triggers
automatically.
💡 How to Answer:
To optimize Amazon RDS (Relational Database Service):
🚀 Example: If my RDS MySQL server is slow, I enable Read Replicas to distribute read traffic.
💡 How to Answer:
EBS (Elastic Block Store) – Block storage attached to a single EC2 instance. Best for databases and
system drives.
EFS (Elastic File System) – Shared storage that can be accessed by multiple EC2 instances. Good
for shared data.
🚀 Example: If I need persistent storage for one EC2 instance, I use EBS. If I need a shared drive across
multiple instances, I choose EFS.
💡 How to Answer:
🚀 Example: If my EC2 instance CPU usage is high, I set up a CloudWatch alarm to auto-scale it.
💡 How to Answer:
IAM (Identity and Access Management) secures AWS by managing user permissions.
IAM Policies – Define rules for what users can or cannot do.
🚀 Example: If I need to give S3 access to an application, I create an IAM role with least privilege access.