November 2026

The Tests Passed. Then We Deployed to AWS

At 4:12 PM on a Thursday, the deployment pipeline turned a soothing shade of emerald green. Forty-seven integration tests had just sprinted through a DynamoDB suite without a single complaint. Someone took a celebratory sip of lukewarm coffee, merged the pull request, and watched the container roll out to production. Six seconds later, the application tried to write its very first record to DynamoDB and was promptly slapped down with an “AccessDeniedException”.

Engineers love green checkmarks the way hypochondriacs love a clean blood panel; we rarely pause to ask which organs the doctor actually examined. If every database test passed in CI, what, precisely, did that green pipeline prove?

To find out, I ran a small experiment pitting AWS Emulator, AWS’s local, Rust-built API emulator that runs on your laptop without an AWS account, against a real AWS sandbox to see where local testing shines and where cloud reality bites back.

Giving the Emulator and AWS the Same Job

For this test, I used a deliberately modest Python service that writes an order record to a DynamoDB table and immediately reads it back. Nothing exotic, just standard boto3 calls, a partition key, and a handful of attributes.

The beauty of AWS Emulator is that your application code remains blissfully unaware that it is talking to a local process instead of a sprawling data center in Oregon. When the emulator starts up, it generates local credentials and serves standard AWS APIs over HTTPS. Switching between the local emulator and a real AWS sandbox requires zero code edits; you simply swap two environment variables, “AWS_ENDPOINT_URL” and your profile credentials, before running “pytest”.

Here is the core test both environments had to survive:

import boto3
import pytest
from botocore.exceptions import ClientError

def test_write_read_and_duplicate_rejection(dynamodb_table):
    item = {"order_id": "ord-90210", "status": "CONFIRMED", "total": 42}

    # 1. Write and read back
    dynamodb_table.put_item(Item=item)
    stored = dynamodb_table.get_item(Key={"order_id": "ord-90210"}).get("Item")
    assert stored == item

    # 2. Reject duplicate write conditionally
    with pytest.raises(ClientError) as exc:
        dynamodb_table.put_item(
            Item={"order_id": "ord-90210", "status": "OVERWRITTEN", "total": 99},
            ConditionExpression="attribute_not_exists(order_id)",
        )

    assert exc.value.response["Error"]["Code"] == "ConditionalCheckFailedException"
    assert dynamodb_table.get_item(Key={"order_id": "ord-90210"})["Item"]["status"] == "CONFIRMED"

When I compared the two runs, I split the stopwatch into two phases, environment setup and actual test execution, because lumping them together is how benchmarks lie to people.

  • Setup time was a blowout. Starting AWS Emulator and creating the table locally took roughly 0.4 seconds. Provisioning the equivalent table in a real AWS sandbox took just over 7 seconds of polite waiting while cloud control planes shuffled paperwork.
  • Test execution time showed a similar gap. Against the emulator, the write and read round-trip finished in 14 milliseconds. Against real AWS, network physics intervened, clocking in at 185 milliseconds.
  • Returned values were identical down to the last dictionary key.

Making a Write Fail on Purpose

Happy-path tests are charming, like testing an umbrella indoors. Real confidence comes from watching software fail properly.

In the second half of the snippet above, the application attempts a conditional write using “attribute_not_exists(order_id)” to prevent duplicate orders from clobbering existing ones. Both environments had to reject the duplicate write, return a “ConditionalCheckFailedException”, and leave the original “CONFIRMED” record untouched.

Both agreed completely. Traditional SDK mocks are polite yes-men; they return whatever cheerful hallucination you programmed them to return, which means they happily pass tests for bugs you invented yourself. AWS Emulator, by contrast, is generated from official AWS API models and maintains real resource state across calls. Watching it enforce condition expressions and reject malformed requests with authentic AWS error codes explains why running these tests locally actually means something.

Of course, no emulator is omniscient. AWS publishes its own fidelity tests and release-by-release scorecards in the “aws-emulator-evaluation-suite” repository on GitHub. Before trusting any local emulator with a tricky service feature, say complex DynamoDB transactions or niche stream filters, you can check those public fidelity reports to verify that the exact API behaviors your app relies on have already been tested against live AWS.

Running One Test in the Actual Uniform

So if the emulator faithfully reproduces DynamoDB’s API behavior, why did our hypothetical Thursday deployment catch fire?

Because an emulator checks whether your code knows how to knock on DynamoDB’s door. IAM checks whether the bouncer lets you inside. By design, AWS Emulator does not evaluate IAM policies or resource-based permissions the way live AWS does. Inside the emulator, your code effectively wears an all-access VIP lanyard.

To see this gap in action, I moved into the AWS sandbox and gave the deployed application’s IAM role permission to write to a table named “orders-allowed”, while leaving a second table, orders-restricted, outside that grant. Then I ran a tiny smoke test from inside the deployed workload itself.

The write to “orders-allowed” sailed through. The write to “orders-restricted” hit a brick wall and threw “AccessDeniedException”, the exact failure mode from our Thursday afternoon post-mortem.

Look back at what happened earlier. Our integration suite proved that the application speaks fluent DynamoDB. This single, ten-line smoke test proved something entirely different, that the IAM role attached to the deployed container actually possesses the keys to the rooms it plans to enter.

What Changes in Your Pipeline

You do not have to choose between glacial cloud test suites and blissful local ignorance. You just have to stop asking one tool to answer both questions. Here is a cleaner division of labor for your CI/CD pipeline:

  1. On every pull request, run your full integration suite, including writes, reads, edge cases, and conditional failures, against AWS Emulator. It runs in milliseconds, requires zero cloud credentials, and catches broken queries before a human ever reviews the diff.
  2. Before promoting a deployment, run a short smoke test in a real AWS environment using the deployed workload’s actual IAM role and configuration. Do not test every business rule here; just prove the workload can touch the real tables, queues, and buckets it owns.
  3. When an SDK or service dependency changes, rerun your integration tests against real AWS if your application depends on subtle service behaviors you have not yet verified in the emulator’s fidelity suite.

Local emulators give developers something priceless, speed without the friction of cloud deployments. Just remember that speed and realism are different currencies. The next time your pipeline flashes green and you reach for your coffee mug, pause for two seconds and ask yourself one question.

When CI goes green, which identity actually passed the test?

Paying ransom for cloud elasticity your servers never actually use

The official list prices on AWS have been sitting as still as a taxidermied moose for years. Enterprise invoices, however, keep expanding like a deep-sea creature brought to the surface too quickly.

This is not a mystery of inflation, nor is it sudden corporate villainy. It is the natural result of an accounting model designed for one very specific biological species of workload that most mature software systems no longer resemble. For over a decade, we were told the monthly cloud bill was a clean, cryptographic truth about what our software needed to survive. Today, that invoice has stopped being a reliable signal for where a workload belongs. Labyrinthine commitment structures, stealthy data transit tolls, vast prairies of idle capacity, and a provider roadmap aggressively tilted toward artificial intelligence compute all push your total higher even while the public rate card plays dead.

By the end of this piece, you will have a short, slightly uncomfortable set of questions designed to separate the workloads that genuinely belong in the cloud from the ones that are merely squatting there because nobody has had the courage to hand them an eviction notice.

The quiet financial art of funding someone else’s GPU habit

If you only look at the unit price of a virtual machine, everything appears calm. Overspend rarely announces itself in bold red font on page one of the monthly summary. Instead, it hides in the damp corners of the architecture. It lives inside oversized Savings Plans bought by an optimistic architect who left the company in 2023. It lurks in orphaned staging environments that sit humming quietly in the dark after a project wraps up, in untagged mystery buckets that no living human admits to owning, and in steady, predictable systems still running at on-demand emergency rates.

According to the Flexera 2026 State of the Cloud report, estimated wasted spend on infrastructure and platform services has climbed to 29 percent, marking the first upward tick after five consecutive years of decline. That figure is self-reported, which in corporate psychology means the real number is almost certainly worse. Nobody fills out an industry survey to brag about lighting nearly a third of their infrastructure budget on fire. Yet 29 percent tracks closely with what engineering teams discover the moment they stop treating the AWS invoice as an immutable law of physics and start treating it as a crime scene.

There is also a quieter macroeconomic joke playing out behind the curtain. Hyperscalers are currently locked in a multi-billion-dollar arms race to buy every high-end AI chip on the planet. Those shiny new GPU clusters require astronomical capital expenditure, and someone has to help pay the mortgage. Increasingly, that someone is your boring, neglected relational database, which sits in a corner quietly generating high-margin rent so the cloud provider can afford more silicon for someone else’s chatbot. The bill goes rogue because almost no one is profiling, at the level of individual workloads, what all that money is actually buying.

Wearing a pressurized Himalayan oxygen suit to buy groceries

To understand where the money goes, you have to look at the gap between what engineers think their servers are doing and what the servers are actually doing. Cast AI analyzed more than two thousand organizations and found that the average Kubernetes cluster uses roughly 10 percent of its provisioned CPU and 23 percent of its memory. Later snapshots of the exact same data set showed utilization dropping even lower.

Think about that ratio in physical terms. Provisioning a Kubernetes cluster to sit at 10 percent CPU utilization just in case traffic explodes is the architectural equivalent of wearing a pressurized Himalayan oxygen suit and crampons to walk down to the corner store for milk, simply because back in the spring of 2021 you walked up a steep hill and felt a little winded.

When a startup workload is born, it behaves like a caffeinated toddler, sprinting wildly in unpredictable directions at three in the morning. Cloud pricing loves caffeinated toddlers. It was specifically engineered to reward demand that spikes, vanishes, and returns without warning. The problem is that software ages. After twelve to twenty-four months, most internal tools, enterprise databases, and core backend services mature into middle-aged accountants who eat the exact same ham sandwich at 1:15 p.m. every Tuesday. Their resource consumption is flat, boring, and deeply predictable.

Yet we keep dressing these middle-aged workloads in flame-retardant parkour gear. The wake-up call is seldom a single shocking monthly bill. It usually arrives during the multi-year renewal cycle, when someone in finance drags a spreadsheet formula across thirty-six months and realizes infrastructure costs are growing twice as fast as customer revenue. A database that has not experienced a traffic spike in a year is not an elastic workload. It is a fixed cost wearing a variable-price tuxedo. You are renting the theoretical option to scale to the moon, and you are paying a heavy monthly premium for reflexes your application has not used since the pandemic.

The casino buffet where the exit door costs ninety thousand dollars

Suppose you finally spot one of these sedentary databases and decide to move it somewhere cheaper. That is when you meet the bouncer at the door, otherwise known on your invoice as data egress.

Egress remains one of the least budgeted and most fascinating lines on any cloud bill. Moving data into the cloud is completely free, much like entering a questionable casino buffet where the shrimp cocktail is complimentary, the carpet is hypnotic, and using the exit door costs ninety thousand dollars. Before any negotiated enterprise discounts, pulling a single petabyte of your own data out to the open internet carries a sticker price right around that ninety-thousand-dollar mark. Even if you never leave the building, routine cross-availability-zone traffic and cross-region replication quietly nibble away several percentage points of your total budget just for passing notes between hallways.

Regulators have started noticing the lock on the fire exit. The European Union’s Data Act recently forced cloud providers to waive or drastically reduce switching charges when a customer fully abandons a service, prompting several hyperscalers to announce free egress allowances for full departures. That helps if you are packing up your entire digital life and moving to a monastery, but the structural trap remains untouched. Ongoing traffic between zones, regions, or external systems still triggers the tollbooth every single second. The fee is not a billing oversight. It is gravitational physics by design, engineered to ensure that the friction of leaving always looks slightly more painful than the misery of staying.

What happened when 37signals and Yellowbrick stopped paying the anxiety tax

Every few years, a company decides to test whether life exists outside the buffet. The team at 37signals, the company behind Basecamp and Hey, did the public service of publishing their actual receipts.

Back in 2022, they were spending roughly 3.2 million dollars a year on cloud services. After migrating their core compute workloads onto colocated Dell servers that cost between six hundred thousand and eight hundred thousand dollars to purchase outright, their remaining cloud bill dropped to about 1.3 million dollars by 2024. The physical hardware paid for itself in well under eighteen months. More importantly for the narrative that managing your own servers requires an army of sleep-deprived wizards, the exact same ten-person operations team continued running the infrastructure without a single extra hire.

Their storage numbers were even more revealing. Keeping their data on S3 was costing about 1.5 million dollars a year. Buying self-managed storage arrays with equivalent capacity brought that annual figure down to under two hundred thousand dollars. With the 1.3 million dollars saved every year on storage alone, 37signals could have hired a full-time classical cellist to sit in the data center aisle playing soothing Bach suites to the hard drives, and still pocketed over a million dollars in pure profit.

They are not an isolated anomaly. Yellowbrick Data ran a similar experiment by pulling their development and testing environments off the public cloud onto reused hardware in modest colocation facilities, trimming 3.9 million dollars a year from their operational burn. Neither company pulled off a reckless, cinematic midnight migration. Both transitions started with an unglamorous spreadsheet that asked, for the very first time, whether the expensive flexibility on the invoice was actually being consumed by the software.

The cave salamander problem and other hazards of physical hardware

At this point, it is tempting to rent a moving truck, buy forty racks of bare-metal servers, and declare independence. That would be a mistake, because repatriation comes with its own gallery of horrors.

First, there is the human biology problem. After more than a decade of pure cloud-native hiring, our industry’s bare-metal survival instincts have atrophied like the eyesight of a blind cave salamander. We have entire engineering departments capable of orchestrating a multi-region service mesh across forty nested YAML files before breakfast. Yet if you place those same brilliant engineers in a cold room in front of a physical server blinking an amber RAID controller light, they react the exact same way a Victorian aristocrat would react to finding a live badger in the drawing room. Rebuilding those operational muscles takes time, patience, and salaries.

Second, migrating entrenched applications is neither free nor painless. Untangling proprietary cloud queues, rewriting deployment pipelines, negotiating downtime windows with anxious executives, and paying that final egress ransom all sit heavily on the other side of the ledger. Hardware economics have also grown teeth in recent cycles, as global memory and component shortages driven by the AI boom have pushed server prices and delivery lead times upward.

The argument is never that owning metal is universally cheaper than renting cloud. The argument is that the monthly AWS invoice has lost its mind as a compass for architecture, and blindly trusting it is an expensive way to run a business.

Auditing which workloads actually deserve a cloud hotel suite

Because of those real-world migration costs, full exits from the public cloud remain rare. Surveys from IDC and other analysts consistently put the share of enterprises planning a total repatriation in the single digits, while Gartner expects the overwhelming majority of organizations to live in hybrid or multi-cloud arrangements indefinitely.

The smart move is not a dramatic ideological retreat to the basement data center. It is selective, ruthless placement on a workload-by-workload basis. You keep the caffeinated toddlers in the cloud where they can bounce off the padded walls of auto-scaling groups, and you move the middle-aged sandwich-eaters into a predictable lease.

Three straightforward questions cover ninety percent of the decision for any system in your architecture.

  1. Does this workload genuinely spike and contract, or has its twelve-month utilization graph looked like a flatline on a hospital monitor?
  2. Where does its data sit, and how much toll money is it paying every month just to cross virtual availability zones or talk to the outside world?
  3. What does the true annual cost look like once you strip away idle buffer capacity, unexercised scaling options, and the illusion of commitment discounts?

Before your next infrastructure review, pull the twelve-month utilization curves and network transfer lines for the five workloads that eat the largest share of your cloud budget. Put them on a single screen. That ten-minute exercise almost always exposes at least one heavy system paying luxury penthouse rates to sleep on the floor.

Which workload in your estate would actually survive that audit, and which one is only still living in AWS because nobody has politely asked it to pack its bags?