Diglion
Back to blog

IT Strategy

Infrastructure as code: where an engineering team actually starts

Terraform (or an equivalent) isn't about automating everything at once. It's about no longer recreating from memory what's already running in production.

July 22, 2026|7 min read

Infrastructure as code: where an engineering team actually starts

The symptom shows up before the incident

A team usually discovers it needs infrastructure as code the same way every time: someone goes on vacation, and nobody else can recreate that staging environment exactly. Or an instance goes down, and the "manual, the way we've always done it" restore eats the whole afternoon because two console settings had quietly drifted apart.

Neither case is really about automation. It's about an environment that only exists in one person's head, or scattered across notes nobody revisits until they need them urgently.

What changes once the environment becomes a file

Infrastructure as code, in practice, means one simple thing: server, network, database, and permission configuration lives in a versioned file, not in a setting someone clicked through once and only remembers doing. Terraform, Pulumi, or your provider's equivalent aren't the point: they're just the tool that reads that file and applies the difference between what's described and what actually exists.

That changes the question a team asks after an incident. Instead of "who remembers how this was set up?", it becomes "what does the file say should be here?". The second question has an answer in seconds. The first, only sometimes, and not always from the right person.

The decision that causes the most hesitation: one module or several, from day one

Here's an opinion worth defending, because the team's temptation always runs the other way: start with a single module, for one environment, without abstracting for multi-account reuse from day one. Modularizing early assumes you already know which variations will repeat, and usually you don't, because there still aren't two real environments to compare.

The cost of starting simple is duplicating some code once a second environment shows up. The cost of modularizing early is maintaining a generic abstraction nobody's sure is right, because it's only ever been tested against one case. Between the two, the first is cheaper to fix later: it's refactoring. The second, if the abstraction guessed wrong, is a rewrite.

The practical rule: wait for the pattern to repeat across at least two real environments before extracting a module. Before that, visible duplication beats speculative abstraction.

Where Terraform state turns into risk, not tooling

The .tfstate file holds the mapping between what the code describes and what actually exists in the cloud. Losing it, or letting two people apply changes at once without a lock, isn't an operational footnote. It's the most common way an entire environment ends up out of sync with what the code claims it should be.

A remote backend with locking (S3 with DynamoDB, or your provider's equivalent) fixes most of this. The common mistake is treating it as configuration for "once the project grows". It's exactly the opposite: the smaller the team, the smaller the chance anyone notices the drift in time.

A first-weeks roadmap

Before writing the first line, map what already exists today, ideally with terraform import against a real resource, not by recreating it from scratch. Then pick the lowest-risk environment (staging, not production) as the first target. Only after a full plan and apply cycle with no surprises there is it worth considering production.

Document decisions that aren't obvious right in the code, as a comment near the resource, not in a separate wiki nobody's going to keep updated alongside it. And treat the first apply as a supervised event, not a fire-and-forget task.

When it still isn't worth it

If today's infrastructure is small and stable, and the team is one or two people who already know the environment by heart, the return on adopting infrastructure as code now may be smaller than the cost of learning the tool. It becomes worth it as soon as a second environment shows up, or when the one person who knew it all goes on vacation and someone else needs to touch it.

Where Diglion comes in

Once you reach that point (the environment has outgrown what one person can recreate from memory), the real work is deciding what to describe first and at what level of abstraction, not just installing the tool. Diglion helps engineering teams make that call based on what already exists, instead of rewriting stable infrastructure just to look modern.

Next step

Want to turn this topic into a real project?

Diglion helps diagnose the context, design the path, and build technology with product, architecture, and execution moving together.

Talk to a specialist