SRE Labs (Advanced Track) — Project Call 1: AWS Cost Optimization (Client: HealthCorp)

Structured educational resource covering sre labs (advanced track) — project call 1: aws cost optimization (client: healthcorp).

senior 45 min read 12 sections
#kubernetes#cloud-k8s#aws#gcp

Complete Learning Package (AWS FinOps · EC2 · EKS · Storage · Networking · FinOps Tooling)

Source: 2026-01-24-19-03-57.md — SRT transcript of the first Sunday project call of a 6-week DevOps training program called SRE Labs (Advanced Track). The session introduces the program’s structure, the client (HealthCorp — a Texas-based healthcare organization), the AWS cost inventory, a layered optimization framework, and a live demo of migrating EC2 instances from Intel to AMD architecture.

Framing note (read before trusting anything): This is a first-pass introductory call, not a technical deep-dive. Many specifics (scripts, Terraform files, architectural diagrams, savings-plan mathematics) were promised for later uploads and are not in this transcript. Where the session was interrupted by Q&A and left topics incomplete, I note it explicitly. Gap-fills from AWS engineering knowledge are clearly labelled in Section 14.


2. Table of Contents

  1. Executive Summary
  2. Table of Contents
  3. Detailed Structured Notes
    • 3.1 Program Structure — SRE Labs (Advanced Track) (6 weeks, 4 pillars)
    • 3.2 The Four Pillars of Real DevOps
    • 3.3 Project Series Overview (all 6 projects)
    • 3.4 Client Profile — HealthCorp (Healthcare)
    • 3.5 AWS Infrastructure Inventory — What HealthCorp Was Running
    • 3.6 Cost Baseline and Starting Point
    • 3.7 The Optimization Framework — Layered Approach
    • 3.8 Foundational Steps Before Any Optimization
    • 3.9 Tagging Strategy
    • 3.10 Native AWS Cost Tools to Enable
    • 3.11 EC2 Cost Optimization — Full Coverage
    • 3.12 CPU Architecture Families — Intel vs AMD vs ARM
    • 3.13 Architecture Assessment Tool (AWS Porting Advisor for Graviton)
    • 3.14 EC2 Migration Categories (Standalone / ASG / EKS Node Group)
    • 3.15 Live Demo — Migrating a Standalone EC2 from Intel to AMD
    • 3.16 Post-Migration Validation and Verification
    • 3.17 EKS Cost Optimization Tools
    • 3.18 Storage (EBS, S3) Cost Optimization
    • 3.19 Savings Plans — Concepts and Mathematics
    • 3.20 Networking Cost Optimization
    • 3.21 Monitoring and Logging Cost Optimization
    • 3.22 Security Tooling Cost Optimization
    • 3.23 Other Services (RDS, ElastiCache, DocumentDB, ECR → Harbor)
    • 3.24 Live Client Engagement — Polomial (GCP)
    • 3.25 Playground vs Production — What’s Replicated and What Isn’t
  4. Key Concepts Table
  5. Architecture & Workflow Analysis
  6. Commands, Scripts & Configs
  7. Tools & Technologies
  8. Real-World Production Usage
  9. Interview Preparation (Beginner / Intermediate / Advanced)
  10. Exam & Certification Notes
  11. Cheat Sheet
  12. Gaps, Assumptions & Incomplete Areas
  13. Gap-Fill — What the Session Left Unfinished, Completed Here

3. Detailed Structured Notes

3.1 Program Structure — SRE Labs (Advanced Track)

SRE Labs (Advanced Track) is a 6-week Sunday project-call program pairing theory with real client implementations. Each week maps to a project; each project maps to one of four DevOps pillars (cost, security, availability, scalability). The sessions include:

  • Live walk-through of a real client’s infrastructure and decisions.
  • A minimal playground replication participants can experiment on.
  • Production outages / failure case studies encountered in the project.
  • War-room-style debugging (separate Saturday sessions).
  • Weekly assignments (uploaded Mondays).

Two separate call types:

  • Saturday (“war room” / production-outage drills): Replicate the original infrastructure that the organization follows — production-grade setup.
  • Sunday (project calls): Walk through past real-client configurations, issues, and solutions.

Key distinction the instructor drew: Shadowing (live client call, e.g., Polomial on weekdays) = implementation live on client infra. Project calls = past client configurations/decisions + minimal replication in the playground. These are parallel tracks, not the same thing.


3.2 The Four Pillars of Real DevOps

PillarCore questionMaps to project
CostAre we spending cloud money efficiently?HealthCorp AWS cost optimization
SecurityIs the infrastructure protected?SecureAsset fintech security audit
AvailabilityCan it stay up under failure/load?500-microservice MNC (high availability)
ScalabilityCan it grow with traffic?Automation + AI project, MNC scale-out

3.3 Project Series Overview

#Client / ProjectFocusScheduled
1HealthCorp (healthcare, Texas)AWS cost optimization — all layersSession 1 (this call)
2SecureAsset (fintech, Grow ecosystem, India)Security audit on real infrastructure (GCP + AWS/EKS)Week 2
3Polomial (blockchain, India)Live client engagement — GCP cost opt → security hardening → GCP-to-AWS migration (50% workload)Weekly weekdays
4MNC (unnamed, India)500+ microservices; CI/CD at scale; Terraform at enterprise scale; full observability (system + user behavior + latency)~8 Feb (moved up)
5CleverOps (internal)Automation of DevOps repetitive tasks + self-healing infra + AI/MLOps integration~22 Feb
6Case study (own cloud platform)MLOps (Kubeflow, MLflow); cloud-platform architecture; AI infrastructureEnd of series

3.4 Client Profile — HealthCorp (Healthcare)

  • Type: Healthcare organization
  • Location: Texas, USA
  • Workload: Full AWS stack — compute, serverless, DB, storage, networking, security, monitoring
  • Environment model (problem): Single AWS account for prod, dev, and staging — no isolation.
  • Engagement: Cost optimization only. Instructor’s team was onboarded specifically for cost — not responsible for application design or architectural decisions. Original DevOps team was still in place.
  • Timeline: Engagement happened ~1 year prior to this session; access revoked since. Documentation, scripts, and inventory preserved locally.
  • Outcome: ~80% reduction in monthly AWS bill claimed.

3.5 AWS Infrastructure Inventory — What HealthCorp Was Running

The full inventory across all AWS services used:

Compute:

  • EC2 (~170 instances, majority Intel-based, mix of memory-optimized/compute-optimized/general)
  • EKS (Elastic Kubernetes Service)
  • Lambda (serverless)
  • ECS (Elastic Container Service)
  • Lightsail (commitment-based compute, similar to EC2)

Storage:

  • EBS (volumes, snapshots, GP2/GP3)
  • S3 (multiple tiers/lifecycle)
  • ECR (Elastic Container Registry — later migrated to Harbor)
  • Snapshots (idle volumes, unattached)

Networking:

  • NAT Gateway
  • VPC Peering
  • ALB (Application Load Balancer)
  • External/Elastic IPs
  • Global Accelerator

Database / Middleware:

  • RDS (PostgreSQL, SQL Server, MariaDB)
  • DynamoDB
  • DocumentDB
  • RedShift
  • ElastiCache (Redis/Memcached)
  • SQS, SNS, SCS

Monitoring / Logging:

  • CloudWatch (log groups, metrics)

Security:

  • AWS Inspector
  • GuardDuty
  • WAF (Web Application Firewall)
  • IAM

Other:

  • Savings Plans
  • Cost Explorer, Compute Optimizer, Trusted Advisor
  • Cost Anomaly Detection

3.6 Cost Baseline and Starting Point

EnvironmentMonthly Cost
Production~$45,000
Non-production (dev + staging)~$53,000
Total (all environments)~$98,000

Key insight: The non-production bill was nearly larger than production — a strong signal that dev/staging instances were running 24×7 with no scheduling, and were likely heavily overprovisioned since dev workloads are bursty and low-traffic.

Savings achieved (claimed): ~80% of total monthly bill.


3.7 The Optimization Framework — Layered Approach

The instructor explicitly recommends approaching AWS cost optimization layer by layer, in priority order based on cost impact:

Layer 1: COMPUTE
   ├── Server Computing: EC2, EKS, Lightsail
   └── Serverless: Lambda, ECS (Fargate)

Layer 2: NETWORK
   ├── NAT Gateway
   ├── VPC Peering / Data Transfer
   ├── ALB / ELB
   └── External/Elastic IPs

Layer 3: STORAGE / DATA
   ├── EBS (volumes, snapshots, GP2→GP3)
   └── S3 (lifecycle, tiering, Glacier)

Layer 4: MONITORING / LOGGING
   └── CloudWatch (log groups, retention, storage)

Layer 5: OTHER TOOLS
   ├── RDS / ElastiCache / DocumentDB
   ├── GuardDuty, Inspector, WAF
   └── ECR / artifact stores

Ordering rationale: Pick the layer consuming the most cost first, OR start from compute (usually the biggest driver) and work downward. The layer model ensures nothing is missed — the same mental model as the OSI-layer troubleshooting approach but applied to cost engineering.


3.8 Foundational Steps Before Any Optimization

Step 1 — Export a full inventory (by account, by environment, by resource type). HealthCorp used a Python/AWS SDK script to extract every resource’s metadata, utilization metrics, and current cost into a consolidated Excel workbook with one sheet per resource category.

Step 2 — Enable native AWS tools. (See Section 3.10.)

Step 3 — Implement tagging. (See Section 3.9.)

Step 4 — Categorize resources into:

  • Overprovisioned (underutilized) → downsize or switch architecture
  • Properly utilized → leave or optimize architecture only
  • Underprovisioned (overloaded) → upsize (rare during cost optimization engagements)

Step 5 — Establish a baseline period. Typically 90 days minimum; 365 days+ for stable production workloads with seasonal variation. Use CloudWatch metrics (CPU, RAM, storage I/O) over this window to identify trends and categorize instances. An attendee correctly noted that 90 days can miss seasonal or new-feature traffic spikes — baselining is a continuous and evolving process, not a one-time exercise.

Step 6 — Define and document the optimization plan per layer, per service, with expected savings in percentage and dollars.


3.9 Tagging Strategy

”Tagging is the most important thing if you are talking about cost engineering in any cloud provider.”

Mandatory tags for every resource (regardless of how it was created — console, Terraform, CLI):

Tag KeyExample ValuePurpose
Namehealthcorp-prod-eks-node-1Human-readable identification
Ownerdevops-teamAccountability for the resource
ENVprod / dev / stagingEnvironment isolation; enables cost split and shutdown scripts
LOBLOB-1 / LOB-2Line of Business — assigns cost to the team that owns it

Why LOB matters: In organizations with multiple business units, each team is accountable for their cloud spend. Without LOB tags, you cannot produce a team-level cost report or audit. When teams are audited they are asked why their spend deviated from budget — without tags, this is impossible to answer.

Automation benefit: Shutdown scripts for non-prod environments operate by tagENV=dev → stop all tagged instances at 10 PM IST, restart at 6 AM IST.


3.10 Native AWS Cost Tools to Enable

Enable these before any optimization work begins:

ToolWhat it doesPriority
Cost ExplorerVisualizes cost by service, resource, tag, time range; filter by instance ID, account, regionFirst
Compute OptimizerRecommends right-size for EC2, Lambda, EKS, Auto Scaling Groups; based on CloudWatch utilization dataSecond
Trusted AdvisorFive categories: Cost Optimization (idle/underused resources), Security (MFA, open ports), Performance (autoscaling, health checks), Service Limits (quota monitoring), Operational Excellence (AWS best practices)Third
Cost Anomaly DetectionAlerts on unexpected cost spikes per service/account; configurable thresholdsFourth

Cost Explorer — practical usage for post-migration validation:

  1. Filter by resource → EC2 → filter by instance ID.
  2. Filter by instance type (paste the new AMD/ARM type).
  3. Group by day to compare before/after migration costs.
  4. Export or screenshot for client reporting.

Trusted Advisor — key outputs:

  • Idle/underutilized EC2 instances → terminate or stop.
  • Unattached EBS volumes → delete.
  • Underutilized RDS → downsize or delete.
  • IAM users without MFA → security gap.
  • Open security groups (0.0.0.0/0 on 22/3389) → security gap.
  • High-utilization resources approaching quota → scale warning.

3.11 EC2 Cost Optimization — Full Coverage

The instructor listed every lever that exists. Grouped for clarity:

Architecture-level:

  • Migrate Intel → AMD (A-suffix instances): ~15–20% cost saving, minimal risk.
  • Migrate Intel/AMD → ARM/Graviton (G-suffix): ~30–40% cost saving, requires compatibility check.
  • Migration approach: assess → plan → categorize → migrate by category → monitor → verify.

Commitment-based:

  • Savings Plans (Compute or EC2): commit to a $/hr spend for 1 or 3 years; applies across instance families/regions.
  • Reserved Instances: commit to a specific instance type; larger discount but less flexible than Savings Plans.
  • 3-year + All Upfront = deepest discount; 1-year + No Upfront = most flexible.
  • Do not buy blindly. There is a calculator and dedicated mathematics for this (covered in a dedicated section of a future call).

Sizing:

  • Right-sizing: analyze 90–365 days of CloudWatch CPU/RAM/disk/network data; downsize overprovisioned; upsize underprovisioned (rare in cost context).
  • Tools: Compute Optimizer, Trusted Advisor, third-party tools (Spot.io, CastAI, StormForge).

Scheduling:

  • Non-prod shutdown: stop dev/staging instances off-hours (e.g., 10 PM–6 AM IST) via Lambda + EventBridge or a Jenkins-hosted script (avoids Lambda cost for the scheduler itself).
  • Tag-based targeting: ENV=dev → stop; ENV=prod → never touch.
  • Production instances: do not schedule stop/start unless explicitly cleared by the business.

Instance type switching:

  • Spot Instances for non-critical workloads: significant savings (up to 70–90%), but no availability guarantee — not suitable for production.
  • Lightsail: commitment-based compute, predictable billing; useful for stable, small workloads.

Availability Zone (AZ) optimization:

  • If instances are spread across multiple AZs unnecessarily, consolidate to reduce cross-AZ data transfer costs.
  • Note: Never compromise high-availability topology for cost — this requires explicit business sign-off.

Autoscaling:

  • Properly sized Auto Scaling Groups with min/max/desired ratios reduce idle capacity.
  • Scale-in during low-traffic periods; scale-out on demand.

Platform (OS) optimization:

  • Windows licenses are included in EC2 pricing and are significantly more expensive than Linux.
  • If the application can run on Linux, switch: immediate per-hour savings.

Stopped/idle instances:

  • Stopped instances still incur EBS charges. Identify and terminate truly unused instances.

Public IPs:

  • Elastic IPs not associated with a running instance are billed. Release unassigned EIPs.

3.12 CPU Architecture Families — Intel vs AMD vs ARM

ArchitectureAWS namingRelative costNotes
Intel (x86_64)No suffix (T3, M5, C5…)HighestDefault when creating instances; most widely used historically
AMD (x86_64)a suffix (T3a, M5a, C5a…)~15–20% cheaper than Intel equivalentSame x86_64 instruction set; compatible with Intel binaries for 99% of workloads
ARM / Gravitong suffix (M6g, C7g, T4g…)~30–40% cheaper than Intel equivalentDifferent instruction set; requires ARM-compatible binaries / dependencies

Identification shortcut:

  • Instance name ending in a (e.g., c5a.4xlarge) → AMD
  • Instance name ending in g (e.g., m6g.large) → Graviton/ARM
  • No letter suffix (e.g., t3.medium) → Intel

The HealthCorp example:

  • c5.4xlarge (Intel) → c5a.4xlarge (AMD): cost per hour $0.80 → $0.62 = $131/month saved per instance.
  • Across 120 instances: ~$935/month saved (architecture migration only).
  • ARM migration across eligible instances: additional ~$1,500/month.
  • Total from architecture change alone on 170 instances: ~$2,400+/month.

Migration safety rule:

  • Intel → AMD: Very safe. Both x86_64. Almost always a drop-in replacement. Verify with a 48–72 hr monitoring window.
  • Intel/AMD → ARM: Requires explicit compatibility assessment (see Section 3.13). Dependencies must be checked. Can migrate directly Intel → ARM, but Intel → AMD → ARM is safer (smaller blast radius per step).

3.13 Architecture Assessment Tool — AWS Porting Advisor for Graviton

Purpose: Scan application code dependencies for ARM incompatibilities before migrating to Graviton.

How it works:

  1. Install the tool locally (as a Python package or run as a Docker image).
  2. Point it at the project directory.
  3. It scans third-party library/dependency files (e.g., package.json for Node, requirements.txt for Python, pom.xml for Java) — not the application source code itself.
  4. It reports which libraries have x86-specific native binaries or known ARM incompatibilities, with line numbers.
  5. Output: a report identifying which packages are incompatible → developer changes those packages/versions → re-scan until clean → proceed with migration.

Workflow:

Developer: confirm application logic has no arch-specific code
DevOps: run AWS Porting Advisor → fix dependency issues
DevOps: test application on ARM instance in non-prod
DevOps: migrate prod instance after 7-day monitoring

Best practice: Developers own the assessment (they know the code). DevOps validates at the infrastructure level. Both perspectives are needed before migrating production.


3.14 EC2 Migration Categories

When migrating EC2 instances between architectures (Intel→AMD or Intel→ARM), instances fall into three operational categories, each with a different migration strategy:

CategoryDescriptionMigration complexity
Standalone instancesIndividual EC2 not in any ASG or EKS node groupSimplest (Intel→AMD). Hardest (AMD→ARM — requires re-image).
ASG-managed instancesEC2 in an Auto Scaling GroupIntermediate (Intel→AMD). Simpler (AMD→ARM — update Launch Template; ASG replaces nodes).
EKS node group instancesEC2 forming Kubernetes worker nodesMost complex (Intel→AMD — drain, cordon, replace). Simplest (AMD→ARM — update managed node group AMI).

Important: The complexity is inverted between Intel→AMD and AMD→ARM. Standalone is easiest for Intel→AMD but hardest for AMD→ARM (because you must re-image the whole node). EKS is hardest for Intel→AMD (node drain/cordon required) but easiest for AMD→ARM (Kubernetes manages the replacement).


3.15 Live Demo — Migrating a Standalone EC2 Instance from Intel to AMD

Exact steps demonstrated in the AWS console:

Phase 1: Identify the equivalent instance type

Current:    t3.medium   (Intel, x86_64)
Equivalent: t3a.medium  (AMD, x86_64)

Rule: same family, same size, add a suffix → equivalent AMD instance.

Phase 2: Take an AMI backup

  1. In EC2 console → select the instance → Actions → Image and Templates → Create Image.
  2. Name: IntelInstance-backup-<YYYY-MM-DD-HH:MM> (date+time in name for auditability).
  3. Description: "Backup taken while migrating Intel instance to AMD on <date>".
  4. Attach the EBS volume to the image.
  5. Add tags: Name, Owner, ENV, LOB.
  6. Click Create Image.
  7. Wait until the AMI status is Available before proceeding. Do not skip this step in production.

Phase 3: Stop the instance

  • Actions → Instance State → Stop.
  • Wait until status = stopped.

Phase 4: Change instance type

  • Actions → Instance Settings → Change Instance Type.
  • Enter t3a.medium → confirm.
  • The console shows the new per-hour price for verification.

Phase 5: Start the instance

  • Actions → Instance State → Start.
  • Instance comes up on AMD architecture.

Estimated downtime: ~1–2 minutes (stop + change + start). Plan for a maintenance window.

Phase 6: Monitor for 48–72 hours

  • Watch application performance, error rates, CloudWatch metrics.
  • If issues arise: stop instance → change back to t3.medium → start (rollback using the same change-instance-type flow, or launch from AMI backup).

Phase 7: Delete AMI backup after ~1–2 weeks

  • AMI storage costs money. Once confirmed stable, delete the backup.
  • Do not forget: the goal is cost reduction, not adding AMI snapshot storage costs.

Phase 8: Verify in Cost Explorer

  • Navigate to Cost Explorer → EC2 → filter by instance ID → group by day.
  • Compare yesterday’s cost (Intel) vs. today’s cost (AMD).
  • Screenshot the cost difference for client reporting.

3.16 Post-Migration Validation and Verification

ActionTimingPurpose
Monitor application performanceFirst 48–72 hoursCatch arch-specific runtime issues
Check error rates / logsFirst 48–72 hoursCatch dependency or binary compatibility issues
Verify cost in Cost ExplorerAfter ~24 hoursConfirm actual billing reflects new instance type
Performance test (load test)Before and after migrationQuantitative evidence of no degradation
Delete AMI backupAfter 1–2 weeks stableRemove snapshot storage cost
Update Terraform / IaCImmediatelyKeep infra-as-code reflecting actual state
Document and report savingsWeekly cadenceClient accountability; monthly reporting

Production best practice (from attendee): All instance changes in production should go through Terraform / Pulumi / IaC, not through console click-ops, for auditability, state file integrity, and rollback capability. In HealthCorp’s case, the original team used click-ops exclusively — the instructor acknowledged this is suboptimal and would be fixing it going forward.


3.17 EKS Cost Optimization Tools

The session named these tools but deferred the deep-dive to a future call:

ToolTypeWhat it does
KarpenterOpen-source (AWS)Node autoscaler; provisions the right instance type (cheapest that fits pod requirements) rather than generic ASG scaling
CastAIThird-party SaaSFull cluster cost optimization: right-sizing, spot orchestration, autoscaling, multi-cloud; also works on non-EKS clusters
KubecostOpen-source / SaaSKubernetes cost visibility and monitoring per namespace/deployment/pod
StormForge (implied name)Third-partySimilar to CastAI but with different feature set
EKS node group architecture migrationNative AWSManaged node group AMI update to ARM/Graviton; simplest path for AMD→ARM

Comparison mentioned: Karpenter alone vs. CastAI alone vs. Karpenter + CastAI together — the session plans a live analysis of all three combinations.


3.18 Storage Cost Optimization

EBS:

  • Identify and delete idle/unattached volumes. An unattached EBS volume continues billing. HealthCorp saving opportunity: ~$232/month from EBS cleanup alone.
  • Check assigned vs. used capacity. A 100 GB volume using 10 GB: either shrink or move data and re-attach a smaller volume.
  • Migrate GP2 → GP3: GP3 is cheaper per GB and offers better IOPS performance baseline. Straightforward for most workloads.
  • Volume shrinking procedure: Detach → snapshot → create new smaller volume from snapshot → attach. Cannot shrink in place; requires the snapshot round-trip.

S3:

  • Implement S3 Lifecycle Policies: automatically transition objects from Standard → Standard-IA (infrequent access) → Glacier (archive) based on age.
  • Rule of thumb: objects not accessed in 30 days → Standard-IA; not accessed in 90 days → Glacier or Glacier Deep Archive.
  • Significant savings at scale (logging buckets, backup buckets).

3.19 Savings Plans — Concepts and Mathematics

The session flagged this as important and complex, with a ~30–40 page dedicated document and its own calculator. Key concepts introduced:

Two types:

  1. Compute Savings Plans: Commit to a $/hr spend on compute; applies to EC2, Lambda, Fargate across all instance families, regions, and OS. Most flexible.
  2. EC2 Instance Savings Plans: Commit to a specific instance family in a specific region. Less flexible but deeper discount.

Commitment options (affecting discount depth):

TermPaymentDiscount
1 yearNo upfront~20–30%
1 yearPartial upfront~25–35%
1 yearAll upfront~30–40%
3 yearsAll upfrontDeepest discount (~40–60%)

Critical rule: Savings Plans apply only to On-Demand instances, not Spot. If you buy a plan expecting to cover Spot usage, it doesn’t work.

The mathematics the session deferred: How to analyze your baseline On-Demand spend, project future utilization, and determine the correct $/hr commitment to buy to maximize coverage without over-committing (unused Savings Plan commitment is wasted money). The AWS Savings Plans calculator + Cost Explorer “Recommendations” tab helps, but understanding the logic manually is essential.

What happens if you overbuy a Savings Plan? You’re locked in for 1–3 years. The plan cannot be resold directly (AWS Marketplace for Reserved Instances exists, but Savings Plans have no secondary market). You can reduce the effective loss by ensuring maximum On-Demand coverage, but you cannot cancel.


3.20 Networking Cost Optimization

Named for coverage but deferred to a later session:

  • NAT Gateway: Often the biggest surprise billing item. Every GB of data processed by a NAT Gateway is billed. Use VPC endpoints (S3, DynamoDB) to route traffic internally without NAT.
  • VPC Peering vs. Transit Gateway: Peering is cheaper for simple topologies; Transit Gateway adds cost but simplifies multi-VPC/multi-account.
  • Cross-AZ traffic: Data transferred between AZs is billed. Minimize unnecessary cross-AZ calls within an application.
  • ALB vs. NLB: ALBs are billed per LCU (Load Balancer Capacity Unit) — consolidate where possible.
  • Elastic IPs: Any EIP not associated with a running instance is billed. Audit and release.
  • Global Accelerator: Expensive per data transfer; validate whether latency improvement justifies cost vs. CloudFront.

3.21 Monitoring and Logging Cost Optimization

The Polomial live-client engagement had a ~$15,000/month CloudWatch logging bill alone. This was the focus of a separate live session. Key levers:

  • Log group retention policies: CloudWatch logs stored indefinitely by default. Set retention to 7/14/30/90 days based on compliance requirements.
  • Log export to S3 → Glacier: Export older logs to S3 and then transition to Glacier for cold storage at a fraction of CloudWatch pricing.
  • Metric filter reduction: Eliminate unused custom metrics and alarms.
  • Log level discipline: Applications logging at DEBUG level in production generate 10–100× the log volume of INFO/WARN. Set production log levels appropriately.
  • Third-party alternatives: Self-hosted Loki + Grafana as a cheaper alternative to CloudWatch for application logs.

3.22 Security Tooling Cost Optimization

Mentioned but not detailed in this session:

  • GuardDuty pricing: Based on GB of analyzed data (VPC Flow Logs, DNS logs, CloudTrail). Large environments pay significant amounts.
  • Inspector: Per-instance assessment pricing; schedule for non-prod vs. continuous for prod.
  • WAF: Per rule, per million requests.
  • Third-party security tools (unnamed) will be covered in the security audit project.
  • ECR → Harbor migration: ECR has per-GB storage and data-transfer costs. Self-hosted Harbor on EKS eliminates per-image-pull costs within the cluster. HealthCorp executed this migration as part of their cost optimization.

3.23 Other Services

ServiceOptimization lever mentioned
RDSRight-size instances; choose correct engine (PostgreSQL < SQL Server for licensing cost); use Aurora Serverless v2 for variable workloads; optimize storage auto-scaling
ElastiCacheRight-size node type; use reserved nodes for stable workloads
DocumentDBCovered in inventory; optimization deferred
RedShiftCovered in inventory; optimization deferred
ECRMigrated to Harbor (self-hosted on EKS) — eliminates ECR pull costs
LambdaRightsize memory (Lambda pricing scales with GB-seconds); move cron/scheduler Lambdas to Jenkins-hosted scripts to save Lambda invocation cost
SQS/SNSUsually low-cost; audit message retention and throughput

3.24 Live Client Engagement — Polomial (GCP)

A separate, parallel track from the Sunday project calls. Polomial is a blockchain-based organization with infrastructure on GCP.

Three phases:

  1. Phase 1 (current): GCP cost optimization on pre-prod environment.
  2. Phase 2: Security hardening on GCP.
  3. Phase 3: Migrate 50% of workloads from GCP to AWS (for high availability / multi-cloud).

Format: 1–2 calls per week on weekdays, live in the client’s GCP console. Participants can contribute to the actual client engagement. Hiring opportunity mentioned.

Yesterday’s activity: Exported inventory from the Polomial GCP console using scripts, producing the same type of inventory workbook as HealthCorp’s.


3.25 Playground vs Production — What’s Replicated

The session produced an extended Q&A on this. Clarified expectations:

AspectProduction (real client)Playground (training)
Infrastructure scale500 microservices, R6/X1 instances3–4 representative microservices
Instance typesLarge (r6.16xlarge, x1, etc.)Small (T3/T3a medium) — architecture mirrors prod; size doesn’t
Network topologyFull (ALB, ingress, DNS, Route53)Mirrors topology but on smaller scale
Real trafficYes (1M+ TPS)Simulated via load tools
Application codeReal (secrets removed)Full code on GitHub
Architecture shapeFull (500 services, all add-ons)3–4 services but same upstream/downstream flow
What you analyzeReal 500-service environment (read-only view)Playground environment (hands-on)

Key nuance: For the MNC project, participants will see and analyze the real 500-microservice production environment, but implement and experiment only in the playground (3–4 services replicating the same topology).


4. Key Concepts Table

ConceptExplanationExampleWhy It Matters
FinOps / Cost EngineeringDiscipline of managing cloud spend as a business metric, not an afterthoughtHealthCorp $98K/month → $20K targetCloud costs compound; unmanaged infra can 5–10× over time
Single account anti-patternAll environments (prod/dev/stage) in one AWS accountHealthCorp’s original setupNo cost isolation, no blast radius containment, no billing attribution
Resource taggingMetadata attached to every cloud resource for attribution, automation, and billingENV=dev, LOB=LOB-1Foundation of all FinOps: without tags, cost attribution is impossible
Compute OptimizerAWS tool that analyzes utilization and recommends right-sized instances”Downsize m5.xlarge to m5.large — 80% savings, < 40% CPU used”Removes guesswork from right-sizing
Trusted AdvisorAWS tool across 5 pillars: cost, security, performance, limits, ops excellenceLists idle EIPs, unattached EBS, MFA gapsFree health check across cost + security in one place
Cost Anomaly DetectionAlerts on unexpected cost spikes per service”EC2 cost spiked 300% vs yesterday”Catch runaway costs before end-of-month bill shock
Intel → AMD migrationSwitching EC2 instance from Intel (no suffix) to AMD (a suffix)t3.mediumt3a.medium~15–20% savings; minimal risk; 99% of workloads are compatible
Intel → ARM/Graviton migrationSwitching to ARM-based Graviton instances (g suffix)m5.largem6g.large~30–40% savings; requires compatibility assessment
AWS Porting Advisor for GravitonTool that scans application dependencies for ARM incompatibilitiesScans package.json, pom.xml, requirements.txtPrevents production breakage from incompatible native binaries
Standalone EC2 instanceInstance not managed by ASG or EKS node groupA single Nginx reverse-proxy EC2Simplest to migrate Intel→AMD; harder AMD→ARM
ASG-managed instanceEC2 in an Auto Scaling GroupWeb tier with min 2, max 10Intermediate complexity; update Launch Template
EKS node group instanceEC2 as Kubernetes worker nodeng-general-1 node groupComplex Intel→AMD (drain/cordon); simple AMD→ARM (AMI update)
AMI backupAmazon Machine Image snapshot before migrationPre-migration backupRollback option if migration causes issues
Right-sizingAdjusting instance type to match actual utilizationDownsize r5.4xlarge (8% CPU used) to r5.largeTypically the fastest-payback optimization
Savings PlansCommit to $/hr compute spend for 1–3 years for discount$1,000/hr commitment for 3yr all-upfrontDeep discounts (40–60%); must be sized carefully
GP2 → GP3 migrationUpgrade EBS volume typeOld volumes on GP2; GP3 is cheaper and fasterReduces EBS cost and improves baseline IOPS
S3 lifecycle policyAuto-transition S3 objects to cheaper tiers over timeStandard → S3-IA (30d) → Glacier (90d)Log/backup buckets often grow unbounded
Non-prod schedulingStop dev/staging instances outside business hours10 PM–6 AM shutdown~67% compute saving on non-prod (8 hours billed vs 24)
Spot instancesSpare AWS capacity at up to 90% discount; interruptibleBatch jobs, CI/CD workersNot for production; perfect for stateless non-critical workloads
Harbor vs ECRSelf-hosted registry vs AWS managedHealthCorp migrated ECR to HarborEliminates per-image-pull ECR costs inside the cluster
KarpenterAWS open-source node autoscaler for EKSProvisions cheapest node that fits podReplaces managed ASG node groups; big cost wins on EKS
CastAIThird-party EKS/GKE/AKS optimizerFull cluster right-sizing + spot orchestrationCombines multiple optimization levers; paid but ROI typically positive
BaseliningDefining the “normal” utilization pattern for a workload90-day CPU/RAM trend for right-sizingWithout baseline, right-sizing is guesswork; baseline evolves continuously

5. Architecture & Workflow Analysis

5.1 HealthCorp Environment — Before and After

BEFORE (Single Account, No Tagging)
┌─────────────────────────── AWS Account (Single) ─────────────────────────────┐
│  Production                  Dev                      Staging                │
│  ─────────────               ───                      ───────                │
│  170 EC2 (Intel)     +   untagged EC2     +    untagged EC2                  │
│  EKS (Intel nodes)   +   running 24×7     +    running 24×7                  │
│  RDS (multi-engine)                                                           │
│  ECR (container registry)                                                     │
│  S3 (no lifecycle)                                                            │
│  EBS (GP2, unattached volumes)                                                │
│  CloudWatch (unlimited log retention)                                         │
│  NAT GW, ALB, Elastic IPs                                                    │
│                                            Monthly Total: ~$98,000           │
└──────────────────────────────────────────────────────────────────────────────┘

AFTER (Multi-account, Tagged, Optimized)
┌── Prod Account ──────────────────────────────┐
│  EC2 (AMD/ARM, right-sized, tagged)          │
│  EKS (Graviton nodes, Karpenter + CastAI)    │
│  RDS (right-sized, PostgreSQL preferred)      │
│  Harbor (replaces ECR)                        │
│  S3 (lifecycle policies → Glacier)           │
│  EBS (GP3, no idle volumes)                  │
│  CloudWatch (retention set, logs exported)   │
│  NAT GW → VPC Endpoints where possible       │
│  Savings Plans (correctly sized 3yr)         │
└──────────────────────────────────────────────┘
┌── Non-Prod Account ──────────────────────────┐
│  EC2 (AMD, smaller, auto-stop 10PM–6AM IST)  │
│  Tagging: ENV=dev/staging, LOB=<team>        │
└──────────────────────────────────────────────┘
                 Monthly Total: ~$20,000 (target)

5.2 Layered Cost Optimization Workflow

START

  ├─ Export full inventory (AWS SDK script → Excel workbook)
  ├─ Enable: Cost Explorer + Compute Optimizer + Trusted Advisor + Anomaly Detection
  ├─ Audit and enforce tagging on all resources


LAYER 1: COMPUTE
  ├─ EC2:
  │    ├─ Categorize: standalone / ASG / EKS node group
  │    ├─ Architecture: Intel→AMD (all safe); Intel→ARM (post-assessment)
  │    ├─ Right-size (90-day baseline → Compute Optimizer)
  │    ├─ Schedule non-prod shutdown (10PM–6AM)
  │    ├─ Spot for non-critical batch/CI
  │    └─ Savings Plans (compute or EC2; 3yr all-upfront if stable)
  ├─ EKS:
  │    ├─ Karpenter (node autoscaler)
  │    ├─ CastAI (holistic optimizer)
  │    └─ Kubecost (visibility)
  └─ Lambda/ECS (Fargate):
       └─ Memory right-sizing; move schedulers off Lambda to Jenkins


LAYER 2: NETWORK
  └─ NAT GW → S3/DynamoDB VPC Endpoints | EIP audit | ALB consolidation


LAYER 3: STORAGE / DATA
  └─ EBS: GP2→GP3 | delete idle volumes | shrink oversized | snapshot cleanup
     S3: lifecycle → Standard-IA → Glacier


LAYER 4: MONITORING / LOGGING
  └─ CloudWatch: retention policies | export to S3 | reduce debug log volume


LAYER 5: OTHER TOOLS
  └─ ECR→Harbor | RDS right-size | ElastiCache right-size | GuardDuty scope


VERIFY & REPORT
  └─ Cost Explorer: before/after per service/resource/day
     Client report: savings in $ and % per layer
     Document in Terraform; update tagging policies
     Establish ongoing monitoring (Anomaly Detection alerts)

5.3 EC2 Instance Migration Flow (Intel → AMD, Standalone)

1. ASSESS application compatibility (developer + AWS Porting Advisor)
2. IDENTIFY equivalent AMD instance type  (T3.medium → T3a.medium)
3. CREATE AMI backup  → wait for status = Available
4. STOP instance  → wait for status = stopped
5. CHANGE INSTANCE TYPE  → T3a.medium (confirm price shown in console)
6. START instance
7. MONITOR application 48–72 hrs  (error rate, latency, CloudWatch)
8. VERIFY cost in Cost Explorer  (before vs after per-day billing)
9. DELETE AMI backup  (after 1–2 weeks stable)
10. UPDATE Terraform/IaC  (reflect new instance type)
11. REPORT savings to client

6. Commands, Scripts & Configs

The scripts and Terraform modules were promised for upload post-session and are not in the transcript. What is captured below comes from what was described or shown.

AWS CLI — Describe and filter EC2 instances

# List all EC2 instances with their instance type, state, and tags:
aws ec2 describe-instances \
  --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name,Tags[?Key==`ENV`].Value|[0],Tags[?Key==`Name`].Value|[0]]' \
  --output table

# Filter by tag ENV=dev (for non-prod shutdown script):
aws ec2 describe-instances \
  --filters "Name=tag:ENV,Values=dev" \
  --query 'Reservations[*].Instances[*].InstanceId' \
  --output text

# Stop all dev-tagged instances:
aws ec2 stop-instances \
  --instance-ids $(aws ec2 describe-instances \
    --filters "Name=tag:ENV,Values=dev" "Name=instance-state-name,Values=running" \
    --query 'Reservations[*].Instances[*].InstanceId' \
    --output text)

# Start all dev-tagged instances:
aws ec2 start-instances \
  --instance-ids $(aws ec2 describe-instances \
    --filters "Name=tag:ENV,Values=dev" "Name=instance-state-name,Values=stopped" \
    --query 'Reservations[*].Instances[*].InstanceId' \
    --output text)

Lambda scheduler (non-prod shutdown) — Python skeleton

import boto3

def lambda_handler(event, context):
    ec2 = boto3.client('ec2', region_name='us-east-1')
    action = event.get('action', 'stop')  # 'stop' or 'start'
    env_tag = 'dev'

    instances = ec2.describe_instances(
        Filters=[
            {'Name': 'tag:ENV', 'Values': [env_tag]},
            {'Name': 'instance-state-name',
             'Values': ['running'] if action == 'stop' else ['stopped']}
        ]
    )
    ids = [i['InstanceId']
           for r in instances['Reservations']
           for i in r['Instances']]

    if ids:
        if action == 'stop':
            ec2.stop_instances(InstanceIds=ids)
        else:
            ec2.start_instances(InstanceIds=ids)
    return {'action': action, 'instances': ids}

Terraform — EC2 instance type change (IaC best practice)

resource "aws_instance" "healthcorp_app" {
  ami           = "ami-xxxxxxxxxx"   # Ubuntu 22.04 ARM (for Graviton)
  instance_type = "t3a.medium"       # AMD; was t3.medium (Intel)

  tags = {
    Name  = "healthcorp-dev-app-server"
    Owner = "devops-team"
    ENV   = "dev"
    LOB   = "LOB-1"
  }
}

AWS Porting Advisor for Graviton

# Option 1: Python package
pip install aws-graviton-porting-advisor
porting-advisor --output text /path/to/your/application

# Option 2: Docker
docker run --rm -v /path/to/app:/app \
  public.ecr.aws/graviton-porting-advisor/porting-advisor \
  --output text /app

Cost Explorer CLI — per-instance daily cost

aws ce get-cost-and-usage \
  --time-period Start=2026-01-20,End=2026-01-25 \
  --granularity DAILY \
  --metrics "UnblendedCost" \
  --filter '{
    "And": [
      {"Dimensions": {"Key": "SERVICE", "Values": ["Amazon Elastic Compute Cloud - Compute"]}},
      {"Tags": {"Key": "Name", "Values": ["healthcorp-prod-app-server"]}}
    ]
  }' \
  --group-by Type=DIMENSION,Key=INSTANCE_TYPE

EC2 instance type change via AWS CLI

# Stop the instance
aws ec2 stop-instances --instance-ids i-0abcdef1234567890

# Wait for it to stop
aws ec2 wait instance-stopped --instance-ids i-0abcdef1234567890

# Change instance type
aws ec2 modify-instance-attribute \
  --instance-id i-0abcdef1234567890 \
  --instance-type '{"Value": "t3a.medium"}'

# Start the instance
aws ec2 start-instances --instance-ids i-0abcdef1234567890

EBS volume audit — find unattached volumes

aws ec2 describe-volumes \
  --filters "Name=status,Values=available" \
  --query 'Volumes[*].[VolumeId,Size,VolumeType,CreateTime]' \
  --output table

S3 lifecycle policy (JSON)

{
  "Rules": [
    {
      "ID": "LogsLifecycle",
      "Status": "Enabled",
      "Filter": {"Prefix": "logs/"},
      "Transitions": [
        {"Days": 30,  "StorageClass": "STANDARD_IA"},
        {"Days": 90,  "StorageClass": "GLACIER"},
        {"Days": 365, "StorageClass": "DEEP_ARCHIVE"}
      ],
      "Expiration": {"Days": 730}
    }
  ]
}

7. Tools & Technologies

ToolCategoryPurposeNotes from session
AWS Cost ExplorerNative AWSVisualize, filter, and analyze AWS spend by service/resource/tag/timeEnable first; used for post-migration validation
AWS Compute OptimizerNative AWSRight-size recommendations for EC2, Lambda, EKSBased on CloudWatch utilization data
AWS Trusted AdvisorNative AWSCost + security + performance + limits + ops excellence auditPaid tiers unlock more checks
AWS Cost Anomaly DetectionNative AWSAlert on unexpected cost spikesSet budgets and alerts per service
AWS Savings Plans CalculatorNative AWSSize Savings Plan commitments correctlyComplex mathematics; dedicated 30-40 page doc
AWS Pricing CalculatorNative AWSEstimate cost before provisioning or migrationLive-demoed: T3.medium vs T3a.medium comparison
AWS SDK (boto3/CLI)Native AWSScript inventory extraction; automate start/stopScripts promised for upload
AWS Porting Advisor for GravitonNative AWSScan app dependencies for ARM incompatibilityRun before any Intel→ARM migration
KarpenterOpen-source (AWS)EKS node autoscaler; provisions right-size cheapest nodesAlternative to managed node groups
CastAIThird-party SaaSEKS/GKE/AKS cost optimization; spot orchestration; right-sizingAlso supports EC2 and DB optimization
KubecostOpen-source / SaaSKubernetes cost visibility per namespace/workloadEssential for chargeback/showback
HarborOpen-sourceSelf-hosted container registryReplaces ECR; eliminates pull costs within cluster
Terraform / PulumiIaCManage all resource changes; auditability; state managementProduction changes must go through IaC
JenkinsCI/CDHost non-prod scheduling scripts (avoids Lambda cost for schedulers)Mentioned as lightweight alternative to Lambda for cron jobs
Kubeflow / MLflowMLOpsML pipeline orchestration and experiment trackingCovered in final case study session

8. Real-World Production Usage

Engagement model: Cost optimization engagements are typically scoped separately from architectural design or application changes. The DevOps consultant/team focuses on infrastructure levers and respects application constraints set by the dev team.

Key production realities surfaced:

  • Do not automate production instance changes via scripts. Use IaC (Terraform) for auditability and state integrity. Scripts are fine for non-prod automation (stop/start scheduling).
  • Downtime windows are real. EC2 instance type changes require a stop → change → start cycle. Coordinate with stakeholders and schedule a downtime window. Typical downtime: ~1–2 minutes per instance.
  • Monitor after every change. 48–72 hrs minimum for architecture changes; 1 week for major right-sizing.
  • Rollback must be pre-staged. AMI backup must be in Available state before touching the instance.
  • Baselining is continuous, not a one-time exercise. Traffic patterns change with new features, seasonal peaks, and user growth. Re-baseline periodically.
  • FinOps is a team sport. FinOps team (or DevOps with FinOps responsibility) monitors, reports, and alerts. Application teams are the decision-makers for their own spend. Budget plans should be set before provisioning resources, not after.
  • Multi-account architecture is the right pattern. Separate AWS accounts for prod, non-prod, tooling, and FinOps. AWS Control Tower + Landing Zones are the standard enterprise pattern. Budgets and quotas are set per-account.

Cost engineering impact claims (HealthCorp):

  • Architecture migration (Intel→AMD) across 120 instances: ~$935/month saved.
  • Architecture migration (Intel→ARM) across eligible instances: ~$1,500/month saved.
  • EBS cleanup (idle volumes + GP2→GP3): ~$232/month saved.
  • Non-prod scheduling (dev/staging off 8+ hrs/night): ~30–50% of non-prod compute (substantial).
  • Total claimed: ~80% of $98K/month = ~$78,400/month reduction.

9. Interview Preparation

Beginner

Q1. What is AWS Cost Explorer and why is it the first tool you enable for cost optimization? A: Cost Explorer is AWS’s native spend visualization tool. It lets you filter by service, resource, tag, account, region, and time granularity. You enable it first because you need historical cost data before you can make any optimization decision — it’s the source of truth for current and trend spend, and the tool you use to validate that your changes actually reduced the bill.

Q2. What is the difference between Reserved Instances and Savings Plans? A: Reserved Instances commit you to a specific instance family, size, and region for 1–3 years; Savings Plans commit you to a $/hr compute spend and can apply across any instance family, size, OS, and region. Savings Plans are more flexible. Both offer the same discount levels at best (3yr all-upfront), but Savings Plans are generally preferred for mixed or evolving workloads. Neither applies to Spot instances.

Q3. What tags should every AWS resource have, and why? A: At minimum: Name (identification), Owner (accountability), ENV (environment — prod/dev/staging), and LOB (line of business for team-level cost attribution). Without tags, you cannot split costs by environment, automate shutdowns by tag, attribute spend to teams, or produce meaningful cost reports.

Q4. What is a Graviton instance and why would you use it? A: Graviton instances (suffix g, e.g., m6g.large) run on AWS-designed ARM processors. They are 30–40% cheaper than equivalent Intel instances. They require ARM-compatible application dependencies, which you verify using the AWS Porting Advisor for Graviton. For 99% of modern workloads (containerized apps, modern runtimes), they are drop-in replacements.

Intermediate

Q5. A client has a $98K/month AWS bill. Walk me through how you’d approach reducing it. A: (1) Export full inventory using AWS SDK scripts. (2) Enable Cost Explorer, Compute Optimizer, Trusted Advisor, Cost Anomaly Detection. (3) Audit and enforce tagging. (4) Work layer by layer — Compute first (usually the biggest driver): categorize EC2 by arch/sizing/scheduling opportunity; analyze EKS with Karpenter/CastAI; right-size Lambda. (5) Network: NAT Gateway → VPC endpoints; release unused EIPs. (6) Storage: GP2→GP3; delete idle EBS; S3 lifecycle. (7) Monitoring: CloudWatch retention + export to Glacier. (8) Other: ECR→Harbor; RDS right-size; Savings Plans after 90-day baseline. Validate every change in Cost Explorer.

Q6. How do you migrate 170 EC2 instances from Intel to AMD with zero unplanned downtime? A: (1) Categorize instances into standalone/ASG/EKS node group — each has a different migration procedure. (2) Verify application compatibility (AWS Porting Advisor + developer sign-off). (3) For each instance: take AMI backup → wait for Available → agree maintenance window with stakeholder → stop instance → change instance type to a equivalent → start → monitor 48–72 hrs. (4) For ASG: update Launch Template with AMD AMI/instance type → trigger rolling replacement. (5) For EKS: cordon + drain old nodes → update node group → new nodes come up on AMD. (6) Verify via Cost Explorer. (7) Delete AMI backups. (8) Update Terraform.

Q7. When is it appropriate to stop EC2 instances to save cost, and when is it not? A: Stop/schedule shutdowns only for non-production instances (dev, staging, testing). Use tag-based automation: ENV=dev → stop at 10 PM IST, start at 6 AM IST. Production instances should never be automatically stopped — use autoscaling to handle load variations instead. Non-prod scheduling typically saves 30–65% of non-prod compute cost (14–16 hours off per day).

Q8. What is MaxSessions / right-sizing, and how do you determine the correct instance size? A: Right-sizing means matching instance CPU, RAM, and storage to actual utilization. The process: collect CloudWatch metrics over a baseline period (90–365 days); use Compute Optimizer’s recommendations; apply a safety buffer (never size below peak + 20% headroom). Trigger for re-baseline: new feature release, traffic pattern change, or when anomaly detection alerts on sustained CPU spike. Baselining is continuous, not a one-time exercise.

Advanced

Q9. Explain the tradeoffs between Compute Savings Plans, EC2 Savings Plans, and Reserved Instances. A: Compute Savings Plans offer the most flexibility — apply to any EC2 family/region/OS, Lambda, and Fargate, but the discount is slightly lower. EC2 Savings Plans are more restrictive (specific family + region) but offer deeper discounts. Reserved Instances are most restrictive (specific instance type) and the deepest discount, but can be sold on the Marketplace if unused. General rule: use Compute Savings Plans for dynamic environments; EC2 Savings Plans or RIs for stable, long-running workloads where the instance family is unlikely to change.

Q10. What are the risks of buying a Savings Plan without doing the mathematics first? A: Over-commitment: you pay for unused compute hours for 1–3 years with no refund or resale option (unlike Reserved Instances). Under-commitment: you leave money on the table — On-Demand pricing for the uncovered portion. The correct process: analyze the past 90-day On-Demand baseline (removing already-covered spend), project the stable portion that won’t scale down, and commit to that $/hr amount, leaving headroom for growth. AWS’s Savings Plans recommendations in Cost Explorer help but should be validated manually.

Q11. How does Karpenter differ from a standard EKS managed node group with Cluster Autoscaler? A: Standard Cluster Autoscaler scales the number of nodes within a fixed node group (fixed instance type). Karpenter provisions the right instance type and size for the specific pods waiting to be scheduled — it reads pod resource requests and picks the cheapest instance that fits, including Spot if appropriate. This eliminates over-provisioning at the node level. Combined with CastAI, which also handles multi-cloud and DB optimization, you get significantly better cost visibility and control than native autoscaling alone.

Q12. How do you implement FinOps for a multi-account AWS organization with 20 accounts? A: Use AWS Organizations + Control Tower. Each account has its own budget and alerts (AWS Budgets). Cost is aggregated in a centralized billing/FinOps account using Cost Explorer’s multi-account view. Tag policies (Service Control Policies) enforce mandatory tags across all accounts. Quotas are set per-account using Service Quotas. FinOps team monitors and reports; application teams own spend decisions. Chargeback/showback happens via tag-based cost allocation reports exported to S3 and loaded into a BI tool.


10. Exam & Certification Notes

For AWS Solutions Architect / DevOps Professional:

  • Cost-related services: Cost Explorer, Compute Optimizer, Trusted Advisor (Cost pillar), Cost Anomaly Detection, Savings Plans, Reserved Instances — know the differences and when to use each.
  • Instance naming conventions: No suffix = Intel; a suffix = AMD; g suffix = Graviton/ARM. Commonly tested: “Which is cheapest for same workload?” → ARM.
  • EBS volume types: GP2 (older, burstable IOPS) vs GP3 (newer, cheaper, predictable 3000 IOPS baseline). Migration from GP2 to GP3 is a well-known exam optimization scenario.
  • S3 storage classes: Standard → Standard-IA (30+ day old, infrequently accessed) → Glacier (90+ days, archive) → Glacier Deep Archive (1 year+, coldest). Know lifecycle policy syntax.
  • Savings Plans vs Reserved Instances: flexibility (Savings Plans) vs discount depth (RIs) — exam frequently tests the distinction.
  • Auto Scaling vs Karpenter: exam favors native autoscaling; real-world favors Karpenter. Know both.
  • Tagging best practices: mandatory for cost allocation; enforced via Tag Policies in AWS Organizations.

Potential trick questions:

  • “Savings Plans apply to Spot instances” → False. On-Demand only.
  • ”GP2 has higher IOPS than GP3” → False for the baseline. GP3 provides 3000 IOPS baseline (vs GP2’s burst-only IOPS). GP3 wins on both cost and performance for most workloads.
  • ”A stopped EC2 instance incurs no charges” → False. EBS volumes attached to a stopped instance are still billed.
  • ”Reserve Instances can be applied across instance families” → False. That’s Compute Savings Plans.

11. Cheat Sheet

Start every engagement: Export inventory → Enable Cost Explorer + Compute Optimizer + Trusted Advisor + Anomaly Detection → Enforce tagging (Name/Owner/ENV/LOB)

EC2 architecture cost ladder (cheapest to most expensive, same performance): ARM/Graviton (g) < AMD (a) < Intel (no suffix) — ~30–40% from Intel→ARM; ~15–20% from Intel→AMD

Instance naming: t3.medium = Intel | t3a.medium = AMD | m6g.large = Graviton/ARM

Standalone instance migration (Intel→AMD): AMI backup → stop → change instance type → start → monitor 48–72h → verify Cost Explorer → delete AMI

Migration complexity matrix:

Intel→AMDAMD→ARM
StandaloneEasiestHardest
ASGMediumMedium
EKS node groupHardestEasiest

Non-prod scheduling: ENV=dev/staging → stop 10 PM IST, start 6 AM IST (via Jenkins script or Lambda + EventBridge)

Savings Plans rule: Analyze 90-day On-Demand baseline → commit to stable $/hr → 3yr all-upfront = deepest discount → never buy blindly

EBS quick wins: GP2 → GP3 (cheaper + faster) | delete unattached (status=available) | right-size (assigned vs used)

S3 lifecycle: Standard → Standard-IA (30d) → Glacier (90d) → Deep Archive (365d)

Key tools:

  • Cost Explorer — always open first
  • Compute Optimizer — right-size recommendations
  • Trusted Advisor — idle resources + security
  • Anomaly Detection — spike alerts
  • Karpenter — EKS node optimization
  • CastAI — full cluster cost optimization
  • Kubecost — Kubernetes cost visibility
  • Harbor — replace ECR for in-cluster pulls
  • AWS Porting Advisor — ARM compatibility check

Layer order: Compute → Network → Storage → Monitoring/Logging → Other tools


12. Gaps, Assumptions & Incomplete Areas

Deliberately deferred (promised in future sessions):

  • ASG-managed instance migration demo (Intel→AMD and AMD→ARM)
  • EKS node group migration demo
  • Karpenter and CastAI live implementation and comparison
  • Savings Plans mathematics deep-dive (30–40 page document)
  • Networking cost optimization (NAT Gateway, VPC Endpoints, etc.)
  • CloudWatch log cost optimization (Polomial live client sessions)
  • RDS, ElastiCache, DocumentDB right-sizing
  • Security tooling cost (GuardDuty, Inspector, WAF)
  • ECR→Harbor migration walkthrough
  • Non-prod scheduling script walkthrough (Lambda + EventBridge vs Jenkins)
  • Terraform modules for instance changes
  • AWS SDK inventory extraction scripts
  • Architectural diagram for HealthCorp (to be created by instructor)
  • Multi-account architecture / AWS Organizations / Control Tower

Transcription artifacts:

  • “Light cell” / “light sail” = Lightsail
  • ”Carpenter” = Karpenter
  • ”Cast AI / Castai” = CastAI
  • ”Cube cost” = Kubecost
  • ”Studioious” / other garbled name = StormForge (likely, context-fit)
  • “Terapform” = Terraform
  • ”Genkins” = Jenkins
  • ”Kota” / “kota” = quota
  • ”LOB” = Line of Business (tag)
  • “Click ops” = ClickOps (managing cloud via console UI rather than IaC)
  • “Polomial” = Polymial or similar (blockchain client name — exact spelling unclear)

Claims to treat as heuristics, not facts:

  • “99% of workloads are AMD/ARM compatible” — accurate for modern containerized apps; less true for legacy JNI, compiled native binaries, or hardware-specific libraries. Always verify.
  • ”80% cost reduction achieved” — real claim but unverified; no external audit cited.
  • ”Intel→AMD saves 15–20%” — directionally accurate per AWS pricing; exact delta varies by family and region.
  • ”Intel→ARM saves 30–40%” — directionally accurate; same caveat.

Open questions from attendees (unanswered or partially answered):

  • How to implement budget restrictions per-account in a multi-account AWS org (Control Tower / SCP / Budgets — answered by an attendee, not the instructor in depth).
  • How to simulate production-level traffic in the playground for realistic testing.
  • What specific CloudWatch metrics constitute “overprovisioning” vs “underprovisioning” with exact thresholds.

13. Gap-Fill — What the Session Left Unfinished, Completed Here

These are filled from AWS engineering knowledge and FinOps practice. Clearly labelled as gap-fill, not transcript content.


GAP 1 — The Savings Plans Mathematics (the 30-page document, summarized)

The instructor deferred this to a dedicated document. Here is the core methodology.

Step 1: Determine your On-Demand spend baseline. Go to Cost Explorer → Service: EC2/Lambda/Fargate → Payment Option: On-Demand. Filter out already-covered spend (existing RIs or Savings Plans). Take the average $/hour over the past 90 days. This is your coverage baseline.

Step 2: Identify the stable portion. Stable = compute that runs consistently 24×7 without scale-in. For a workload averaging $10/hr with a trough of $6/hr: the stable floor is $6/hr. Commit to at most the trough, not the average — this avoids over-commitment during low-usage periods.

Step 3: Choose the right plan type.

Workload changes instance family often → Compute Savings Plan
Workload is stable in one region/family → EC2 Instance Savings Plan
Includes Lambda/Fargate → Compute Savings Plan only

Step 4: Choose term and payment.

3-year All Upfront:     deepest discount (~57% vs On-Demand for some families)
1-year All Upfront:     middle (~40%)
1-year No Upfront:      smallest (~30%) but no cash outlay

For stable production workloads with predictable usage: 3-year all-upfront maximizes ROI. For uncertainty: start with 1-year, no-upfront, and upgrade.

Step 5: Validate using AWS Recommendations. Cost Explorer → Savings Plans → Recommendations. AWS shows the recommended commitment, estimated savings, and coverage percentage. Cross-check manually.

Step 6: Purchase and monitor coverage. After purchase, monitor Savings Plans utilization (target: >80%) and coverage rate (target: >90% of On-Demand spend covered). Low utilization = over-bought. Low coverage = room to buy more.

Warning: Do not purchase Savings Plans during the first 30–60 days of a new environment. Wait until usage patterns stabilize.


GAP 2 — ASG Instance Migration (Intel→AMD)

The session described the category but did not demonstrate it. Here is the correct procedure.

For instances in an Auto Scaling Group:

  1. Identify the current Launch Template or Launch Configuration used by the ASG.
  2. Create a new Launch Template version with the AMD equivalent instance type.
  3. Update the ASG to use the new Launch Template version.
  4. Trigger a rolling instance refresh:
    aws autoscaling start-instance-refresh \
      --auto-scaling-group-name <asg-name> \
      --preferences MinHealthyPercentage=80,InstanceWarmup=300
    
  5. ASG gradually replaces old Intel instances with new AMD instances, maintaining minimum healthy count.
  6. Monitor CloudWatch + application metrics during refresh.
  7. If issues arise, cancel the refresh: aws autoscaling cancel-instance-refresh --auto-scaling-group-name <asg-name>

Terraform approach:

resource "aws_launch_template" "app" {
  name_prefix   = "healthcorp-app-"
  instance_type = "t3a.medium"   # Changed from t3.medium
  image_id      = "ami-xxxxxxxxxx"
  # ... rest of config unchanged
}

resource "aws_autoscaling_group" "app" {
  # ...
  launch_template {
    id      = aws_launch_template.app.id
    version = "$Latest"
  }
  instance_refresh {
    strategy = "Rolling"
    preferences {
      min_healthy_percentage = 80
    }
  }
}

GAP 3 — EKS Node Group Migration (Intel→AMD and AMD→ARM)

Intel→AMD (most complex):

  1. Create a new managed node group with AMD instance type and AMD-compatible AMI.
  2. Cordon the old Intel nodes to prevent new pod scheduling: kubectl cordon <node-name>
  3. Drain the old Intel nodes to migrate pods safely: kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
  4. Pods are rescheduled onto new AMD nodes by the scheduler.
  5. Once all pods are rescheduled and old nodes are empty, delete the old node group.

AMD→ARM (simplest — this is why the complexity matrix is inverted):

  1. Update the managed node group to use a Graviton AMI and ARM instance type.
  2. EKS handles the rolling replacement of nodes automatically (similar to ASG instance refresh).
  3. Ensure all container images are multi-arch (linux/amd64 + linux/arm64) or ARM-only.
  4. Check all DaemonSets for ARM compatibility (e.g., monitoring agents, security agents may have x86-only binaries).

Multi-arch container images:

# Build and push multi-arch image:
docker buildx create --use
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t your-registry/your-app:latest \
  --push .

GAP 4 — NAT Gateway Cost Reduction (the Networking Layer)

NAT Gateway is often a surprise large cost item, especially as logging and inter-service traffic grows.

The problem: Any EC2 or EKS pod in a private subnet making an outbound request to the internet (S3, ECR, DynamoDB, external APIs) routes through the NAT Gateway. You pay $0.045/GB of data processed.

The fix — VPC Endpoints (Gateway + Interface):

ServiceEndpoint typeCostImpact
S3Gateway endpointFreeEliminates S3 NAT cost entirely
DynamoDBGateway endpointFreeEliminates DynamoDB NAT cost entirely
ECRInterface endpoint~$0.01/GBReduces ECR pull NAT cost (worth it at scale)
Secrets ManagerInterface endpoint~$0.01/GBReduces Secrets Manager NAT cost
CloudWatch LogsInterface endpoint~$0.01/GBReduces logging NAT cost
# Create a free S3 Gateway endpoint (eliminates S3→NAT traffic):
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-xxxxxxxxxx \
  --service-name com.amazonaws.us-east-1.s3 \
  --route-table-ids rtb-xxxxxxxxxx

# Terraform:
resource "aws_vpc_endpoint" "s3" {
  vpc_id            = aws_vpc.main.id
  service_name      = "com.amazonaws.${var.region}.s3"
  vpc_endpoint_type = "Gateway"
  route_table_ids   = [aws_route_table.private.id]
}

For large logging volumes (e.g., Polomial’s $15K/month CloudWatch bill): the primary driver is often EKS pods → CloudWatch Logs via NAT Gateway. A CloudWatch Logs VPC Interface Endpoint removes that NAT cost and often reduces the CloudWatch bill simultaneously.


GAP 5 — The Overprovisioning Detection Framework

An attendee pressed on this without getting a clear answer. Here is the engineering standard:

Metric thresholds for right-sizing decisions:

MetricOverprovisioned signalUnderprovisioned signal
CPU utilizationP99 < 40% over 90dP99 > 85% consistently
Memory utilizationP99 < 40% over 90dP99 > 85% consistently
Network throughput< 10% of bandwidth availableSustained saturation
EBS IOPS< 20% of provisioned IOPSIOPS wait time > 1ms sustained
StorageUsed < 50% of provisionedUsed > 85% of provisioned

Safety buffer: Always keep 30–40% headroom above the measured P99 peak. Do not size to the average — size to the peak + buffer.

Baselining cadence:

  • New workloads: wait 30 days before right-sizing.
  • Stable workloads: re-evaluate every 6 months or after any significant traffic event.
  • Before any performance-impacting change: document the current metrics.

Tools:

  • AWS Compute Optimizer: automated recommendations with confidence level.
  • AWS CloudWatch: pull P50/P99 CPU/RAM over 90 days for each instance.
  • Third-party: Spot.io, StormForge, CastAI (all provide automated continuous right-sizing).

GAP 6 — Multi-Account AWS Strategy (Control Tower + FinOps)

The attendee question about budget restrictions per-account was answered partially by a peer. Full picture:

AWS Organization (Management/Root Account)
├── FinOps/Billing Account
│   ├── Cost Explorer (consolidated, all accounts)
│   ├── Budgets (per-account, per-service, per-tag)
│   └── Cost Anomaly Detection (org-wide)
├── Security Account
│   ├── CloudTrail (org-wide)
│   ├── GuardDuty (delegated admin)
│   └── Security Hub
├── Shared Services Account
│   ├── Transit Gateway
│   ├── Shared VPCs
│   └── ECR / Harbor
├── Production Account
│   ├── Budget: $45,000/month
│   ├── Alert: 80% threshold → notify FinOps
│   └── SCP: cannot create instances > r6.2xlarge without approval
├── Staging Account
│   └── Budget: $5,000/month; auto-stop all instances at 11 PM UTC
└── Dev Account
    └── Budget: $3,000/month; auto-stop all instances at 10 PM IST

Budget enforcement (not just alerting): AWS Budgets can trigger Lambda actions to stop instances or send SNS notifications when thresholds are breached. SCPs (Service Control Policies) can prevent resource creation above a certain size or prevent resources from being created in non-approved regions.

FinOps chargeback workflow:

  1. All accounts tag resources with LOB.
  2. Cost Allocation Tags report in Cost Explorer groups by LOB.
  3. Monthly report exported to S3 → loaded into BI tool (QuickSight, Tableau).
  4. Each LOB team receives their cost statement and must justify deviations > 10% from budget.

Topic Connections Graph

This visual map shows the local learning neighborhood of this guide. Drag nodes to inspect links, click to shift layout focus, or toggle the accessible list view.

Interactive Filters
Shortest Path Finder

Hold Shift and click two nodes to calculate and trace the shortest path route between them.