When you need this
- Infrastructure was built in the console, and can’t be rebuilt reliably.
- Terraform exists, but it’s one large root module that everyone is afraid to apply.
- A plan for a one-line change takes minutes and touches hundreds of resources.
- Staging doesn’t match production, because they were built differently.
- Changes are applied from someone’s laptop, and state has been corrupted or lost before.
- New services are copied from the last one, so every service is slightly different.
Module design
We design a small set of reusable modules (network, service, database, and so on) with sensible defaults, versioned and documented. Every environment is built from the same modules with different inputs, so staging is a smaller copy of production rather than a close guess.
A good module does one job, needs a handful of inputs rather than fifty, and has safe defaults: encryption on, logs retained, deletion protection on in production. Stacks pin each module to a version, so a module change reaches staging first and production only when someone moves the pin.
module "orders" { source = "git::https://github.com/your-org/terraform-modules.git//ecs-service?ref=v1.4.0" name = "orders" cluster_arn = data.terraform_remote_state.platform.outputs.cluster_arn image = "123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/orders:1.8.2" cpu = 512 memory = 1024 desired_count = 3 }
The full approach is in Terraform module design for a growing AWS platform.
State and environments
State lives remotely, in S3 with locking, and is split by environment and by component, so one mistake can’t reach everything. Provider and module versions are pinned. Secrets stay out of state where possible.
Terraform’s S3 backend can now lock state with a lock file in the bucket itself (use_lockfile = true). The older DynamoDB-based locking is deprecated, so existing backends are worth moving across.
Bringing existing infrastructure under Terraform
We import resources where that’s sensible and rebuild where it isn’t, one environment at a time, starting with the least risky.
- Inventory. List what is actually running in each account and region, and decide what is kept, rebuilt or deleted.
- Import. An
importblock brings a resource under Terraform in a normal plan and apply. Terraform can draft the matching configuration withterraform plan -generate-config-out=generated.tf, which we then tidy into modules. - Prove nothing changes. Once the code matches the real resource, the plan shows no changes. That is the signal it’s safe to move on.
- Refactor.
movedblocks move resources into modules without destroying and recreating them.
import { to = aws_s3_bucket.logs id = "acme-prod-logs" }
Terraform in the pipeline
- Plan on pull request: the planned change is posted for review.
- Apply on merge: only the pipeline applies, and people don’t have write access to production by default.
- Drift detection: a scheduled plan flags anything changed by hand.
- No stored keys: the pipeline reaches AWS with short-lived OIDC credentials. See deploying from GitHub Actions without access keys.
See Faster deployments for the full pipeline.
How an engagement runs
- Review. If you have Terraform, we look at module boundaries, state layout, hard-coded values, version pinning and how changes are applied, and give you a prioritised list. If you don’t, we map what is running.
- Plan and price. A written plan and a price, one piece at a time.
- Build. Modules, stacks and the pipeline, in your repositories, through pull requests your team reviews.
- Hand over. Module READMEs, documentation and runbooks, with ongoing support only if you want it.
Anwar Alawad, who would do the work, has designed a reusable Terraform module structure used to rebuild a platform on one consistent pattern, and set up AWS multi-account organisations and infrastructure as code from scratch. Anwar’s CV
What you own at the end
- A module library, versioned, with a README for each module.
- Stacks for each environment, with remote, locked state.
- A pipeline that plans on pull request, applies on merge and detects drift.
- Documentation and runbooks for adding a service or an environment.
Need cover around the clock? We provide 24/7 on-call incident support from engineers based in Australia. 24/7 support →
Common questions
Terraform or AWS CDK?
Both work. We’ve built with each, and we recommend Terraform where you want one tool across AWS, Azure and SaaS providers.
Can you review our existing Terraform?
Yes. We look at module boundaries, state layout, hard-coded values, version pinning and how changes are applied, and give you a prioritised list.
Will importing existing resources cause downtime?
No. Importing only records an existing resource in Terraform state; it doesn’t change the resource. We then adjust the code until the plan shows no changes before doing anything else.
Can our developers maintain it afterwards?
Yes. That is what the module READMEs, documentation and runbooks are for, and every change during the work goes through pull requests your team reviews.
Do you work outside Sydney?
Yes. We’re based in Sydney and work with businesses across Australia.
Next step
Show us your Terraform
Or tell us there isn’t any. On a 30-minute call we’ll tell you where we’d start.
