This section covers the core fundamentals of major AWS services that form the foundation of cloud architecture. Understanding these services is essential for the FCJ (First Cloud Journey) Midterm Exam.
FCJ Workshop Practice: Each service below has corresponding hands-on workshops at cloudjourney.awsstudygroup.com. Complete these workshops for practical experience!
These services are the building blocks of AWS architectures and appear frequently in FCJ midterm scenarios.
FCJ Reference: Practice hands-on with EC2 Workshop (000004) - Windows Server 2022, Amazon Linux 2023, Security Groups, and cost governance.
Amazon EC2 provides resizable virtual servers (instances) in the cloud. It’s the fundamental compute service in AWS.
| Family | Name | Use Case | Example |
|---|---|---|---|
| General Purpose | T3, T3a, M6i | Balanced CPU/Memory | Web servers, small databases |
| Compute Optimized | C6i, C7g | High CPU | Batch processing, gaming servers |
| Memory Optimized | R6i, X2idn | High RAM | Large databases, caching |
| Storage Optimized | I4i, D3 | High IOPS, throughput | Data warehouses, NoSQL |
| Accelerated Computing | P4, G5 | GPU workloads | Machine learning, graphics |
1. On-Demand (Pay-As-You-Go):
2. Reserved Instances (1 or 3 years):
3. Savings Plans (1 or 3 years):
4. Spot Instances (Bid for unused capacity):
5. Dedicated Hosts:
6. Dedicated Instances:
┌─────────────┐
│ Pending │ ← Launch instance
└──────┬──────┘
│
▼
┌─────────────┐ Stop ┌─────────────┐
│ Running │◄─────────►│ Stopped │
└──────┬──────┘ └──────┬──────┘
│ │
│ Terminate │ Terminate
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Terminating │───────────►│ Terminated │
└─────────────┘ └─────────────┘
Billing: Only charged when instance is in "Running" state
Stop/Start: EBS-backed instances retain data, Instance Store lost
1. EBS (Elastic Block Store) - Persistent:
2. Instance Store - Ephemeral:
3. EFS (Elastic File System) - Shared:
Security Groups = Virtual firewall for EC2 instances
Key Characteristics:
Example Security Group:
Inbound Rules:
- HTTP (80) from 0.0.0.0/0 (anywhere)
- HTTPS (443) from 0.0.0.0/0
- SSH (22) from 203.0.113.0/24 (corporate network only)
Outbound Rules:
- All traffic to 0.0.0.0/0 (default)
1. Cluster - Low latency:
2. Spread - High availability:
3. Partition - Large distributed systems:
EC2 User Data = Script that runs at instance first launch
#!/bin/bash
# Update system
yum update -y
# Install Apache web server
yum install -y httpd
systemctl start httpd
systemctl enable httpd
# Create simple webpage
echo "<h1>Hello from $(hostname -f)</h1>" > /var/www/html/index.html
Runs as: root user
When: Only at first boot (unless configured otherwise)
Use case: Automate instance configuration
✅ AMI (Amazon Machine Image): Template for EC2 instances (OS + software)
✅ Elastic IP: Static public IPv4 address (persists across stop/start)
✅ ENI (Elastic Network Interface): Virtual network card
✅ Instance Metadata: http://169.254.169.254/latest/meta-data/
✅ Tenancy: Default (shared hardware) vs Dedicated
Amazon S3 is object storage built to store and retrieve any amount of data from anywhere. It’s one of the oldest and most used AWS services.
Bucket:
Object:
Key (Object name):
s3://my-bucket/folder/subfolder/file.txt| Storage Class | Use Case | Availability | Min Duration | Retrieval |
|---|---|---|---|---|
| S3 Standard | Frequent access | 99.99% | None | Immediate |
| S3 Intelligent-Tiering | Unknown/changing access | 99.9% | 30 days | Immediate |
| S3 Standard-IA | Infrequent access | 99.9% | 30 days | Immediate |
| S3 One Zone-IA | Non-critical, infrequent | 99.5% | 30 days | Immediate |
| S3 Glacier Instant | Archive, instant access | 99.9% | 90 days | Milliseconds |
| S3 Glacier Flexible | Archive, 1-5 min retrieval | 99.99% | 90 days | Minutes-hours |
| S3 Glacier Deep Archive | Long-term archive (7-10 yrs) | 99.99% | 180 days | 12-48 hours |
Pricing (US East):

S3 Intelligent-Tiering: Automatic cost optimization with $0.0025 per 1,000 objects monthly monitoring fee. Objects automatically move between access tiers: Frequent (< 30 days), Infrequent (30-90 days), Archive Instant (90-365 days), Archive (365+ days). No retrieval fees. Ideal when access patterns are unpredictable.
Purpose: Keep multiple versions of an object
States:
Key Points:
Cross-Region Replication (CRR):
Same-Region Replication (SRR):
Requirements:
Automate transition between storage classes and deletion
Transition Actions:
S3 Standard (Day 0)
↓ (30 days)
S3 Standard-IA
↓ (60 days)
S3 Glacier Flexible Retrieval
↓ (365 days)
S3 Glacier Deep Archive
↓ (2555 days / 7 years)
Delete
Example Policy:
{
"Rules": [{
"Id": "Archive old logs",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 365 }
}]
}
Bucket Policies (Resource-based):
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicRead",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/*"
}]
}
Access Control:
Encryption:
Request Rates:
Transfer Acceleration:
bucket-name.s3-accelerate.amazonaws.comMultipart Upload:
Enable static website hosting on bucket
Requirements:
URL Format:
http://bucket-name.s3-website-region.amazonaws.com
http://bucket-name.s3-website.region.amazonaws.com
Use case: Host static websites (HTML, CSS, JS, images)
AWS IAM allows you to securely control access to AWS services and resources. It’s a global service (not region-specific).
1. Users:
2. Groups:
3. Roles:
4. Policies:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowS3ReadAccess",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": "203.0.113.0/24"
}
}
}
]
}
Components:
1. AWS Managed Policies:
AdministratorAccess, ReadOnlyAccess2. Customer Managed Policies:
3. Inline Policies:
Policy Evaluation Order - “DAD” Rule: Understanding how AWS evaluates policies is critical for the FCJ midterm!
When an IAM entity attempts an action, AWS evaluates policies in this order:
1. Explicit Deny → Always wins (overrides everything)
2. Explicit Allow → Required for access
3. Implicit Deny → Default when no explicit allow exists
Decision Flow:
Request Made
↓
Is there an EXPLICIT DENY? → YES → ❌ ACCESS DENIED
↓ NO
Is there an EXPLICIT ALLOW? → YES → ✅ ACCESS GRANTED
↓ NO
❌ ACCESS DENIED (implicit deny)
Key Points:
Example: If one policy allows s3:PutObject and another policy denies s3:*, the deny wins and the user cannot put objects.
✅ Enable MFA for root account and privileged users
✅ Use roles for applications running on EC2 (see FCJ Workshop 000048)
✅ Principle of Least Privilege: Grant minimum permissions needed (see FCJ Workshop 000002)
✅ Use groups to assign permissions to users
✅ Rotate credentials regularly (max 90 days recommended)
✅ Enable CloudTrail for audit logging
✅ Use policy conditions for enhanced security (IP restrictions, MFA requirements)
✅ Never share root account credentials
✅ Use IAM Access Analyzer to generate least-privilege policies
Access Keys = Long-term credentials for programmatic access (CLI, SDK, API)
Components:
Security:
Configure password requirements:
Purpose: Grant EC2 instances permissions to access AWS services
How it works:
Benefits:
Use case: Account A needs to access resources in Account B
Setup:
Trust Policy (in Account B):
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111111111111:root"
},
"Action": "sts:AssumeRole"
}]
}
Amazon RDS is a managed relational database service that handles routine database tasks (backups, patching, scaling).
| Engine | Version Examples | Use Case |
|---|---|---|
| Amazon Aurora | MySQL 5.7/8.0, PostgreSQL 11-15 | High performance, cloud-native |
| MySQL | 5.7, 8.0 | Open-source, web apps |
| PostgreSQL | 11, 12, 13, 14, 15 | Advanced features, compliance |
| MariaDB | 10.5, 10.6 | MySQL fork, open-source |
| Oracle | 19c, 21c | Enterprise, legacy apps |
| SQL Server | 2016, 2017, 2019, 2022 | Microsoft ecosystem |
General Purpose (gp3, gp2):
Provisioned IOPS (io1, io2):
Automatically increase storage when running low
Conditions:
Benefits:
Purpose: Scale read operations, improve performance
Key Features:
Use Cases:
Replication Lag: Usually milliseconds to seconds
Purpose: High availability and disaster recovery
How it works:
FCJ Workshop 000005: Multi-AZ uses synchronous replication which means every write to the primary database is immediately replicated to the standby BEFORE the write is acknowledged. This ensures zero data loss (RPO = 0) during failover. In contrast, Read Replicas use asynchronous replication and may have replication lag of seconds to minutes.
When failover happens:
Multi-AZ vs Read Replicas:
| Feature | Multi-AZ | Read Replicas |
|---|---|---|
| Purpose | High availability | Scalability |
| Replication | Synchronous | Asynchronous |
| Standby accessible? | No | Yes (for reads) |
| Automatic failover | Yes | No (manual promote) |
| Same region | Yes | Can be cross-region |
| RPO | 0 (no data loss) | Minutes (replication lag) |
| RTO | 60-120 seconds | Hours (manual) |
Automated Backups:
Manual Snapshots:
Restore:
At Rest:
In Transit:
rds.force_ssl=1 parameterEncrypting Unencrypted DB:
Network:
Access Control:
Auditing:
| Feature | RDS (MySQL/PostgreSQL) | Aurora |
|---|---|---|
| Performance | Standard | 5x MySQL, 3x PostgreSQL |
| Storage | EBS (up to 64 TB) | Auto-scaling (up to 128 TB) |
| Replicas | 5 | 15 |
| Replication lag | Seconds | Milliseconds |
| Failover | 60-120 seconds | < 30 seconds |
| Backups | S3 | Continuous to S3 |
| Cost | Lower | Higher (20% more) |
Amazon VPC is a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define.
1. VPC (Virtual Private Cloud):
2. Subnet:
3. Internet Gateway (IGW):
4. NAT Gateway:
5. Route Tables:
Private IP Ranges (RFC 1918):
CIDR Notation Examples:
Reserved IPs (per subnet):
┌─────────────────────────────────────────────────────────────┐
│ VPC (10.0.0.0/16) │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Availability Zone A │ │
│ │ │ │
│ │ ┌──────────────────┐ ┌──────────────────┐ │ │
│ │ │ Public Subnet │ │ Private Subnet │ │ │
│ │ │ 10.0.1.0/24 │ │ 10.0.3.0/24 │ │ │
│ │ │ │ │ │ │ │
│ │ │ ┌──────────────┐ │ │ ┌──────────────┐ │ │ │
│ │ │ │ Web Server │ │ │ │ RDS MySQL │ │ │ │
│ │ │ │ (EC2) │─┼──────┼─│ (Primary) │ │ │ │
│ │ │ └──────────────┘ │ │ └──────────────┘ │ │ │
│ │ │ │ │ │ │ │ │
│ │ └────────┼─────────┘ └──────────────────┘ │ │
│ └───────────┼──────────────────────────────────────────┘ │
│ │ │
│ ┌───────────┼──────────────────────────────────────────┐ │
│ │ │ Availability Zone B │ │
│ │ │ │ │
│ │ ┌────────┼───────────┐ ┌──────────────────┐ │ │
│ │ │ Public │ Subnet │ │ Private Subnet │ │ │
│ │ │ 10.0.2.│/24 │ │ 10.0.4.0/24 │ │ │
│ │ │ │ │ │ │ │ │
│ │ │ ┌──────▼─────────┐ │ │ ┌──────────────┐ │ │ │
│ │ │ │ NAT Gateway │ │ │ │ RDS MySQL │ │ │ │
│ │ │ │ (EIP) │ │ │ │ (Standby) │ │ │ │
│ │ │ └────────────────┘ │ │ └──────────────┘ │ │ │
│ │ │ │ │ │ │ │
│ │ └────────────────────┘ └──────────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────────┐ │
│ │ Internet Gateway │ │
│ └──────────┬─────────┘ │
└─────────────┼──────────────────────────────────────────────┘
│
Internet
FCJ VPC Workshop: The VPC Workshop (000003) provides hands-on practice with Security Groups (stateful) and NACLs (stateless), including multi-tier architecture setups.
| Feature | Security Groups | Network ACLs |
|---|---|---|
| Level | Instance (ENI) | Subnet |
| State | Stateful (return traffic auto) | Stateless (must allow both) |
| Rules | Allow only | Allow and Deny |
| Rule Evaluation | All rules | Rules in order (1-32766) |
| Default | Deny all inbound, allow all outbound | Allow all inbound/outbound |
| Association | Multiple per instance | One per subnet |
Stateful vs Stateless Example:
Security Group (Stateful):
Inbound: Allow port 443 from 0.0.0.0/0
Outbound: Not needed - return traffic automatically allowed
NACL (Stateless):
Inbound: Allow port 443 from 0.0.0.0/0
Outbound: Must explicitly allow ephemeral ports (1024-65535) for return traffic
Key Point: With Security Groups, if you allow inbound HTTP (port 80), the response is automatically allowed back out. With NACLs, you must explicitly allow the outbound ephemeral ports for the return traffic.
Purpose: Connect two VPCs privately using AWS network
Characteristics:
Use case: Connect VPCs for resource sharing
Purpose: Privately connect VPC to AWS services without Internet Gateway
Types:
1. Gateway Endpoints (FREE):
2. Interface Endpoints (Paid):
Benefits:
Purpose: Capture IP traffic information
Levels:
Destinations:
Use cases:
Not captured:
AWS Lambda lets you run code without provisioning or managing servers. You pay only for compute time consumed.
Function:
Trigger (Event Source):
Hard Limits (Cannot be changed):
Configurable:
Request Pricing:
Duration Pricing:
Example:
┌─────────────────────────────────────────────────────────┐
│ Cold Start │
│ │
│ 1. Download code from S3 │
│ 2. Start execution environment (container) │
│ 3. Initialize runtime (Node.js, Python, etc.) │
│ 4. Run initialization code (outside handler) │
│ 5. Invoke handler function │
│ │
│ Duration: 100ms - 2 seconds │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Warm Start │
│ │
│ 1. Reuse existing execution environment │
│ 2. Invoke handler function directly │
│ │
│ Duration: ~10ms │
└─────────────────────────────────────────────────────────┘
Cold Start Optimization Strategies:
Important Note: With Provisioned Concurrency, cold starts still happen during initialization, but they occur BEFORE the function is invoked (not during user requests). The Init Duration in CloudWatch logs indicates a cold start, but with provisioned concurrency, this happens proactively.
Concurrency = Number of function instances running simultaneously
Types:
1. Unreserved Concurrency (Default):
2. Reserved Concurrency:
3. Provisioned Concurrency:
Purpose: Share code and dependencies across functions
Characteristics:
Use cases:
Example:
Function 1 ──┐
Function 2 ──┼──► Layer (Pandas, NumPy, Requests)
Function 3 ──┘
Purpose: Configure function without changing code
Characteristics:
process.env (Node.js) or os.environ (Python)Example:
import os
DB_HOST = os.environ['DB_HOST']
DB_USER = os.environ['DB_USER']
Synchronous (Request-Response):
Asynchronous (Fire-and-Forget):
Stream-Based (Poll-Based):
Execution Role (IAM role):
lambda.amazonaws.com trust relationshipResource-Based Policy:
VPC Integration:
Encryption:
✅ Separate handler from core logic: Easier testing
✅ Use environment variables: Configuration without code changes
✅ Minimize deployment package: Faster cold starts
✅ Use Layers: Share dependencies
✅ Enable X-Ray: Distributed tracing
✅ Set appropriate timeout: Avoid hanging functions
✅ Use DLQ: Capture failed events
✅ Monitor with CloudWatch: Logs, metrics, alarms
Amazon CloudWatch is a monitoring and observability service that provides data and actionable insights for AWS resources and applications.
1. Metrics:
2. Logs:
3. Alarms:
4. Events (EventBridge):
5. Dashboards:
Default Metrics (no agent required):
Custom Metrics (requires agent or SDK):
Metric Resolution:
Cost Optimization: For most workloads, 5-minute standard metrics are sufficient. Only enable 1-minute detailed monitoring for critical production instances that require faster response to metric changes.
Log Groups:
Log Streams:
Log Events:
Example:
Log Group: /aws/lambda/my-function
└─ Log Stream: 2025/10/19/[$LATEST]abc123
├─ 2025-10-19T10:30:00 START RequestId: abc123
├─ 2025-10-19T10:30:01 Processing event...
└─ 2025-10-19T10:30:02 END RequestId: abc123
Purpose: Interactive query and analysis of log data
Query Example:
fields @timestamp, @message
| filter @message like /ERROR/
| stats count(*) by bin(5m)
| sort @timestamp desc
| limit 20
Use cases:
States:
Example Alarm:
Metric: EC2 CPU Utilization
Threshold: > 80%
Period: 5 minutes
Evaluation: 2 consecutive periods
Action: Send SNS notification to ops-team@example.com
Actions:
Purpose: Collect additional metrics and logs from EC2 and on-premises
Collects:
Installation:
# Download and install agent
wget https://s3.amazonaws.com/amazoncloudwatch-agent/linux/amd64/latest/amazon-cloudwatch-agent.rpm
sudo rpm -U ./amazon-cloudwatch-agent.rpm
# Configure agent
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
# Start agent
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl \
-a fetch-config \
-m ec2 \
-s \
-c file:/opt/aws/amazon-cloudwatch-agent/config.json
Metrics:
Logs:
Alarms:
Dashboards:
| Service | Purpose | What It Monitors |
|---|---|---|
| CloudWatch | Performance monitoring | Metrics, logs, application performance |
| CloudTrail | API activity logging | Who did what, when (audit trail) |
| Config | Resource configuration tracking | Configuration changes, compliance |
Example:
Amazon CloudFront is a Content Delivery Network (CDN) that securely delivers data, videos, applications, and APIs globally with low latency and high transfer speeds.
Distribution:
Origin:
Edge Location:
Regional Edge Cache:
┌──────────┐ 1. Request ┌──────────────┐
│ User │───────────────→ │ Edge Location│
│ (Tokyo) │ │ (Tokyo) │
└──────────┘ └──────┬───────┘
│
Cache Miss? │ 2. Cache Hit?
▼
┌──────────────┐
│ Cached? │
└──────┬───────┘
│
NO │ YES
┌───────────────────────────┼───────────────┐
│ │ │
▼ │ ▼
┌──────────────┐ │ ┌──────────────┐
│ Origin │ 3. Fetch from │ │ Return from │
│ (S3 bucket │ origin │ │ cache │
│ us-east-1) │ │ │ │
└──────┬───────┘ │ └──────────────┘
│ │
│ 4. Cache & return │
└────────────────────────────┘
S3 Bucket:
Custom Origin (HTTP server):
Multiple Origins:
/api/* → ALB, /images/* → S3Cache Key:
TTL (Time To Live):
Cache-Control or Expires headersCache Invalidation:
/images/*, /index.html, /* (all)Cost Optimization: Cache invalidations can be expensive at scale. Instead of invalidating /*, use versioned file names (e.g., style.v2.css, logo-2025.png) or query string versioning (e.g., style.css?v=2). This eliminates the need for invalidation—just update your references to the new version.
Origin Access Control (OAC):
Signed URLs / Signed Cookies:
Geo-Restriction:
SSL/TLS:
HTTP/2 & HTTP/3:
Compression:
Connection Reuse:
Origin Shield:
Data Transfer Out:
HTTP/HTTPS Requests:
Invalidation:
✅ Static Website Hosting:
✅ Dynamic Content Acceleration:
✅ Video Streaming:
✅ API Acceleration:
✅ Software Distribution:
| Feature | CloudFront | S3 Transfer Acceleration |
|---|---|---|
| Purpose | Content delivery (caching) | Fast uploads to S3 |
| Direction | Download (origin → users) | Upload (users → S3) |
| Edge Locations | 450+ globally | Same edge locations |
| Caching | Yes | No |
| Use Case | Static websites, videos, APIs | Large file uploads |
| Service | Type | Use Case | Pricing Model |
|---|---|---|---|
| EC2 | Virtual servers | Full control, long-running | Per hour (On-Demand, Reserved, Spot) |
| Lambda | Serverless functions | Event-driven, short tasks | Per request + GB-second |
| Fargate | Serverless containers | Microservices, no server management | Per vCPU-second + GB-second |
| Service | Type | Use Case | Access Method |
|---|---|---|---|
| S3 | Object storage | Static files, backups, data lakes | HTTP API |
| EBS | Block storage | EC2 instance storage, databases | Attached to EC2 |
| EFS | File storage | Shared file system (Linux) | NFS mount |
| Service | Type | Use Case | Management |
|---|---|---|---|
| RDS | Relational | Transactional workloads (OLTP) | Managed (backups, patching) |
| Aurora | Relational (cloud-native) | High performance, HA | Fully managed |
| DynamoDB | NoSQL (key-value) | Low latency, scalable | Fully managed, serverless |
| Service | Purpose | Use Case |
|---|---|---|
| VPC | Network isolation | Create private networks in AWS |
| CloudFront | CDN | Fast content delivery globally |
| Route 53 | DNS | Domain registration, routing |
| ELB | Load balancing | Distribute traffic to EC2, containers |
✅ Know the 5 pricing models (On-Demand, Reserved, Spot, Dedicated)
✅ Security Groups are stateful, NACLs are stateless
✅ User Data runs once at first launch as root
✅ Instance Store data is lost on stop/termination
✅ S3 Standard-IA requires 30-day minimum storage
✅ Glacier Deep Archive is cheapest ($0.00099/GB)
✅ Versioning cannot be disabled (only suspended)
✅ Lifecycle policies automate transitions
✅ IAM is global (not region-specific)
✅ Roles for temporary credentials, Users for long-term
✅ Use groups to assign permissions
✅ Enable MFA for root and privileged users
✅ Multi-AZ = High Availability (synchronous replication)
✅ Read Replicas = Scalability (asynchronous replication)
✅ Cannot SSH into RDS instance (managed service)
✅ Restore creates new DB instance
✅ VPC is region-specific, subnets are AZ-specific
✅ IGW for internet access (public subnets)
✅ NAT Gateway for private subnet internet access (outbound only)
✅ VPC Endpoints avoid internet traffic (S3, DynamoDB FREE)
✅ 15-minute maximum execution timeout
✅ 10 GB memory maximum
✅ Cold start: 100ms-2s, Warm start: ~10ms
✅ Provisioned Concurrency eliminates cold starts
✅ Default metrics: CPU, Network, Disk I/O
✅ Custom metrics: Memory, Disk space (requires agent)
✅ Logs Insights for querying log data
✅ Alarms trigger actions (SNS, Auto Scaling, EC2)
✅ CDN with 450+ edge locations
✅ Origin Access Control (OAC) for S3 security
✅ Signed URLs for restricted content
✅ First 1,000 invalidation paths FREE per month