DevOps
Cloud infrastructure and cost
Infrastructure as code that other people can safely change, and a cost practice that survives past the first spreadsheet.
The situation
Terraform state is one enormous file, nobody dares run apply on a Friday, and the finance team is asking why the bill went up again.
Engagement shape
4-10 weeks, often alongside a platform build
Usual starting point
Infrastructure and cost review
Scope
What you actually get
Landing zone
Multi-account structure with guardrails, SSO and sane network boundaries.
Terraform refactor
State split by blast radius, modules versioned, drift detection in CI.
Policy as code
Checks that fail the pipeline before an unsafe change reaches an account.
Cost attribution
Tagging enforced automatically, with per-team dashboards.
Savings plan
A ranked list of changes with effort, risk and projected saving against each.
Two problems usually arrive together: infrastructure that is frightening to change, and a cloud bill nobody can attribute. They share a root cause, no clear ownership boundaries.
Split state along blast radius
State files should be divided by how bad it would be if an apply went wrong, and by how often each layer changes. Networking changes quarterly; application infrastructure changes daily. They do not belong together.
terraform {
required_version = "~> 1.9"
backend "s3" {
bucket = "acme-tfstate-production"
key = "platform/eks/terraform.tfstate"
dynamodb_table = "acme-tfstate-locks"
encrypt = true
}
}
# Networking is a separate state, read-only from here.
data "terraform_remote_state" "network" {
backend = "s3"
config = {
bucket = "acme-tfstate-production"
key = "platform/network/terraform.tfstate"
}
}
module "eks" {
source = "../../modules/eks"
subnets = data.terraform_remote_state.network.outputs.private_subnets
# Tags drive cost allocation. Enforced by policy, not convention.
tags = {
Environment = "production"
CostCentre = "platform"
Owner = "team-platform"
}
}
Making cost someone's actual job
Cost reduction that depends on a quarterly spreadsheet always regresses. It has to be visible where engineers already look, and attached to the team that can act on it.
The loop we install
- Mandatory tagging enforced at admission and in Terraform policy checks
- Per-team cost dashboards in Grafana next to the reliability dashboards
- Right-sizing recommendations from real usage, reviewed monthly
- Spot or preemptible capacity for anything that can tolerate interruption
- Committed-use discounts bought against a measured baseline, not a guess
Typical first-pass results across recent engagements.
Within the first quarter.
Every rupee maps to a team.
Right-sizing is validated against SLOs.
Tooling we use here
Questions we get asked
We are on Terraform 0.14, is upgrading painful?
It is usually a week of careful work with a state backup at every step. We have done this often enough to know where the sharp edges are.
Should we move to OpenTofu?
If licensing matters to you, the migration path is straightforward today. If it does not, staying put is a perfectly defensible choice.
Will cost cutting break things?
Right-sizing is validated against your SLOs before and after. If a change would eat error budget, we do not make it.
Want this running in your estate?
Send us the shape of your current setup. We will tell you honestly whether this is the right place to start.
Talk to an engineer