Skip to main content
GullySystem

Infrastructure as Code Implementation on a Live Estate

Infrastructure as code implementation brings servers, networks and databases that already run your business under version-controlled definitions. The import is done in stages, and behaviour is checked to be unchanged.

Import before improvement

Writing clean scripts and rebuilding everything is a poor fit for a live estate, because a rebuild can cause an outage that customers notice. Existing resources are imported instead, one group at a time. The definitions are checked until running them changes nothing. Tidying comes after that. An import binds one existing resource to one definition. The tool expects a one-to-one match, so a resource cannot be claimed by two definitions at once.

What the implementation sets up

Where state lives

State is held remotely with locking, so two engineers running the same script cannot overwrite each other’s work. Runs are serialised.

Module structure

Repeated patterns become reusable modules, and a second environment is then a short definition and not a copied folder of scripts.

A review workflow

Proposed changes appear as a plan before they are applied. A second person approves anything that touches production.

Secrets kept out

Credentials and keys stay in a secret store and never enter the repository. Repositories are shared and long-lived.

What stays outside the scripts

  • Data, because definitions create the database and not the rows inside it
  • Application releases, which belong to the deployment pipeline
  • Anything a provider does not expose to automation, documented as manual

Handing it to your team

Scripts that nobody on your side can read become another dependency. That defeats the purpose. Your developers are walked through the structure, the plan step and the approval routine. Documentation is kept in the same repository.

Stages of an import

Survey

Every resource in the account is listed, along with who created it and whether anything still uses it.

Write matching definitions

For each group, a definition is written to describe the resource as it is today, flaws included.

Import and compare

The tool is told that this definition owns that live resource. A comparison must show no differences before moving on.

Protect critical resources

Databases and storage get settings that block accidental deletion, so a careless edit cannot destroy data.

Switch the workflow

Once a group is imported, console changes stop for it and the pipeline becomes the only route.

Typical hazards

Resources the tool cannot import

Some settings have no import path and need manual recreation or documentation. These are flagged early.

Hand-made differences between environments

Production and staging differ in ways nobody chose. Each difference is recorded and either kept on purpose or removed.

Dependencies between groups

Importing a server before its network leaves definitions that cannot be checked. Order follows dependency.

What the infrastructure code rollout needs from you

  • Admin-level read access to the cloud account
  • A named approver for production changes
  • A repository location and a pipeline you already use or will choose with us

Importing a live estate week by week

An import happens beside a business that keeps trading. Each working day, a few resources move from hand-built to scripted, while the people who rely on them carry on. This is what the routine looks like for your team. Each day is small.

Morning inventory of one slice

The engineer picks one slice, such as the staging network, and lists every resource in it. The list is compared with what the scripts will describe. Gaps are noted as questions for whoever built the original. Questions come first.

Plan run with no changes

After importing a resource, the engineer runs the planning step and expects it to report nothing to change. Any difference means the script misdescribes the live setting. Only a clean plan lets that resource be marked as imported. Then comes the next slice.

Hand-off to the support rota

When a slice is imported, the support rota gets a short note. It says which resources are now under scripts and which console screens must no longer be used for them. The rota repeats it at stand-up.

Month-end tidy of leftovers

At month end, the engineer reviews resources still outside the scripts. Some are retired and deleted. Others get a written reason for staying outside, with an owner named. The list shrinks, and the remainder is honest.

Choices to settle before the import begins

Importing starts with deciding what the scripts will own. These calls belong to your side of the table, because they decide who may change what once the scripts exist, and what is left alone. Each one is a real decision.

Who may approve a change

Name the people allowed to approve a change to production definitions. One approver slows urgent work, while five dilute responsibility. Write the names down, and record who stands in during leave. Keep the list short and written.

What is deliberately left out

Some resources are better kept outside the scripts, such as a legacy database nobody wants to touch. List them with a reason and an owner. An honest exclusion list beats a quiet gap. Be honest about them.

Which environment goes first

Choose a low-risk environment to import before production. Development or staging teaches the team the process with little at stake. Production follows once the same steps have run cleanly there. Start small and prove it.

Which report you read first

Decide what you want to see each week: resources imported, resources outstanding, or drift found. One report, read regularly, tells you more than three that nobody opens. Pick one report.

Make an informed decision

Agree the evidence before signing off this part.

Use a representative scenario to decide what this part of the system must show and where review is still needed.

What stays outside the scripts

Who can approve or bypass a production release?

For “What stays outside the scripts”, record the permitted release path and rehearse a failed change. Check who can use production credentials and how the previous working version is identified.

Background reading: GitHub: deployment environments

A review workflow

What needs fresh approval after a record is changed?

For “A review workflow”, change a material detail after approval during a scoped walkthrough. Agree the next responsible person and the evidence needed before the work can continue.

Background reading: ERPNext: approval transitions

FAQ

Frequently asked questions

Can infrastructure as code be implemented on a live estate?

Yes, by importing and not recreating. Each group of resources is brought in and verified to produce no change before the next group is touched.

Which tools do you work with?

The common declarative tools and the provider-native ones. The choice follows what your team can maintain afterwards.

What about resources nobody remembers creating?

They appear during the import. Each is identified, and anything unused is removed only with your sign-off.

Will our developers be able to maintain this?

Yes, and the handover exists for that reason. The structure is kept plain, and your team is taken through it during implementation.

How long does an import take?

Time follows the count of existing resources and how tangled their relationships are. A small estate may take a few weeks. A large one proceeds group by group over a longer period.

What is a state file?

It is the record a tool such as Terraform keeps of which real resources match which definitions. By default it is a local file, which is risky for teams, so it is moved to remote storage with locking and kept secret because it can contain sensitive values.

Will importing cause downtime?

It should not. Importing changes only the tool’s records, not the live resources. Risk arises later, when a definition is changed, and the plan step shows the effect first.

Can the state file contain secrets?

It can, because resource attributes such as database passwords are recorded in it. That is why state is stored remotely with access control and never committed to a repository.

Talk to us

Tell us what you need.

Tell us what your team does today, where work gets stuck and what you want to change.

What happens after you share your requirements

  1. We review your brief and the systems you already use.
  2. We clarify the workflow, missing information and the work to consider first.
  3. The proposed scope sets out the deliverables, responsibilities and dependencies.
  4. Review the scope and commercial terms before deciding whether to proceed.

Start with your requirements

Describe your current process, the people involved and the change you need. Start with the details you know; we can clarify the rest together.

Share your requirements