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

Data transfer costs jumped after you spread services across three AZs.

AdvancedTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer

Likely causes → Inter-AZ traffic is charged in both directions (about $0.01/GB each way). Chatty microservices, Kafka or Elasticsearch replication, and cross-AZ load balancing to targets (on ALB it is free inside the LB; on NLB with cross-zone on, you pay inter-AZ) add up. Calling through public IPs or Elastic IPs inside the Region costs even more.

Diagnose →

aws ce get-cost-and-usage --time-period Start=2026-10-01,End=2026-11-01 --granularity DAILY \
  --metrics UnblendedCost --group-by Type=DIMENSION,Key=USAGE_TYPE \
  --filter '{"Dimensions":{"Key":"SERVICE","Values":["Amazon Elastic Compute Cloud - Compute","EC2 - Other"]}}' \
  --query 'ResultsByTime[-1].Groups[?contains(Keys[0],`DataTransfer-Regional`)]'
# Flow logs with az-id fields to find top cross-AZ pairs

Fix →

  1. Use topology-aware routing (Kubernetes trafficDistribution: PreferClose, or Istio locality LB)
  2. Use rack- or AZ-aware consumers (Kafka client.rack)
  3. Use private IPs, not public ones, for in-Region calls

Prevent → Make data transfer a design review item, and put cross-AZ bytes on a dashboard per service.

aws All AWS questions Roadmap: Cloud cost & architecture

More on CloudFormation, CloudWatch, KMS, Secrets and Cost