This lesson combines 4 topics: AWS Trusted Advisor, Cost Explorer and AWS Budgets, Reserved Instances and Savings Plans Deep Dive, Spot Instance Strategies.
Learning Objectives
- Understand Trusted Advisor: best practice recommendations
- Distinguish the 5 check categories
- Know how Support Plan tiers affect the available checks
- Apply it to cost + security optimization
- Analyze costs with Cost Explorer
- Set up AWS Budgets with alerts
- Use Cost Anomaly Detection
- Apply Cost Allocation Tags
- Compare RI and Savings Plans
- Understand Compute SP vs EC2 Instance SP
- Apply an RI/SP/On-Demand mix strategy
- Manage the RI Marketplace
- Understand Spot pricing and the interruption mechanism
- Apply Spot Fleet with allocation strategies
- Build fault-tolerant Spot architectures
- Combine Spot + On-Demand in an ASG
Part 1: AWS Trusted Advisor
1. Trusted Advisor Overview
AWS Trusted Advisor = online tool that gives real-time guidance to follow AWS best practices.
5 check categories
- Cost Optimization: identify wasted spending
- Performance: improve speed/throughput
- Security: identify security risks
- Fault Tolerance: improve availability
- Service Limits: usage approaching quotas
2. Check Categories Examples
Cost Optimization
- Low Utilization EC2 Instances (< 10% avg CPU 14 days)
- Underutilized EBS Volumes
- Idle Load Balancers
- Idle RDS DB Instances
- Reserved Instance optimization
- Savings Plans recommendations
Performance
- High Utilization EC2 (> 90% CPU)
- Large Number of Rules in SG (slow firewall)
- EBS Magnetic Volumes (consider gp3)
- CloudFront Content Delivery Optimization
- Overutilized EC2
Security
- Security Group with unrestricted access (0.0.0.0/0 on common ports)
- IAM password policy weak
- Root account without MFA
- S3 buckets with open permissions
- MFA on root account
- CloudTrail logging
- Exposed access keys
Fault Tolerance
- Not Multi-AZ RDS
- EBS snapshots missing
- Auto Scaling not configured
- VPN tunnel redundancy
- Direct Connect Single Connection
- Route 53 health checks missing
Service Limits
- Approaching limit on EC2 instances, EBS volumes, etc.
- 80% threshold warning
3. Support Plan Tiers
Basic / Developer plans
- Core checks only (7 checks):
- S3 bucket permissions
- Security Groups — unrestricted ports
- IAM use
- MFA on root
- EBS public snapshots
- RDS public snapshots
- Service limits
Business / Enterprise plans
- All checks available (200+)
- Programmatic API access
- Weekly notifications
- Recommended actions automation via EventBridge
Recommendation
- Production workload: Business Support minimum ($100/month or 10% of usage)
- Get full Trusted Advisor + AWS Health API + 24/7 support
4. Trusted Advisor Console
Dashboard
- Shows checks pass/warning/error per category
- Drill down to specific resources
Refresh
- Auto-refresh weekly (some checks)
- Manual refresh available
Exclude items
- Mark items as "ignored" (e.g., known issue, intentional)
5. API and Automation
AWS Support API
- Programmatic access to Trusted Advisor (Business+ plans only)
- Query checks, refresh, exclude items
EventBridge integration
- Trusted Advisor check status change → EventBridge event
- → Lambda auto-remediate
Example automation
Trusted Advisor: "SG with 0.0.0.0/0 on port 22 (SSH)"
→ EventBridge
→ Lambda: remove the rule (or alert)
6. Compute Optimizer (related)
Definition
AWS Compute Optimizer = ML-based right-sizing recommendations for EC2, EBS, Lambda, ASG.
Characteristics
- More detailed than Trusted Advisor
- 14-day analysis window
- Provides specific instance type recommendations
- Cost savings projection
Use case
- Right-size EC2 (downgrade overprovisioned)
- Lambda memory tuning
- EBS gp2 → gp3 migration
Pricing
- Free
7. AWS Health Dashboard
Definition
Service health dashboard with personalized events affecting your AWS account.
2 views
- Public health dashboard: general AWS service status
- Personal Health Dashboard (PHD): events affecting YOUR resources
Events
- AWS-wide outages
- Scheduled maintenance (RDS patching, EC2 retirement)
- Security events
- Resource-specific alerts (e.g., your EBS volume will be migrated)
AWS Health API (Business+ plans)
- Programmatic access
- Integration with monitoring tools
- Automated incident response
8. Common Patterns
Pattern 1: Weekly security review
- Friday review Trusted Advisor security checks
- Document exceptions, fix violations
Pattern 2: Auto-remediate
Trusted Advisor: "S3 bucket public"
→ EventBridge event
→ Lambda → block public access
→ SNS notify team
Pattern 3: Cost saving sprint
- Monthly Cost Optimization checks
- Right-size underutilized EC2 (Compute Optimizer)
- Migrate gp2 → gp3 (Trusted Advisor + Compute Optimizer)
- Delete idle resources
Pattern 4: Service limit monitoring
- Trusted Advisor warns at 80%
- Auto-create AWS Support ticket to increase limit
- Avoid hitting limits in production
Part 2: Cost Explorer and AWS Budgets
1. AWS Cost Management Suite
Tools overview
- AWS Billing Console: invoices, payments
- Cost Explorer: visualize + analyze costs
- AWS Budgets: set alerts on cost/usage
- Cost Anomaly Detection: ML detect anomalies
- AWS Cost Categories: group costs by custom logic
- AWS Pricing Calculator: estimate before deploy
- Cost & Usage Report (CUR): detailed CSV/Parquet
2. Cost Explorer (Recap + Advanced)
Visualize options
- Granularity: Hourly (14 days history), Daily (38 months), Monthly (38 months)
- Group by: Service, Region, Account, Tag, Usage Type, Instance Type, Linked Account, Charge Type, Purchase Option
- Filter: similar dimensions
- Forecast: predict next 1-12 months based on past
Reports
- Daily, Monthly, Year-over-Year
- Save filter as Custom Report
- Schedule email reports (Cost Reports)
Reserved Instance / Savings Plans Recommendations
- Analyze past usage
- Suggest RI/SP purchase for savings
- Show estimated savings
Right-sizing recommendations
- Identify underutilized EC2
- Suggest smaller instance type
- Combined with Compute Optimizer (more detailed)
3. AWS Budgets
4 budget types
- Cost budget: dollars
- Usage budget: hours, GB, requests
- RI/SP budget: utilization, coverage
- Action-based budget: trigger actions on threshold
Actions (Budget Actions)
- Send SNS notification
- Apply IAM policy (restrict permissions)
- Stop EC2/RDS instances
- Target SCP in Organizations
Alerting
- Email (up to 10 recipients)
- SNS topic
- AWS Chatbot (Slack, Teams)
Cost
- 2 budgets free
- $0.02/budget/day after
4. Cost Anomaly Detection
Definition
ML-powered service that detects unexpected cost spikes.
Setup
- Monitor types:
- AWS services (per service)
- Linked Account (per account in Organization)
- Cost Categories
- Cost Allocation Tags
- Threshold: dollar amount OR percentage increase
- Subscription: email/SNS
Detection
- Algorithm learns normal pattern (14+ days)
- Alerts on anomalies (statistical significance)
- Suggests root cause (which service/resource increased)
Cost
- Free
Use case
- Detect hacker mining crypto on EC2
- Catch app bug causing Lambda invocation spike
- Identify cost surprises before month-end
5. Cost Allocation Tags
2 types
- AWS-generated:
aws:createdBy,aws:cloudformation:stack-name - User-defined:
Project,Environment,CostCenter,Owner
Activation
- Tag resources (manually or via Tag Policies)
- Billing Console → Cost Allocation Tags → Activate
- Wait ~24 hours for tag to appear in Cost Explorer
- Filter/group by tag in Cost Explorer
Best practice
- Mandatory tags via SCP: enforce tagging
- Tag policies via Organizations: standardize values
- Tag missing → automation: Lambda finds untagged → notify owner
Common tag schema
Project (string): "ProjectX"
Environment (enum): "prod", "staging", "dev", "test"
Owner (email): "alice@company.com"
CostCenter (string): "CC-1234"
Application (string): "billing-service"
6. Cost Categories
Definition
Cost Categories = group costs by custom rules for reporting.
Setup
- Define category with rules:
- Match by account, service, tag, charge type
- Multiple categories per cost
Example
Use case
- Multi-team chargeback
- Department billing
- Project P&L
7. Cost & Usage Report (CUR)
Definition
CUR = most detailed billing data, delivered to S3 daily.
Format
- CSV, Parquet, ORC
- Includes: every line item with usage, cost, tax, credits, etc.
Analysis
- Athena: SQL queries
- QuickSight: visualizations
- 3rd party tools: Cloudability, CloudHealth
vs Cost Explorer
- Cost Explorer: visual UI, summarized
- CUR: raw data, granular, customizable
Use case
- Custom dashboards beyond Cost Explorer
- FinOps team analysis
- Chargeback to departments
8. AWS Pricing Calculator
Workflow
- Add services to estimate (EC2, S3, etc.)
- Configure: instance type, hours, storage, transfer
- Calculator estimates monthly + 12-month cost
- Export PDF/CSV
- Share via URL
Use case
- Estimate before deploy
- Present to stakeholders / management
- Compare options (EC2 vs Lambda vs Fargate)
- Migration planning
URL
9. Cost Optimization Workflow
Monthly cycle
- Review Cost Explorer (last month)
- Identify top cost drivers, anomalies
- Right-size with Compute Optimizer
- Reserved Instance / Savings Plans recommendations
- Tag compliance check (untagged resources)
- Budget review vs actual
- Action items: optimization, cleanup
Quarterly
- Audit unused resources (idle EC2, unattached EBS)
- Review storage classes (S3 lifecycle)
- Check Reserved Instance utilization
- Renew or modify RI as needed
10. Common Cost Optimization Strategies
1. Right-sizing
- Compute Optimizer recommendations
- Schedule shutdowns for dev/test (off-hours)
- AWS Instance Scheduler service
2. Reserved Instances / Savings Plans
- 3-year AURI: up to 72% off
- Compute Savings Plans: flexible
3. Spot Instances
- Fault-tolerant workloads
- Up to 90% off
4. Storage tiering
- S3 lifecycle to IA/Glacier
- EBS gp2 → gp3 (~20% saving)
- EFS Lifecycle Management
5. Reduce data transfer
- VPC Endpoints (avoid NAT/IGW)
- CloudFront caching
- Same-region traffic
6. Delete unused resources
- Idle EC2, RDS, ELB
- Unattached EBS volumes
- Unused EIPs
- Old snapshots
7. Lambda vs EC2 for low traffic
- Lambda free tier: 1M requests/month
- Often cheaper for sporadic workload
8. Use ARM (Graviton)
- t4g, m6g, c7g instances ~20% cheaper
Part 3: Reserved Instances and Savings Plans Deep Dive
1. Reserved Instances (RI) Recap
Term
- 1 or 3 year commitment
- Discount up to 72%
Payment options
- All Upfront (AURI): most discount
- Partial Upfront (PURI): medium
- No Upfront (NURI): least discount
Offering Class
- Standard RI: locked attributes, can sell on Marketplace
- Convertible RI: exchange to other instances (of equal or greater value), cannot sell
Scope
- Regional RI (default): apply to any AZ in Region, no capacity reservation
- Zonal RI: 1 AZ, capacity reservation included
Applies to
- EC2, RDS, ElastiCache, OpenSearch, Redshift, DynamoDB
2. Savings Plans (SP) Recap
Commitment
- $/hour for 1 or 3 years
- e.g., commit $5/hour for 1 year → $$$$ savings
3 types
- Compute Savings Plans: most flexible
- EC2 Instance Savings Plans: limited to 1 family + region
- SageMaker Savings Plans: for SageMaker
Applies to
- Compute SP: EC2 (any family, region, OS, tenancy), Fargate, Lambda
- EC2 Instance SP: 1 family, 1 region, any OS/tenancy/size
- SageMaker SP: SageMaker training/inference
3. RI vs Savings Plans Comparison
| Feature | Reserved Instance | Savings Plans |
|---|---|---|
| Commitment | Specific instance attributes | $/hour spend |
| Applies to | Specific service (EC2/RDS/etc.) | Compute (EC2+Fargate+Lambda) or EC2 family |
| Flexibility | Convertible RI = some | Compute SP = highest |
| Marketplace | Standard RI can sell | Cannot sell |
| Discount | Up to 72% | Up to 72% |
| Discount priority | RI applies first | SP applies after RI |
| Use case | Specific predictable workload | Flexible compute commitment |
Discount Application Order
1. AWS-generated discounts (free tier, promotional credits)
2. Reserved Instance discounts
3. Savings Plans discounts (after RI)
4. Remaining usage at On-Demand rate
4. Detailed: Compute Savings Plans
Flexibility
- Switch EC2 family (m5 → c5 → r5)
- Switch region
- Switch OS (Linux → Windows)
- Switch tenancy
- Apply to Fargate, Lambda
Use case
- Multi-region apps
- Workload may evolve (migrate to Fargate, Lambda)
- Most cost-conscious teams
Discount
- Up to 66%
5. Detailed: EC2 Instance Savings Plans
Flexibility
- Same family (e.g., m5) + same region
- Switch size (m5.large → m5.xlarge)
- Switch OS
- Switch tenancy
Use case
- Specific EC2 family standardization
- Known region
Discount
- Up to 72% (highest within SP)
6. Combining RI + SP + On-Demand
Best practice mix
Baseline 24/7 workload → Reserved Instance 3y AURI (72% off)
Variable 80% of week → Savings Plans 1y (66% off)
Peak hourly burst → On-Demand (no commitment)
Background batch → Spot (90% off)
Example calculation
- Workload: 10 EC2 m5.large baseline + 5 peak during business hours
Strategy A: 100% On-Demand
- 15 instances × $0.10/hr × 730 hr = $1,095/month
Strategy B: Mix RI + On-Demand
- 10 RI 3y AURI: 10 × $0.04/hr × 730 = $292/month
- 5 On-Demand peak (8 hr/day, 22 days): 5 × $0.10 × 176 = $88
- TOTAL: $380/month (saving 65%)
7. RI Utilization Best Practices
Track utilization
- Cost Explorer → Reserved Instance Utilization report
- Target: 90%+
- Below 50%: waste, consider modify
Improve utilization
- Regional RI > Zonal RI (more flexible)
- Convertible RI for changing workload
- Standard RI for predictable
Sell on Marketplace (Standard RI only)
- List remaining term
- Buyers purchase shorter-term RIs
- Recover cost when no longer needed
8. Savings Plans Utilization
Track
- Cost Explorer → Savings Plans Utilization
- Target: 90%+
- Below 70%: review
Optimize
- Right-size commitment (don't over-commit)
- Use Compute SP for flexibility
- Stack multiple SPs for granularity
Cannot resell
- Avoid over-committing
9. Capacity Reservations (ODCR)
Definition
On-Demand Capacity Reservation = reserve capacity (instance available when needed) without commitment.
Characteristics
- No discount on price (same as On-Demand)
- Reserve capacity in specific AZ
- Cancel anytime
- Can combine with SP/RI for discount
Use case
- Critical events (Black Friday, product launch)
- DR scenario (ensure capacity for failover)
- Stable workload needing AZ-specific capacity
vs Zonal RI
- Zonal RI: capacity + discount + 1y/3y commitment
- ODCR: capacity only, no commitment, can pair with SP/RI for discount
10. RI Pricing Math Example
Scenario: 1 m5.large 24/7 for 3 years (us-east-1, Linux)
| Pricing | $/hour | 3-year total | Saving |
|---|---|---|---|
| On-Demand | $0.096 | $2,524 | 0% |
| 1-year No Upfront RI | $0.067 | $1,760 | 30% |
| 1-year All Upfront RI | $0.063 | $1,650 | 35% |
| 3-year No Upfront RI | $0.042 | $1,104 | 56% |
| 3-year All Upfront RI | $0.033 | $867 | 66% |
| Compute SP 3y AURI | $0.034 | $895 | 64% |
| EC2 SP 3y AURI | $0.030 | $789 | 69% |
Numbers approximate, verify on AWS Pricing.
11. Free Trial / Credits
Free Tier
- 12 months free (e.g., 750 EC2 t2.micro hours)
- Always-free services (Lambda 1M requests)
AWS Credits
- Promotional credits (events, contests)
- Apply to specific services or all
- Expire after period
AWS Activate (startups)
- Up to $100K credits for startup founders
12. Common Pricing Patterns
Pattern 1: Stable production
- 100% RI 3-year AURI
- Lowest cost for predictable workload
Pattern 2: Growing workload
- Compute SP 1-year (re-evaluate yearly)
- Some On-Demand for growth headroom
Pattern 3: Variable + batch
- Baseline: SP for steady state
- Peak: On-Demand
- Batch: Spot
Pattern 4: Serverless
- Lambda + Fargate covered by Compute SP
- Pay-per-execution savings on top
Part 4: Spot Instance Strategies
1. Spot Recap
Spot Instances = unused EC2 capacity at up to 90% discount; AWS can reclaim it with a 2-min warning.
When to use
- Fault-tolerant workloads (can interrupt + retry)
- Stateless or checkpoint-based
- Big data, ML training, image rendering
- CI/CD workers, dev/test environments
When NOT to use
- Database (stateful)
- Mission-critical apps
- Workloads that cannot be replaced mid-execution
2. Spot Pricing
Pricing model
- AWS sets price based on capacity supply/demand
- You set max price willing to pay
- If Spot price ≤ max → instance runs
- If Spot price > max → instance terminated
Spot Price History
- View past 90 days
- Identify stable instance types/AZs
- Avoid volatile pools
Best practice
- Set max price = On-Demand price (makes the instance less likely to be reclaimed because of price)
- Spot interruption due to capacity, not price (most common reason)
3. Spot Interruption Behaviors
3 options
- Terminate (default): instance destroyed
- Stop: stop instance, keep EBS, restart later if Spot available
- Hibernate: save RAM to EBS, fast resume
Stop and Hibernate require
- EBS-backed
- Specific instance types
Use case for each
- Terminate: stateless, can replace
- Stop: large state, OK to pause
- Hibernate: warm cache, fast resume needed
4. Spot Interruption Notice
Workflow
- AWS decides to reclaim instance
- 2-minute warning sent via instance metadata
- App should:
- Save state (S3, DynamoDB)
- Drain connections (deregister from ELB)
- Checkpoint progress
- After 2 min: instance terminated
Check warning
# Inside instance
curl http://169.254.169.254/latest/meta-data/spot/instance-action
# Returns terminate time if interruption coming
EventBridge integration
- Spot interruption event → Lambda → handle
- E.g., update database, notify monitoring
5. Spot Allocation Strategies (Spot Fleet & ASG)
Why important
- Pool = combination (instance type + AZ + OS + tenancy)
- Spread across pools = less interruption
Strategies
lowestPrice
- Cheapest pool
- Higher interruption risk
- Use: cost-sensitive batch
diversified
- Spread evenly across all pools
- Better availability
- Use: stateless workloads
capacityOptimized
- Pool with largest available capacity
- Lowest interruption rate
- Use: workloads that prioritize uptime above all
priceCapacityOptimized (AWS-recommended default)
- Balance lowest price + lowest interruption
- Use: most workloads — AWS currently recommends it as the default
Decision
- price-capacity-optimized: default for most workloads (AWS recommended)
- capacity-optimized: priority is uptime (lowest interruption)
- lowest-price: priority is cost (more risk)
6. Spot Fleet
Definition
Spot Fleet = managed group of Spot (+ optional On-Demand) instances meeting target capacity.
Features
- Mix multiple instance types/families
- Multiple Spot pools
- Optional On-Demand baseline
- Auto-replace terminated instances
Configuration
Spot Fleet:
Target capacity: 100 instances (or vCPUs or memory units)
On-Demand portion: 20 (always running)
Spot portion: 80 (price-sensitive)
Allocation strategy: capacity-optimized
Instance types pool:
- m5.large
- m5.xlarge
- m5a.large
- c5.large
- c5a.large
7. EC2 Auto Scaling with Mixed Instances
Mixed Instances Policy
- ASG launches multiple instance types
- Mix Spot + On-Demand
- Specify base capacity (On-Demand) + percentage (Spot)
Example
ASG:
Min: 2, Desired: 10, Max: 50
On-Demand base: 2 (always)
On-Demand percentage above base: 20% (2 of every 10 above base)
Spot percentage: 80%
Instance types:
- m5.large
- m5a.large
- m5n.large
- m4.large
Spot allocation strategy: capacity-optimized
Result
- 2 baseline On-Demand
- Above 2: 20% On-Demand, 80% Spot
- E.g., at desired=10: 4 On-Demand + 6 Spot
8. Spot Best Practices
1. Design for interruption
- Stateless or checkpoint state
- Idempotent operations
- Use SQS for work distribution (resume if interrupted)
2. Diversify
- Multiple instance types, AZs
- Reduce dependency on single pool
3. Use capacity-optimized
- Lowest interruption
- Often default best choice
4. Combine with Spot
- Spot for elasticity (scale out/in)
- On-Demand + Spot blend
5. Test handle interruption
- Simulate via metadata or AWS Fault Injection Simulator
- Verify app saves state, fails gracefully
9. Use Cases
Big Data (Spark, EMR)
- EMR managed Spot + On-Demand cluster
- Master + core: On-Demand (stable)
- Task nodes: Spot (fault-tolerant compute)
CI/CD
- Jenkins agents on Spot
- Multiple instance types
- Fallback to On-Demand if Spot unavailable
Batch processing
- AWS Batch with Spot pricing
- Auto-retry on interruption
Containerized workloads
- ECS / EKS with Spot
- Spot nodes for stateless services
- Persistent state in RDS/EFS
Image/video rendering
- Render farm on Spot
- Each job checkpoint progress
- Resume if interrupted
10. Spot vs On-Demand Cost Example
Scenario: 100 m5.large for batch (4 hours/day)
Pure On-Demand
- 100 × $0.096/hr × 4 hr × 30 days = $1,152/month
Spot (70% discount, ~10% interruption overhead)
- 100 × $0.029/hr × 4 hr × 30 days × 1.1 = $382/month
- Saving: ~$770/month (66%)
11. Common Architecture Patterns
Pattern 1: Web app baseline + Spot scale
ASG:
- 5 On-Demand baseline (always)
- Auto-scale up to 50 with mix:
- 20% On-Demand (reliability)
- 80% Spot (cost)
- capacity-optimized strategy
Pattern 2: Big data pipeline
EMR cluster:
- Master + Core: On-Demand
- Task nodes: Spot Fleet (mix m5, c5, r5)
- Checkpoint to S3 frequently
Pattern 3: ML training
SageMaker Training:
- Use Managed Spot Training
- Save model checkpoints to S3
- Resume from checkpoint if interrupted
- 70-90% saving
Pattern 4: CI/CD farm
Jenkins or GitHub Actions runners:
- Auto-launch Spot instance per job
- Self-host runner on Spot
- Reduce idle cost vs always-on
12. Spot Limits
Service quotas
- Default: 256 vCPUs per region for Spot
- Request increase if needed
Region/AZ availability
- Some instance types not in all regions
- Availability changes (capacity)
Cannot use Spot for
- Dedicated Hosts
- Dedicated Instances
- Capacity Reservations
- Some specific instance types
Review Questions
-
What are the 5 categories of Trusted Advisor?
Show answer
(1) Cost Optimization — idle resources, underutilized EC2, unattached EBS. (2) Performance — CloudFront config, EC2 instance types. (3) Security — open security groups, IAM MFA, exposed access keys, S3 public buckets. (4) Fault Tolerance — Multi-AZ RDS, Auto Scaling, EBS snapshots. (5) Service Limits (Quotas) — alerts when usage > 80% of the service limit.
-
Does the free tier get access to all checks?
Show answer
No — the free tier (Basic/Developer Support) only has access to 7 core checks: S3 public buckets, Security Groups unrestricted ports, IAM use, MFA on root, EBS public snapshots, RDS public snapshots, and Service Limits. To access all ~400+ checks you need a Business or Enterprise Support plan ($100+/month). AWS Organizations can aggregate checks cross-account.
-
How does Compute Optimizer differ from Trusted Advisor?
Show answer
Compute Optimizer: uses ML to analyze 14 days of CloudWatch metrics and recommend the optimal EC2 instance type, Lambda memory, EBS volume type, ECS on Fargate. The recommendations are very specific, with cost/performance impact estimates. Trusted Advisor: broad recommendations across 5 categories, not just compute. Compute Optimizer is deeper and ML-driven for sizing; Trusted Advisor has broader coverage. Both are free (Compute Optimizer free tier available).
-
What does the AWS Health Dashboard show?
Show answer
The AWS Health Dashboard (Service Health Dashboard + Personal Health Dashboard) shows: (1) AWS service health globally and per region, (2) Upcoming maintenance scheduled events affecting your resources, (3) Account-specific events — for example, your EC2 instance is running on hardware that is about to undergo maintenance. Unlike a generic status page, the Personal Health Dashboard only shows events relevant to your account.
-
What is the threshold percentage for the service limit warning?
Show answer
80% — Trusted Advisor warns when usage reaches 80% of the service quota (limit). This lets you request an increase before you hit the hard limit and cause an outage. Example: EC2 instance limit 1000, currently using 800 → warning. Request a quota increase through the Service Quotas console before reaching 100%. Some quotas can be increased automatically (soft limits), some need AWS review (hard limits).
-
What are the Cost Explorer granularity options?
Show answer
Hourly (data retained 14 days), Daily (38 months), Monthly (38 months). Hourly granularity costs extra via the API but is free in the console. Hourly is useful to identify spikes within a day. Monthly is enough for a high-level budget review. Daily is for weekly trend analysis. You can also filter by Service, Linked Account, Tag, Region, Usage Type, Instance Type.
-
Is Cost Anomaly Detection free?
Show answer
Free — Cost Anomaly Detection (2020) has no separate charge. It uses ML to detect cost anomalies compared with historical patterns and sends alerts via email or SNS when found. You can set up monitors by individual service, AWS account, cost category, or cost allocation tag. It can catch ransomware mining, data exfiltration, and code bugs that cause cost spikes — before you get the end-of-month bill.
-
How long after activation do Cost Allocation Tags appear in Cost Explorer?
Show answer
24 hours after activation. Importantly: only cost data after the activation time is tagged — it is not retroactive. And tags must be activated in the Billing Console (Billing → Cost Allocation Tags) — tagging resources alone is not enough. Workflow: tag resources → activate tag → wait 24h → filter by tag in Cost Explorer.
-
How does CUR differ from Cost Explorer?
Show answer
Cost and Usage Report (CUR): raw, granular CSV/Parquet data exported to S3 — every line item (hourly), resource IDs, pricing details, reservation usage. Used with Athena, QuickSight, third-party tools for custom analysis. Cost Explorer: interactive visualization, predefined dashboards, forecasting, recommendations — not as granular as CUR but easier to use. CUR is for advanced analytics; Cost Explorer is for quick insights.
-
How does Compute Optimizer differ from the Cost Explorer recommendations?
Show answer
Compute Optimizer: uses ML to analyze CloudWatch utilization metrics (CPU, network, memory from the agent) to recommend the optimal EC2 instance type, Lambda memory, EBS size — very specific, with performance trade-offs. Cost Explorer right-sizing: recommendations based on simpler CloudWatch metrics, focused on EC2 cost savings. Compute Optimizer has a better ML model and analyzes Lambda and EBS — Cost Explorer only covers EC2.
- Discount priority: is RI applied before or after SP?
Show answer
RI is applied first, then Savings Plans. Both compare usage against committed resources: RI matches the exact instance type/AZ/OS configuration first; Savings Plans are more flexible and apply after RI. The two cannot "stack" on the same hour — an hour covered by RI is no longer available to SP. Unused RI/SP is still "charged" even when unused — designed to maximize utilization.
- What does a Convertible RI let you change?
Show answer
A Convertible RI lets you exchange it for another RI of equal or greater value: change instance family (m5 → r5), OS (Linux → Windows), tenancy (shared → dedicated), size. You cannot change Region or term (the RI is tied to a Region). You cannot exchange down to a lower value (you must exchange several small RIs for one large RI). AWS applies blended pricing on exchange. The discount is lower than a Standard RI (~54% vs ~72%) to offset the flexibility.
- How does EC2 Instance SP differ from Compute SP in flexibility?
Show answer
EC2 Instance SP: commits to a specific instance family in a specific Region (for example: m5 in us-east-1) — you can change size (m5.large → m5.4xlarge) and OS. Compute SP: flexible across instance family, size, Region, OS, and even Lambda + Fargate. EC2 Instance SP has a higher discount (~72%); Compute SP is lower (~66%) but far more flexible. Compute SP fits workloads that change.
- Can a Standard RI be sold on the Marketplace?
Show answer
Yes — a Standard RI can be resold on the AWS Reserved Instance Marketplace when no longer needed. Conditions: not an All-Upfront RI bought < 30 days ago, must be a 1-year RI with at least 1 month remaining, not Windows/RHEL/SUSE with dedicated tenancy. Convertible RIs cannot be sold on the Marketplace — that is the trade-off for flexibility. The seller sets the price; AWS takes a 12% fee.
- Does ODCR come with a discount?
Show answer
No — an On-Demand Capacity Reservation (ODCR) is charged at the On-Demand rate even when unused. ODCR only guarantees capacity is available when needed (no "capacity unavailable" errors). To get both a capacity reservation and a discount, combine it with a Zonal RI or Savings Plans — they automatically apply the discount to the matching ODCR. Useful for disaster recovery capacity reservation.
- How long before termination does the Spot interruption warning come?
Show answer
2 minutes (120 seconds). AWS sends the Spot Instance interruption notice via Instance Metadata (/latest/meta-data/spot/termination-time) and EventBridge. The application must checkpoint work, drain connections, and save state within those 2 minutes. Best practice: poll metadata every 5 seconds, configure ASG lifecycle hooks to gracefully drain from the LB before termination.
- Which allocation strategy gives the lowest interruption?
Show answer
The capacity-optimized strategy — AWS picks the pools with the most capacity (and therefore the least likely to be interrupted). Unlike lowest-price (default), which picks the cheapest pool. capacity-optimized-prioritized combines both: AWS prioritizes the pools you specify but still optimizes for capacity. For workloads where reliability matters more than lowest cost — batch ETL or HPC jobs should use capacity-optimized.
- Can Spot instances Stop or Hibernate?
Show answer
Yes — instead of terminating, Spot can Stop (EBS-backed only — instance state is kept on EBS) or Hibernate (RAM dumped to EBS, instance stopped, resumes to the exact state). You configure the interruption behavior in the request. Hibernate suits workloads that need memory state preserved (ML inference models loaded). It requires EBS with capacity ≥ RAM size, and an instance type/OS that supports hibernation.
- When should you NOT use Spot?
Show answer
Do not use Spot for: (1) Databases (stateful, interruption causes data loss or corruption), (2) Stateful web servers without proper drain/failover, (3) Long-running jobs without checkpoints (all progress lost on interruption), (4) Compliance workloads that need guaranteed availability, (5) Primary instances in HA architectures without an On-Demand fallback. Spot needs fault-tolerant, stateless, or checkpoint-capable workloads.
- What is a Mixed Instances Policy in an ASG?
Show answer
A Mixed Instances Policy lets an ASG use multiple instance types from the same base Launch Template. It combines On-Demand + Spot in the same ASG: On-Demand for baseline capacity (stable), Spot for burst capacity (lower cost). Configuration: On-Demand base %, list of instance types (AWS picks best availability), allocation strategy. It reduces Spot interruption by diversifying across many pools.
Hands-on Exercises
Part 1: AWS Trusted Advisor
- Open the Trusted Advisor console and review all checks
- Fix 1 Security finding (for example: SG 0.0.0.0/0:22)
- Enable Compute Optimizer, review EC2 recommendations
- Check Service Limits, request an increase if needed
- Set up EventBridge: Trusted Advisor security check fail → SNS
Part 2: Cost Explorer and AWS Budgets
- Open Cost Explorer, group by Service, identify the top 3 costs
- Create a $50 monthly cost budget with an email alert
- Enable Cost Anomaly Detection
- Activate the user-defined tags
ProjectandEnvironment - Estimate the cost of 1 EC2 t3.medium + RDS db.t3.small via Pricing Calculator
Part 3: Reserved Instances and Savings Plans Deep Dive
- Go to Cost Explorer → RI Recommendations
- Compare the cost of 1 m5.xlarge across 5 pricing models in Pricing Calculator
- Check your account's RI utilization (if any)
- (Experiment) Buy 1 Zonal RI for t3.micro 1-year No Upfront, observe afterwards
- Set up a Compute SP 1-year $1/hr commitment (cancellable within 7 days if just trying)
Part 4: Spot Instance Strategies
- Launch a Spot Instance with max price = On-Demand
- Listen for the instance metadata interruption notice
- Create an ASG with a Mixed Instances Policy (50% Spot, 50% On-Demand)
- Test Spot Fleet with 3 instance types
- Run a sample batch job on EMR with Spot task nodes
References
- Trusted Advisor
- Compute Optimizer
- Personal Health Dashboard
- Cost Explorer
- AWS Budgets
- Cost Anomaly Detection
- Pricing Calculator
- Cost Allocation Tags
- Reserved Instances
- Savings Plans
- Capacity Reservations
- Marketplace
- Spot Instances
- Spot Best Practices
- Mixed Instances Policy
- Spot Allocation Strategies