AWS Cost Explorer for Founders: Four Defaults That Inflate Your Bill
Read AWS Cost Explorer quickly, fix four costly defaults (NAT gateways, idle RDS and EBS, CloudWatch log retention, cross-AZ traffic) and query billing data with a limited IAM role.
Software founders often face a predictable billing cycle when building on Amazon Web Services (AWS).
Early in the startup lifecycle, many founders apply for AWS Activate and receive promotional cloud credits.
With free credits available, engineering teams rarely prioritize infrastructure efficiency. Teams deploy multi-Availability Zone (AZ) Virtual Private Clouds (VPCs). They launch multiple NAT Gateways for redundancy. They provision Multi-AZ Amazon RDS PostgreSQL instances with provisioned IOPS, run AWS Fargate containers, and send high-volume debug logs to Amazon CloudWatch.
The system works well at first. Customer sign-ups increase, and subscription revenue starts arriving in payment dashboards.
Illustrative example: around month 13, the credits run out. The next bill, $2,842.19, goes to the card on file.
For a startup generating $3,600 in Monthly Recurring Revenue (MRR), this invoice represents an immediate crisis. AWS infrastructure costs take nearly 80 percent of gross customer revenue.
The founder opens the AWS Cost Management Console and navigates to AWS Cost Explorer.
Instead of a clear breakdown, the interface presents dozens of menus, unblended versus amortized metrics, reservation utilization rates, and obscure line items such as USE2-NatGateway-Bytes, BoxUsage:t4g.xlarge, and TimedStorage-ByteHrs.
Founders do not need complex enterprise FinOps certifications. They need practical steps to remove wasteful defaults, query billing data safely, and track margins accurately.
This guide explains how to read AWS Cost Explorer quickly. It highlights four architectural defaults that drain startup budgets, provides secure IAM policies to query billing metrics programmatically, and shows how to audit cloud costs continuously.
1. Decoding AWS Cost Explorer in 5 Minutes
AWS Cost Explorer feels confusing because default views show raw, unfiltered usage. To get actionable insights, founders only need to understand three cost perspectives and three specific filters.
┌────────────────────────────────────────────────────────────────────────┐
│ THE THREE AWS COST PERSPECTIVES │
├────────────────────────────────────────────────────────────────────────┤
│ 1. UNBLENDED COST (Cash Reality): │
│ • Reflects the exact cash charged to your credit card that day. │
│ • Shows sudden upfront reservation fees as giant spikes. │
│ │
│ 2. AMORTIZED COST (Operational Truth): │
│ • Spreads upfront Savings Plans and Reserved Instance costs evenly │
│ across the term (e.g., $365 upfront for 1 year = $1/day). │
│ • USE THIS to measure your true daily operational run rate. │
│ │
│ 3. NET AMORTIZED COST (After Discounts): │
│ • Amortized cost minus private enterprise volume discounts. │
│ • Essential if you operate under custom negotiated pricing. │
└────────────────────────────────────────────────────────────────────────┘
The Three Filters That Actually Matter
When opening Cost Explorer, apply these three settings to isolate major cost drivers:
- Date Range: Select Last 14 Days or Last 30 Days with Daily Granularity. Monthly aggregates hide sudden billing increases that began within the last 48 hours.
- Dimension (Group By): Select Group By: Service. This view ranks cloud expenses from largest to smallest. In many software startups, three services make up most of the invoice: Amazon Elastic Compute Cloud (EC2), Amazon Relational Database Service (RDS), and Amazon Simple Storage Service (S3).
- Drill Down (Group By: Usage Type): Filter by the primary service, then change grouping to Usage Type. This replaces broad service names with specific billing items:
USE2-NatGateway-Bytes(NAT Gateway data processing)USE2-BoxUsage:t4g.medium(Compute instance runtime)USE2-EBS:VolumeUsage.gp3(EBS disk storage)
After identifying the high-cost usage types, teams can address the underlying configuration issues.
2. Four AWS Defaults That Inflate Small SaaS Bills
Most cloud overspending does not come from large virtual machines. Teams know when they launch a 64-core compute server.
Unexpected charges usually stem from default architectural configurations. These settings appear harmless in setup documentation but compound into substantial monthly bills.
┌────────────────────────────────────────────────────────────────────────┐
│ FOUR COSTLY AWS DEFAULTS │
├────────────────────────────────────────────────────────────────────────┤
│ 1. THE NAT GATEWAY TAX: │
│ • $32.40/mo per gateway for existing + $0.045/GB data processing. │
│ • S3 backups and Docker image pulls routed over public internet. │
│ • FIX: Deploy free S3 & DynamoDB VPC Gateway Endpoints ($0.00). │
├────────────────────────────────────────────────────────────────────────┤
│ 2. OVER-PROVISIONED RDS & ZOMBIE EBS VOLUMES: │
│ • Multi-AZ enabled by default for dev/staging environments. │
│ • Forgotten orphaned EBS volumes billing $0.08/GB-month forever. │
│ • FIX: Run EBS orphan cleanup scripts; use single-AZ for staging. │
├────────────────────────────────────────────────────────────────────────┤
│ 3. CLOUDWATCH LOG RETENTION ("NEVER EXPIRE"): │
│ • Default setting on Lambda & ECS logs retains data forever. │
│ • $0.50/GB ingestion + compounding monthly storage fees. │
│ • FIX: Enforce 7-day or 14-day retention across all log groups. │
├────────────────────────────────────────────────────────────────────────┤
│ 4. CROSS-AZ DATA TRANSFER: │
│ • AWS charges $0.01/GB for traffic crossing availability zones. │
│ • Containers chatting with databases or Redis across AZ subnets. │
│ • FIX: Colocate latency-sensitive microservices in the same AZ. │
└────────────────────────────────────────────────────────────────────────┘
Default #1: The NAT Gateway Tax
When backend workloads run inside private VPC subnets, containers cannot connect directly to the public internet. This layout is standard for ECS Fargate tasks and Kubernetes worker nodes.
AWS uses a NAT Gateway to enable outbound traffic for private containers. Containers need internet access to download software packages, pull container images, and call external APIs like Stripe and OpenAI.
AWS calculates NAT Gateway fees using two components:
- Hourly Base Fee: $0.045 per hour (approximately $32.40 per month for each gateway).
- Data Processing Fee: $0.045 per GB for all network traffic crossing the gateway.
Prices for US East (Ohio), as of November 2026. See the Amazon VPC pricing page.
Illustrative example: a common startup configuration creates several billing traps:
- The deployment provisions NAT Gateways across three Availability Zones for redundancy.
- The base fee for running three gateways reaches: 3 × $32.40 = $97.20 per month.
- Applications write about 400 GB of database snapshots to Amazon S3 each week, and worker nodes pull large container images from public registries during deployments.
- Because S3 and public registries use public IP addresses, the traffic passes through the NAT Gateway.
- Together that is about 2,000 GB a month: 2,000 GB × $0.045 = $90.00 per month.
The startup spends $187.20 per month on a routing component, mostly to move data to S3 and to pull container images.
The 5-Minute Fix: Deploy a Free S3 VPC Gateway Endpoint
AWS provides VPC Gateway Endpoints for Amazon S3 and Amazon DynamoDB.
Gateway Endpoints carry no service fees:
- Hourly base cost: $0.00
- Data processing fee: $0.00 per GB
An S3 Gateway Endpoint directs traffic over the AWS private network backbone. Traffic bypasses the NAT Gateway completely:
WITHOUT S3 ENDPOINT (EXPENSIVE):
Private Subnet ──► NAT Gateway ($0.045/GB) ──► Public Internet ──► Amazon S3
WITH S3 GATEWAY ENDPOINT (NO NAT CHARGE FOR S3 TRAFFIC):
Private Subnet ──────────────────────────────► Private AWS Backbone ──► Amazon S3
Here is a Terraform configuration for an S3 VPC Gateway Endpoint:
# main.tf - Free S3 VPC Gateway Endpoint
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.us-east-2.s3" # use your VPC's region
vpc_endpoint_type = "Gateway"
# Attach to private route tables
route_table_ids = aws_route_table.private[*].id
tags = {
Name = "free-s3-endpoint"
}
}
The endpoint removes the NAT processing fee on S3 traffic. Container image pulls from public registries still go through the NAT Gateway.
Default #2: Over-Provisioned RDS & Zombie EBS Volumes
Unmanaged databases and orphaned disk volumes form another major source of cloud waste.
The Multi-AZ Staging Trap
When launching a database on Amazon RDS, the console asks whether to create a standby instance in a second Availability Zone (Multi-AZ).
Selecting Multi-AZ creates a synchronous standby replica in a second data center. This doubles database infrastructure costs:
- Single-AZ
db.t4g.medium: ~$50.00 per month - Multi-AZ
db.t4g.medium: ~$100.00 per month
Prices for on-demand PostgreSQL in US East, as of November 2026; see the official Amazon RDS pricing page.
Production customer data requires high availability. Non-production environments do not need synchronous failover replicas. Developers frequently leave Multi-AZ enabled on development, testing, and staging databases.
Switching non-production databases to Single-AZ cuts test database costs by 50 percent.
Zombie EBS Volumes
When deleting an EC2 virtual machine, the console presents an option: Delete on termination.
If this setting remains unchecked, the volume persists under the available state. Detaching a volume during maintenance causes the same issue.
AWS charges $0.08 per GB-month for gp3 storage and $0.10 per GB-month for legacy gp2 storage, even when no instance is attached.
Prices for US East, as of November 2026; see the official Amazon EBS pricing page.
Teams that test multiple configurations often leave unattached volumes in their accounts:
Illustrative example: 20 forgotten volumes × 100 GB = 2,000 GB × $0.08 = $160.00 per month in storage for disks nothing uses.
The AWS CLI Zombie Cleanup Command
Execute this command to list all unattached EBS volumes in an account:
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query "Volumes[*].{ID:VolumeId,Size:Size,Type:VolumeType,Created:CreateTime}" \
--output table
Inspect the returned list. Deleting a volume is permanent, so check that nothing needs it, and take a snapshot first if you are unsure (aws ec2 create-snapshot --volume-id vol-0123456789abcdef0). Then remove it:
aws ec2 delete-volume --volume-id vol-0123456789abcdef0
Default #3: CloudWatch Logs "Never Expire"
Deploying an AWS Lambda function or an Amazon ECS task creates an Amazon CloudWatch Log Group automatically.
By default, AWS sets retention on every new log group to Never Expire.
┌─────────────────────────────────────────────────────────────┐
│ THE CLOUDWATCH LOG COMPOUNDING TRAP │
├─────────────────────────────────────────────────────────────┤
│ 1. Log Ingestion Fee: $0.50 per GB ingested │
│ 2. Log Storage Fee: $0.03 per GB-month stored │
│ │
│ If your application generates 10 GB of debug logs per day: │
│ • Monthly Ingestion: 300 GB × $0.50 = $150.00/mo │
│ • Month 1 Storage: 300 GB × $0.03 = $9.00/mo │
│ • Month 6 Storage: 1,800 GB × $0.03 = $54.00/mo │
│ • Month 12 Storage: 3,600 GB × $0.03 = $108.00/mo │
│ │
│ By Month 12, storage alone costs $108/month and keeps │
│ growing. Retention stops that growth; it does not change │
│ the $150/month ingestion fee. │
└─────────────────────────────────────────────────────────────┘
Prices for standard log ingestion and storage in US East, as of November 2026; see the official [Amazon CloudWatch pricing page](https://aws.amazon.com/cloudwatch/pricing/).
The Fix: Set a 7-Day or 14-Day Retention Policy
Debug logs are rarely useful after a week or two. Audit, security and access logs are different: your contracts, your security program or regulators may require you to keep them much longer, so check before you shorten them. To cut the ingestion fee, log less: turn off debug logging in production.
List the log groups that never expire, and review the list first:
aws logs describe-log-groups \
--query "logGroups[?retentionInDays==null].logGroupName" --output text
Then set 7-day retention on those groups, skipping any you must keep for audits (for example CloudTrail or VPC flow logs):
# Sets 7-day retention only on log groups that currently never expire
for group in $(aws logs describe-log-groups \
--query "logGroups[?retentionInDays==null].logGroupName" --output text); do
echo "Setting 7-day retention on $group"
aws logs put-retention-policy --log-group-name "$group" --retention-in-days 7
done
Default #4: Cross-AZ Data Transfer Fees
Within an AWS region like us-east-1, AWS operates separate physical facilities called Availability Zones (us-east-1a, us-east-1b, and us-east-1c).
Network traffic crossing between different Availability Zones is not free. AWS charges $0.01 per GB in each direction ($0.02 per GB round-trip):
[Container in us-east-1a] ──► ($0.01/GB) ──► [PostgreSQL in us-east-1b]
◄── ($0.01/GB) ◄──
Total Data Transfer Surcharge: $0.02 per GB
Price as of November 2026; see the official Amazon EC2 data transfer pricing page.
Applications executing frequent database queries or syncing high-traffic caches with an Amazon ElastiCache Redis cluster across zones accumulate significant transfer charges.
Keep primary compute containers and primary database instances within the same Availability Zone during early development. Reserve secondary Availability Zones for disaster recovery standby instances.
3. Programmatic Billing: How to Query the AWS Cost Explorer API
Manual billing checks waste development time.
Modern engineering teams query billing data programmatically. They route cost metrics to Slack alerts, internal monitoring panels, or profit trackers like RealMRR.
Teams must query this data securely without exposing production infrastructure.
The Security Anti-Pattern: Hardcoded IAM Root Keys
Never create a permanent IAM user with administrator privileges, and never hardcode static AWS access keys (AKIA...) in scripts or third-party platforms. If static keys leak, attackers can launch unauthorized compute clusters that generate massive expenses in minutes.
The Production Standard: Read-Only STS AssumeRole with ExternalId
The secure pattern for automated billing audits uses AWS Security Token Service (STS) AssumeRole with an External ID. The External ID prevents the confused deputy security vulnerability.
┌────────────────────────────────────────────────────────────────────────┐
│ SECURE READ-ONLY STS ASSUMEROLE FLOW │
│ │
│ ┌────────────────────┐ ┌───────────────────────┐ │
│ │ Client / Service │ │ Your AWS Account │ │
│ │ (e.g., RealMRR) │ │ (Target Infrastructure│ │
│ └─────────┬──────────┘ └───────────┬───────────┘ │
│ │ │ │
│ │ 1. sts:AssumeRole │ │
│ │ (RoleArn, ExternalId: "unique-uuid") │ │
│ ├─────────────────────────────────────────►│ │
│ │ │ │
│ │ 2. Return Ephemeral Credentials │ │
│ │ (AccessKey, SecretKey, SessionToken) │ │
│ │ Expires in 15 - 60 minutes │ │
│ │◄─────────────────────────────────────────┤ │
│ │ │ │
│ │ 3. ce:GetCostAndUsage │ │
│ │ (Query read-only billing metrics) │ │
│ ├─────────────────────────────────────────►│ │
│ │ │ │
│ │ 4. Return Daily Cost JSON │ │
│ │◄─────────────────────────────────────────┤ │
└────────────────────────────────────────────────────────────────────────┘
Step 1: Create the Minimalist Read-Only IAM Policy
This policy limits access strictly to Cost Explorer billing metrics. The role cannot access S3 data, stop compute instances, or view database records:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCostExplorerReadOnly",
"Effect": "Allow",
"Action": [
"ce:GetCostAndUsage",
"ce:GetDimensionValues",
"ce:GetCostForecast"
],
"Resource": "*"
}
]
}
ce:GetDimensionValues and ce:GetCostForecast are for your own scripts. A role for RealMRR needs only ce:GetCostAndUsage.
Step 2: Configure the Trust Relationship Policy
Attach this trust policy to the IAM Role. It ensures the external client or automated runner can assume the role only when presenting the agreed ExternalId:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "<principal-ARN-of-the-service-assuming-the-role>"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "<external-id-given-by-that-service>"
}
}
}
]
}
Step 3: Example TypeScript Code to Fetch Daily AWS Costs
This TypeScript implementation uses the AWS SDK v3 packages (@aws-sdk/client-sts and @aws-sdk/client-cost-explorer):
// aws-billing.ts
import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts";
import {
CostExplorerClient,
GetCostAndUsageCommand,
Granularity,
GroupDefinitionType
} from "@aws-sdk/client-cost-explorer";
export interface DailyServiceCost {
date: string;
service: string;
amountUSD: number;
}
export async function fetchDailyAWSCosts(params: {
roleArn: string;
externalId: string;
startDate: string; // YYYY-MM-DD
endDate: string; // YYYY-MM-DD
}): Promise<DailyServiceCost[]> {
// 1. Initialize STS Client to assume the read-only role
const stsClient = new STSClient({ region: "us-east-1" });
const assumeRoleCmd = new AssumeRoleCommand({
RoleArn: params.roleArn,
RoleSessionName: "BillingAuditSession",
ExternalId: params.externalId,
DurationSeconds: 900, // 15-minute ephemeral token
});
const stsResponse = await stsClient.send(assumeRoleCmd);
if (!stsResponse.Credentials) {
throw new Error("[AWS FinOps] Failed to assume STS role. Verify RoleArn and ExternalId.");
}
// 2. Initialize Cost Explorer Client using ephemeral credentials
const ceClient = new CostExplorerClient({
region: "us-east-1",
credentials: {
accessKeyId: stsResponse.Credentials.AccessKeyId!,
secretAccessKey: stsResponse.Credentials.SecretAccessKey!,
sessionToken: stsResponse.Credentials.SessionToken!,
},
});
// 3. Query daily cost grouped by Service.
// End is exclusive: End "2026-11-20" returns costs through 2026-11-19.
const results: DailyServiceCost[] = [];
let nextPageToken: string | undefined;
do {
const costResponse = await ceClient.send(
new GetCostAndUsageCommand({
TimePeriod: { Start: params.startDate, End: params.endDate },
Granularity: Granularity.DAILY,
Metrics: ["UnblendedCost"],
GroupBy: [{ Type: GroupDefinitionType.DIMENSION, Key: "SERVICE" }],
NextPageToken: nextPageToken,
}),
);
for (const period of costResponse.ResultsByTime || []) {
const date = period.TimePeriod?.Start || "";
for (const group of period.Groups || []) {
const serviceName = group.Keys?.[0] || "Unknown Service";
const amountUSD = parseFloat(group.Metrics?.UnblendedCost?.Amount || "0");
// Skip zero-cost items; keep credits, which are negative
if (Math.abs(amountUSD) >= 0.01) {
results.push({
date,
service: serviceName,
amountUSD: Math.round(amountUSD * 100) / 100,
});
}
}
}
nextPageToken = costResponse.NextPageToken;
} while (nextPageToken);
return results;
}
AWS bills each Cost Explorer API request, so run this once a day, not every minute.
4. A One-Afternoon AWS Cleanup
Teams can reduce cloud expenses quickly without rewriting code:
┌─────────────────────────────────────────────────────────────┐
│ THE ONE-AFTERNOON AWS DIET │
├─────────────────────────────────────────────────────────────┤
│ STEP 1: CLEAN UP ZOMBIE RESOURCES (15 Minutes) │
│ • Delete unattached EBS volumes (`status=available`). │
│ • Release unassociated Elastic IPs ($0.005/hr idle tax). │
│ • Terminate legacy, forgotten staging databases. │
│ │
│ STEP 2: NETWORK & LOG RETENTION TUNING (30 Minutes) │
│ • Add free S3 VPC Gateway Endpoint to route tables. │
│ • Cap CloudWatch Log Group retention to 7 or 14 days. │
│ • Upgrade all `gp2` EBS storage volumes to `gp3` (20% off). │
│ │
│ STEP 3: CONSIDER A 1-YEAR COMPUTE SAVINGS PLAN (15 Minutes) │
│ • Select "Compute Savings Plans" (No Upfront). │
│ • Covers EC2, Fargate, and Lambda automatically. │
│ • You commit to an hourly spend for a year, even if usage │
│ drops; it applies across instance families and Regions. │
└─────────────────────────────────────────────────────────────┘
Convert gp2 to gp3 for an Instant 20% Discount
Older AWS setups often use gp2 (General Purpose SSD) volumes.
gp2costs: $0.10 per GB-month.gp3costs: $0.08 per GB-month and includes a baseline 3,000 IOPS and 125 MB/s throughput at no added charge.
Teams can convert an active EBS volume from gp2 to gp3 through the AWS console or CLI without reboots or downtime. The change starts at once, though the volume can take a while to finish optimizing, and it lowers disk costs by 20 percent at the prices above.
5. Tracking AWS Costs in Your Product Margins
Targeted fixes lower cloud costs. But founders must also track net margins:
"What percentage of recurring subscription revenue goes toward AWS each month, and what is the true gross margin?"
Traditional subscription analytics tools inspect payment accounts such as Stripe or Paddle. They track top-line MRR figures without monitoring cloud hosting expenses.
Illustrative example, one month:
- Revenue: $24,800.00
- AWS costs: -$3,420.00
- AI API costs (OpenAI, Anthropic): -$2,180.00
- Profit: $19,200.00 (77.4% margin)
RealMRR reads revenue from Stripe, Paddle or Lemon Squeezy and costs from OpenAI and Anthropic through their APIs, and shows revenue, costs and profit for each product.
Add your AWS bill as a manual expense. If several products share the bill, use AWS Cost Explorer to split the total and enter each product’s share.
6. Summary: Reclaim Your Startup's Margins
AWS provides a wide set of cloud tools. But default configurations prioritize high availability over cost control.
Founders should focus on building sustainable businesses with positive cash flow rather than running needlessly complex cloud topologies.
Review your VPC routing tables, remove unattached EBS volumes, apply log retention limits, and record your AWS expenses in RealMRR.
Correcting these default settings protects margins and preserves startup capital.
Related Reading
- How to Track and Allocate OpenAI & Anthropic API Costs Per User
- Why $20k MRR Can Still Leave You Broke: The Broken Unit Economics of AI Wrappers
- RealMRR vs Baremetrics vs ProfitWell: Why Subscription Analytics Fail Modern AI Apps
- Stripe vs Paddle vs Lemon Squeezy: The Real Cost After Fees, FX, and Taxes (2026)
- Where to Sell a Micro-SaaS in 2026: Acquire.com vs TrustMRR vs Flippa vs RealMRR
Know your real profit today.
Connect your payment gateway and cloud bills to get verified profit rankings, automated bookkeeping, and zero guesswork.