The whole platform described in code — reproducible, reviewable and safe to change.
Before you read: Written from live engineering practice — the money-moving, million-user work our team runs on our own products, set down so anyone building something can learn from it.
01 · What it is
When infrastructure is click-configured, nobody really knows what the platform looks like and change is a nervous ceremony. We describe the entire platform as code — Terraform and IaC platforms — so environments are reproducible from nothing, dev matches prod, infrastructure lives in version control reviewed like any code, and security is default-enforced in every template instead of remembered. Rollbacks return you to a known state. And the complete history of the platform is auditable, which matters more than most teams admit until they need it.
What a infrastructure as code build covers:
Infrastructure that only lives in someone's memory is infrastructure that dies when they leave. We describe the entire platform — databases, policies, functions, cron jobs — as versioned code with one declarative source of truth, so reality converges to the file instead of drifting away from it. Drift is detected before it becomes an incident, and any environment can be destroyed and rebuilt from nothing, which is what turns recovery from archaeology into a commodity.
What we do
How we do it
02 · The full discipline
When infrastructure is assembled with clicks, only the person who clicked knows what the platform actually is, and the next person who inherits it is rewriting archaeology instead of shipping software. Every change becomes a nervous ritual guarded by a single fragile memory. The alternative — describing the whole platform in code — is not a tooling preference; it is how an organization stops holding its own infrastructure hostage to memory.
We build and run infrastructure the way a live platform has to — because KodiiPay is a payments platform we operate ourselves in production, moving real money through M-Pesa on Safaricom's Daraja rails. Its database, row-level security policies, payment procedures, cron jobs, edge functions and monitoring are all declared as code, versioned, reviewed and reproducible — because a payment ledger that exists only in someone's head is not infrastructure; it is a liability wearing a production costume.
Below is how we actually do infrastructure as code for money-moving systems. Every layer — declarative configuration, reproducibility, secrets, drift, the human discipline, the honest places where a script is the right answer — is how we run our own platform, and we bring the same machinery to clients.
03
Infrastructure-as-code means the entire platform — databases, networking, functions, security policies, monitoring, cron jobs — has one canonical, versioned, human-readable description. The cloud becomes a compiler for a declaration, and reality is meant to match the file. That sounds like an engineering preference; it is actually an organizational safety property.
The console is where the platform lives; the code is where the platform is born. We make sure the birth certificate exists before anyone trusts the construction.
04
Click-configured infrastructure has a specific failure mode: each click adds configuration that lives nowhere, answered to no one, and is forgotten by everyone but the person who clicked. The platform becomes a snowflake — unique, unrepeatable, and terrifying to touch. The problem is not that clicks are easy; it is that knowledge evaporates exactly as fast as the clicking finger forgets.
We have inherited enough click-built platforms to know the pattern by smell. IaC exists so the platform's knowledge survives the people who happened to build it.
05
The heart of IaC is the declaration: you express what you want to exist, and the tooling makes reality converge on it. You do not tell the machine 'create a database, then a table, then five indexes'; you describe the database, the table and the indexes, and the machine reconciles reality toward that description — creating what is missing, changing what differs, and leaving alone what already matches.
Declarative infrastructure turns the platform into a compiler target instead of a museum of hand-laid bricks. The declaration is the contract; the cloud is required to keep it.
06
Reproducibility means a developer's environment, a staging environment and production are built from the same descriptions, differing only in scale and credentials. This is not creature comfort; it is the difference between a bug that reproduces in a sandbox and a bug that only ever exists in production.
A platform that cannot be reproduced is a platform that can only be hoped about. We build the ability to build it again into the platform itself.
07
Configuration as code brings with it a quiet law: two engineers who apply the same declaration to two valid states will keep them aligned — not because they are disciplined, but because the files do the disciplining. We call this the 'two engineers align' effect, and it is the social contract underneath IaC.
IaC makes alignment a property of the system rather than a property of the mood. The discipline is not in the tool; it is in the two engineers — and the tool makes their alignment sticky.
08
Infrastructure drifts. Someone clicks a firewall rule, a cron runs a one-off change, a failover modifies a resource, a console edit 'fixes' something temporary and stays forever. Drift is the slow divorce between the declaration and reality, and its first victim is trust: if the file lies, no one believes the file. Drift detection is how we keep the marriage honest.
The fork between the file and reality will happen; the only question is whether it is discovered in a minute by a robot or at 3am by a customer. We choose the robot.
09
IaC would be a catastrophe if it meant putting secrets in the code, and people do exactly that. The correct split is total: the code declares the shape of the platform, and the secrets arrive separately, at runtime, from a managed store — never in the files, never in the git history, never in the plan output.
IaC resolves the what, and the secret manager resolves the who-can-use-it. Keeping those two worlds separate is the boundary that keeps a repository leak from becoming a money leak.
10
IaC's quiet gift to security is that defaults travel with the code. If every template is locked down, every environment is locked down — not because each person remembered, but because the default was safe and the exception had to be argued for in review. Security stops being a memory and becomes a property of the template.
The template is the contract every environment inherits. We make the contract say 'secure' in its first line, so nobody has to repeat it after it.
11
When a change breaks the platform, the fastest rescue is returning to the state that worked. Click-built platforms make that archaeology; IaC makes it a revert. But a revert is only as good as the last known-good state, so the discipline of knowing good states is part of the system.
Recovery is a commodity when the known-good state is a file. We keep the exits open by keeping the good states real.
12
There is one test that proves reproducibility beyond argument: destroy an environment, then rebuild it from the declaration alone and watch whether anything breaks. We run that test deliberately, because 'should be reproducible' and 'is reproducible' are different claims separated by evidence.
Nothing proves a recovery path like actually walking it. We destroy and rebuild, in public, on purpose, until the resurrection is boring.
13
IaC at one scale is one file; at real scale it is a portfolio of modules — databases, application services, edge functions, networking, observability, policy — composed into environments. Composition is where IaC either stays coherent or collapses into a maze of copy-paste, and we treat it as its own discipline.
A platform is a portfolio of described parts with a wiring diagram. We keep both the parts and the wiring in files, reviewable and coherent.
14
The most opinionated infrastructure-as-code we operate is our own payment platform's schema and security model. Declaring a ledger in files is not a convenience; it is the difference between 'the books came from a ceremony' and 'the books came from a reviewed file'.
Our ledger is not assembled; it is declared, reviewed and drifted-checked. That is what infrastructure-as-code means when the infrastructure is money.
15
We are honest about IaC's opposite: some infrastructure does not need the full declarative machinery. A prototype, a static site, a single-purpose function or a short-lived experiment can be a well-written script, and calling that a failure is cargo-cult discipline. The judgement is about persistence, stakes and shared ownership.
We will name the grading honestly: this deserves the full platform, or this deserves a clean script. The machine should fit the mission, and we will tell you which mission you have.
16
Infrastructure is a bill as well as a topology, and IaC makes cost an engineering feature rather than a finance-time surprise. When the platform is declared, cost is attributable, right-sized and reviewable — and unused things can be destroyed because they can always be recreated.
Infrastructure must earn its bill, and declared infrastructure can prove it. We make cost a first-class, reviewable property of the platform.
17
We do not deliver a diagram and disappear. We audit the platform as it exists, import what deserves to survive, declare the rest, and hand over a platform the client's engineers can rebuild from files with confidence — then we stay until the first few honest failures become routine.
The goal of every infrastructure engagement is the same: the client's next engineer can rebuild the platform from the repository and sleep. That is the deliverable, and it is delivered.
18
IaC is a genuinely transformative discipline and an enthusiastically oversold one. Here is the honest version, from people who have both rescued click-built platforms and fought through IaC that was itself a snowflake.
Infrastructure as code is not software that writes itself; it is care that makes itself repeatable. We bring the care, the machinery and the honesty — and the platform you get survives being rebuilt, along with the humans who read it.
The toolchain
The same classes of machinery that keep our payment platform — ledger, policies, functions and crons — declared, reproducible and guarded. Every tool exists because an unreproducible platform taught us it was needed.
01
Where reality meets the declaration
02
The house the declarations build
03
The moat around the machine
04
The rules the declaration obeys
05
The machine that keeps files honest
06
How declared change travels
07
The bill and the care
Lifecycle
Whether we are declaring a greenfield platform or rescuing a click-built snowflake, the work passes through the same twelve stages — the ones that keep our own payment platform reproducible.
01
Map the click-built resources, undocumented services, console-only tweaks and misplaced secrets before changing anything.
02
Find every credential, move them into the managed store, and give each environment its own honest key set.
03
Capture the surviving resources into modules and files with names, tags, ownership and secure defaults.
04
Infrastructure changes enter plan-and-review like application code; nothing applies unread and unreviewed.
05
Dev and staging are built from the same declarations as production, differing only in scale and credentials.
06
Reality is compared to the files on a schedule, with findings triaged and reconciled while they are cheap.
07
Environments are destroyed and rebuilt from files until the resurrection is boring and documented.
08
Tags, budgets and owner records turn the platform into a portfolio with names and a readable bill.
09
Rollbacks to known-good declarations and schema reverse paths are practiced until the emergency is routine.
10
The platform deploys, migrates and smokes through the same pipeline as the application code it hosts.
11
The client team plans, applies and rebuilds under our eye until the declared platform is genuinely theirs.
12
The first incident, the first migration and the first quarterly rebuild happen beside us — then the team owns them alone.
Closing
Infrastructure-as-code is how a platform stops living in someone's head and starts living in the repository — reviewable, reproducible and survivable. The work we bring to clients includes:
Infrastructure-as-code is not about hating consoles; it is about refusing to let the knowledge of your platform live in one person's memory.
We declare, shelter, drift-check and prove the reproduction of a live money platform every day. When your infrastructure deserves that standard, it is the standard you get.
Previous capability
DevOps & CI/CD
Next capability
Cybersecurity
The discipline above is what we run on our own products every day. If it would help on yours, our door is open.