The Secret Life of AWS: The Ledger (AWS Cost Explorer & Budgets)

 

The Secret Life of AWS: The Ledger (AWS Cost Explorer & Budgets)

The bill is part of the architecture. How to use AWS Cost Explorer and Budgets to manage cloud spend.





Part 18 of The Secret Life of AWS

Timothy arrived at work feeling confident. His pipeline was deploying code (Epispode 16), and his dashboards were green (Episode 17). He opened his email.

There was a notification from AWS Billing.

Total Amount Due: $842.50

Timothy froze. "That cannot be right," he whispered. "I am just running a small web server and a database. It should be $30 a month."

He checked the account. The application was running fine. There was no massive spike in traffic.

Margaret walked by. She saw his pale face and the invoice on his screen.

"Ah," she said. "You have encountered the final constraint of engineering."

"I was hacked," Timothy said.

"Unlikely," Margaret replied. "You are just inefficient. Let's open the Ledger."

The Diagnosis (AWS Cost Explorer)

Margaret navigated to AWS Cost Explorer in the console.

"The bill is a summary," she explained. "Cost Explorer is the investigation tool. It allows us to filter and group costs by Service, Region, and Tag."

She changed the view to Daily Costs for the last 30 days.

The graph was not a flat line. It showed a massive jump two weeks ago—the day Timothy set up his CI/CD pipeline.

"Group by Service," Margaret instructed.

Timothy clicked the filter. The bar chart changed colors. The largest block was blue: Amazon EC2.

"I am only running a t3.micro instance," Timothy insisted. "That costs pennies."

Margaret scrolled down to the Usage Type.

US-East-1-BoxUsage:c5.4xlarge

"You provisioned a c5.4xlarge instance," Margaret said.

Timothy remembered. "I used that for the build server in the pipeline. I wanted the tests to run fast."

"Did you terminate it?"

Timothy checked the EC2 console. The instance was there. Status: Running.

"But the pipeline isn't running right now," Timothy argued. "The build server is doing nothing. The CPU is at 0%."

"In the cloud, you pay for Provisioned Capacity, not just utilization," Margaret said. "You rented the server. AWS reserved that capacity for you. They bill you whether you use it or not."

Timothy stopped the instance immediately.

The Attribution (Cost Allocation Tags)

"This brings up a bigger problem," Margaret said. "How do we distinguish between the 'Production' resources that make money and the 'Development' resources that cost money?"

"We look at the names?" Timothy guessed.

"Names are unreliable," Margaret said. "We use Cost Allocation Tags."

She opened the Tag Editor. "We apply a tag to every resource. Key: Environment. Value: Production or Development."

"However," she warned, "creating the tag is not enough. You must activate 'User-Defined Cost Allocation Tags' in the Billing console. It is a one-time setup, but until you do that, Cost Explorer will ignore your tags."

The Guardrail (AWS Budgets)

"I stopped the big server," Timothy said. "But how do I make sure this doesn't happen again?"

"You automate the vigilance," Margaret said. "We use AWS Budgets."

She navigated to the Budgets console and clicked Create Budget.

  1. Budget Type: Cost Budget.
  2. Amount: $50.00 per month.
  3. Alert: Send email to timothy@company.com if actual spend exceeds 80% ($40.00).

"Now," Margaret said, "if you leave a resource running, or if a Lambda function gets stuck in a loop, you will know within 24 hours. You will not have to wait for the end-of-month invoice."

"Also," she added, "keep an eye on Data Transfer costs. Outbound traffic and cross-region replication are common silent killers. Monitor those metrics closely."

The Philosophy (FinOps)

Timothy stared at the $842.50 invoice. "This is an expensive lesson."

"Engineering is not just about code and latency," Margaret said. "It is about value. If you build a system that generates $100 of value but costs $800 to run, you have failed as an engineer."

"This discipline is called FinOps," she continued. "It bridges engineering, finance, and business teams. The goal is not to spend zero—it is to spend wisely."

Timothy looked at his architecture diagram. He used to see servers and databases. Now, he saw hourly rates.

"I will set up the tags," Timothy said.

"Good," Margaret replied. "Ensure every dollar drives value."


Aaron Rose is a software engineer and technology writer at tech-reader.blog and the author of Think Like a Genius.

Comments

Popular posts from this blog

The New ChatGPT Reason Feature: What It Is and Why You Should Use It

Insight: The Great Minimal OS Showdown—DietPi vs Raspberry Pi OS Lite

Raspberry Pi Connect vs. RealVNC: A Comprehensive Comparison