AWS field guide
Measure unit cost before optimizing spend
Measure cost per useful outcome so architecture decisions can distinguish growth from waste.
Use this pattern when
Usage is growing, a new managed service is being adopted, or cost varies sharply with traffic.
Reference architecture
Responsibilities and controls, not a deployment template.
Workload usage
Requests, jobs, or tenants
Allocation tags
Ownership and environment
AWS Cost Explorer
Cost and usage evidence
Unit-cost metric
Spend per useful outcome
AWS Budgets
Threshold and anomaly action
Decisions that shape the pattern
- Pick one meaningful business unit.
- Tag resources at creation.
- Separate fixed, variable, and transfer costs.
Security boundaries
- Limit access to billing details.
- Protect budget notification targets.
- Audit changes to cost controls.
Reliability posture
- Use alerts before hard limits where shutdown is risky.
- Account for retry and failure cost.
- Review anomalies with workload context.
Starter implementation
Start from deployable infrastructure
Review every permission, limit, Region, and cost assumption before production.
import { Duration, Stack, StackProps } from 'aws-cdk-lib';
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
import * as athena from 'aws-cdk-lib/aws-athena';
import * as bedrock from 'aws-cdk-lib/aws-bedrock';
import * as budgets from 'aws-cdk-lib/aws-budgets';
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
import * as origins from 'aws-cdk-lib/aws-cloudfront-origins';
import * as cloudtrail from 'aws-cdk-lib/aws-cloudtrail';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import * as patterns from 'aws-cdk-lib/aws-ecs-patterns';
import * as events from 'aws-cdk-lib/aws-events';
import * as targets from 'aws-cdk-lib/aws-events-targets';
import * as glue from 'aws-cdk-lib/aws-glue';
import * as iam from 'aws-cdk-lib/aws-iam';
import * as kms from 'aws-cdk-lib/aws-kms';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as sources from 'aws-cdk-lib/aws-lambda-event-sources';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';
export class PatternStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new budgets.CfnBudget(this, 'MonthlyBudget', {
budget: {
budgetName: 'workload-monthly', budgetType: 'COST', timeUnit: 'MONTHLY',
budgetLimit: { amount: 100, unit: 'USD' },
costFilters: { TagKeyValue: ['user:workload$example'] },
},
notificationsWithSubscribers: [{
notification: { comparisonOperator: 'GREATER_THAN', notificationType: 'FORECASTED', threshold: 80, thresholdType: 'PERCENTAGE' },
subscribers: [{ address: 'owner@example.com', subscriptionType: 'EMAIL' }],
}],
});
}
}
Before production
Adoption checklist
- 01Define a unit of value.
- 02Enforce allocation tags.
- 03Create monthly and anomaly budgets.
- 04Review top variable drivers.
- 05Record cost impact in architecture decisions.
From the journal
Related field notes
Selected from service names and architecture signals used by this pattern.
AI Model Routing: A Pragmatic Approach to Cost Savings
Companies are finding significant AI cost reductions by intelligently routing requests to open-source models.
EC2 T8i Instances: Low-Cost Burstable Compute Arrives
New T8i instances offer a 30% price-performance improvement over T3, but with specific processor limitations.
Graviton5 Powers New EC2 R9g Instances with 25% Better Performance
AWS launches R9g and R9gd EC2 instances with Graviton5, promising a significant performance boost for memory-intensive workloads.
Was this playbook useful?
One click helps prioritize deeper examples and updates.