A new team needs an AWS environment: an account ready for Terraform, a Kubernetes cluster, DNS, GitOps, monitoring and the same security baseline everyone else has. In a company with one DevOps team this happens a few times a year, and someone sits down and builds it. In a company with many domain teams it happens all the time, and “a few days of work” turns into a queue.
This is the story of a platform our lead engineer, Mher Poghosyan, built at an online gaming and crypto group with 70+ DevOps engineers. Before it, a new team’s AWS environment took 2–3 days. After it, 30 minutes. He designed and built it single-handedly in under 4 months, with Terraform, Terragrunt and GitLab CI.
This article is about what changed and why. Two companion articles go into the details: the repository layout and contracts between stacks, and keyless Terraform CI on GitLab.
Where the 2–3 days go
Terraform is rarely the slow part. The days go to everything around it, and the list looks much the same in most companies we see:
- Manual steps before the first apply. A fresh account has to be prepared before Terraform can run in it: state storage, roles for CI, baseline settings. Each step is small, done by hand, and done slightly differently each time.
- Copy-paste instead of reuse. The fastest way to build environment number five is to copy environment number four and edit it. The copy brings along old decisions, hard-coded names and fixes that never reached the other copies. After a year no two environments are alike, and a fix in one becomes a project for all the others.
- Tickets between teams. DNS belongs to one team, access to another, the cluster to a third. Each handoff is a ticket, and each ticket waits in someone’s queue.
- Knowledge in people’s heads. The right order of steps lives with whoever did it last time. When they are busy, the new team waits.
None of this is hard. Together it turns a new environment into a multi-day task that only a few people can do, and it makes every environment a little different, which costs more later than it did on day one.
The idea: an environment is a product
The answer was not a faster script. It was to treat “an AWS environment for a team” as a product: something with versions, a documented interface and an owner. The platform splits it into three layers that change at different speeds.

- Versioned Terraform modules. Small building blocks that know nothing about any team. Every change is released under a semver tag.
- Reusable stacks with explicit contracts. A stack combines modules into something a team actually needs: account bootstrap, EKS, DNS, self-managed Argo CD, monitoring and security. Each stack declares what it takes as input and what it promises as output, and other stacks may rely only on those outputs.
- Per-domain live repositories. Each domain team has its own repository for its environments. It holds values and pinned versions, not copied Terraform code.
The split is about ownership as much as code. The platform owns modules and stacks and releases them. Teams own their live repositories and decide when to upgrade. Because nobody copies code, there is nothing to drift apart, and a fix in a stack reaches every team as a new version instead of a dozen manual edits.
What each stack takes off the checklist
Every stack replaces a part of the old manual list. What exactly goes inside depends on the company, but the job of each one is general:
- Account bootstrap prepares a fresh AWS account so the other stacks can run in it, for example the IAM roles that CI uses. This is where most of the old console work used to be.
- EKS creates the cluster. Karpenter is part of the stack, with node interruption handling through an SQS queue: AWS sends interruption and maintenance events to the queue, and Karpenter drains the affected node so pods move before it goes away. Every team gets node autoscaling that behaves the same way.
- DNS gives the team its own names, so a new service does not need a ticket to get a hostname.
- Self-managed Argo CD runs inside the team’s cluster. From the moment the environment exists, applications are delivered from Git.
- Monitoring is there from the first minute, not added after the first incident. Production EKS costs are broken down by node pool in Grafana, so a team can see what its capacity costs.
- Security is the baseline every environment gets by default, not on request.
Contracts are what make these stacks composable. An EKS stack, for example, would publish the cluster name, endpoint and certificate, and an Argo CD stack would consume exactly those outputs and nothing else. The layout article shows what that looks like in Terragrunt code.
What a new team does now
The path for a new team is short and the same every time:
- Read the Quick Start.
- Describe the environment in its live repository: names, sizes, which stacks and which version.
- Open a merge request. CI runs a plan, and reviewers see exactly what will be created.
- Merge. CI applies from main.
A simplified example of what such a merge request adds:
# a domain team's live repository: prod/terragrunt.stack.hcl (simplified)
unit "eks" {
source = "git::https://gitlab.example.com/platform/stacks.git//units/eks?ref=v3.2.1"
path = "eks"
values = {
cluster_name = "payments-prod"
}
}
unit "argocd" {
source = "git::https://gitlab.example.com/platform/stacks.git//units/argocd?ref=v3.2.1"
path = "argocd"
values = {
hostname = "argocd.payments.example.com"
}
}
There is no Terraform code to copy, only values and a version. Versions are semver releases, pinned in production, and CI rejects module references that float, such as a branch name. Access is keyless: plan runs with a read-only role in every merge request, and apply runs with an admin role and only from main. The CI article shows how that works.
In a flow like this, most of the time is the cloud creating resources. The human part is filling in a few values and reading a plan.
Documentation is part of the platform
A platform without documentation is still a ticket queue, just a different one: instead of asking for an environment, people ask how to use the platform. So the platform came with a documentation site built on Docusaurus, in English and Russian, with a Quick Start. Two languages, because a Quick Start is only quick if people read it comfortably.
A Quick Start that works has a few properties:
- One path from top to bottom, with no “depending on your case” branches. Edge cases go to reference pages.
- Every command can be copied as is.
- It ends with something that works, not with “now configure the rest”.
Next to it, every stack needs a reference page: inputs, outputs, and what changed in each version. That page is the written half of the contract.
What keeps a platform like this small
A platform that one engineer can build in under 4 months has to stay small. A few principles help with that:
- Cover the common case. Stacks are for what most teams need. A team with an unusual requirement can add its own units next to the platform ones in its live repository, without forking the platform.
- Contracts before code. Decide what a stack takes and returns before writing it. Narrow outputs are easy to keep stable; wide ones break someone with every release.
- Version from day one. Releases and pinned versions are cheap to start with and expensive to introduce once many teams depend on
main. - One way to apply. If changes reach AWS only through a merge request and CI, the code stays the source of truth, and there is no drift to clean up later.
Is it worth it for you?
A platform like this pays off when:
- more than one team needs environments, and new ones appear several times a year;
- environments were copied from each other and have drifted apart;
- creating an environment takes tickets to more than one team;
- only one or two people know how to do it.
If you have one team and two environments, plain Terraform with a few versioned modules is enough. The layout article ends with where that line is.
The 30 minutes did not come from making Terraform faster. They came from removing the reasons a person had to be involved: copies became versions, tickets became contracts, and knowledge in people’s heads became a Quick Start.
