Interview Prep/AWS/CloudFormation, CloudWatch, KMS, Secrets and Cost

A budget alert fired at 120% of forecast mid-month. How do you find what is spending money?

IntermediateTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer

Likely causes → A new or forgotten resource (a big instance, a GPU node pool, a NAT), runaway usage (Lambda loop, logs ingestion), or a missing commitment discount.

Diagnose →

aws ce get-cost-and-usage --time-period Start=2026-11-01,End=2026-11-09 --granularity DAILY \
  --metrics UnblendedCost --group-by Type=DIMENSION,Key=SERVICE \
  --query 'ResultsByTime[-1].Groups | sort_by(@,&to_number(Metrics.UnblendedCost.Amount))[-5:]'
aws ce get-cost-and-usage --time-period Start=2026-11-01,End=2026-11-09 --granularity DAILY \
  --metrics UnblendedCost --group-by Type=DIMENSION,Key=LINKED_ACCOUNT
aws ce get-anomalies --date-interval StartDate=2026-11-01,EndDate=2026-11-09

Fix →

  1. Drill down from service to usage type, then account, then tag (Type=TAG,Key=team)
  2. Stop or right-size the offender
  3. Fix the runaway trigger

Prevent → Turn on Cost Anomaly Detection with alerts to a channel, use per-team budgets with actions, and enforce cost allocation tags.

aws All AWS questions Roadmap: Cloud cost & architecture

More on CloudFormation, CloudWatch, KMS, Secrets and Cost