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

The NAT Gateway line is the second-biggest item on the AWS bill.

IntermediateTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer

Likely causes → NAT charges per GB processed as well as per hour. Big traffic through NAT, such as pulling container images, S3 or DynamoDB transfers, or backups, adds up quickly. Cross-AZ NAT usage adds data transfer charges on top.

Diagnose →

aws ce get-cost-and-usage --time-period Start=2026-10-01,End=2026-11-01 --granularity MONTHLY --metrics UnblendedCost \
  --filter '{"Dimensions":{"Key":"USAGE_TYPE_GROUP","Values":["EC2: NAT Gateway - Data Processed"]}}'
# CloudWatch AWS/NATGateway BytesOutToDestination per NAT
# VPC Flow Logs on the NAT ENI -> top destinations by bytes (Athena)

Fix →

  1. Add free gateway endpoints for S3 and DynamoDB
  2. Add interface endpoints for ECR, Logs and STS where the volume justifies their hourly cost
  3. Use one NAT per AZ with AZ-local routes
  4. Cache images (ECR pull-through cache)

Prevent → Tag and dashboard NAT bytes, and review the top talkers through flow logs every month.

aws All AWS questions Roadmap: Cloud cost & architecture

More on CloudFormation, CloudWatch, KMS, Secrets and Cost