One infrastructure platform for the whole company
Run every team's Terraform and OpenTofu on one platform, with access from your identity provider and every workspace attributed to a team and a cost centre.
One platform for the whole company runs into the same few questions. Who can change which stacks, who gets paged when one breaks, and which team or cost centre is using what. This guide sets InfraDots up so each question has one answer, and so most of the answers live in Terraform.
You need an organization, a connected VCS, and an InfraDots API token for the Terraform provider.
1. One organization, a workspace per stack and environment
Start with one organization for the company. A workspace is one root module in one environment, such as
payments-prod or data-lake-staging. Separate organizations only make sense when environments must not
share administrators at all. They also split everything below: teams, tags and Insights.
2. People come from your identity provider
Turn on single sign-on over SAML or OIDC, and verify your email domain by DNS. Then:
- Enforce SSO, so password, Google and GitHub sign-in stop working for your domain.
- Turn on Sync groups. Each IdP group becomes a team of the same name, and people join or leave those teams as their groups change, on every sign-in.
- Set a default team with read-only permissions, so a new joiner can see the platform without changing it.
A synced team starts with no permissions. You grant them in the next step.
3. Access per team, as code
Grant a team permissions on the workspaces it owns, and nothing on the rest. A permission with a
workspace_name covers that workspace only. One without it covers the whole organization.
resource "infradots_team" "payments" {
organization_name = "acme"
name = "payments" # the IdP group's name, so sync joins it
}
resource "infradots_permission" "payments_write" {
for_each = toset(["payments-prod", "payments-staging"])
organization_name = "acme"
team_id = infradots_team.payments.id
permission = "write_workspaces"
workspace_name = each.key
}
A team you create in Terraform with the IdP group's name is joined by sync rather than duplicated, and sync
never removes anyone from it. Make the platform team the organization's administrators with
organization_admin = true on its infradots_team. Sync never adds anyone to an administrators' team, so
list its people in members.
4. A tag convention on every workspace
Give every workspace the same three tags: who owns it, who pays for it, and which environment it is.
resource "infradots_workspace" "payments_prod" {
organization_name = "acme"
name = "payments-prod"
source = "https://github.com/acme/payments-infra"
branch = "main"
terraform_version = "1.5.7"
folder = "prod"
tags = {
team = "payments"
cost_center = "CC-410"
environment = "production"
}
}
InfraDots reads three of these keys on its own:
teamalso acceptsownerorsquad.environmentalso acceptsenv.cost_centeris yours. Any key works, includingdepartmentorbusiness_unit.
Keys match case-insensitively. Create workspaces through Terraform or a module, so the tags can't be left off. A workspace without them shows up as untagged in step 7.
5. The same tags on your cloud resources
InfraDots doesn't see your cloud bill. To split spend the same way, put the same keys on every resource through the provider's default tags. Pass the values in as workspace variables, so the code is the same in every environment.
provider "aws" {
default_tags {
tags = {
team = var.team
cost_center = var.cost_center
environment = var.environment
}
}
}
resource "infradots_variable" "cost_center" {
organization_name = "acme"
workspace = "payments-prod"
key = "cost_center"
value = "CC-410"
}
On AWS, activate team and cost_center as cost allocation tags in the Billing console. They then appear
in Cost Explorer and the Cost and Usage Report. On Google Cloud the provider setting is default_labels.
6. Alerts go to the team that owns the change
Connect Slack or Microsoft Teams under Integrations. Use environment channels to
send production events to an on-call channel and everything else to a shared one. Then add a channel per
workspace to each team's own workspaces. A workspace's setting wins over the organization's.
7. See each team's share
Open Insights → Attribution and group by team or cost_center. Each group shows, for the last 7, 30
or 90 days:
- applies and the apply success rate
- deploys per week and resources changed
- drift events and managed resources
- agent runs, meaning reviews, implementations and remediations
Expand a group to see its workspaces. Untagged lists the ones that skipped step 4.
The tag and the window are in the page's address, so a team lead can bookmark their own view. The same data
is at GET /api/organizations/{organization}/insights/attribution/?group_by=cost_center for a
monthly report. See Workspaces → Attribution.
8. Shared settings once, not per team
Put what every workspace needs in a variable set marked global, such as the region or a registry token. Assign other sets to the workspaces that need them. Reviews follow the same pattern: reviewer guidance taught to the agent once applies to every team's pull requests.
What this doesn't cover
- Cloud cost. InfraDots attributes runs, changes, resources and agent runs. The money comes from your cloud's cost tools, split by the tags from step 5.
- Tag-based access. Permissions come from teams and workspaces. A tag doesn't grant anything.
