TExcelTAD
Home › Platform Engineering: Internal Developer Platforms › Terraform, Crossplane or Both

Terraform, Crossplane or Both

Platform teams argue about this more than it deserves. Both tools can create the same database; what differs is who triggers changes, when drift is corrected, and what the interface to developers looks like. Most mature platforms end up using both, each where it's strongest.

Side by side

Terraform / OpenTofu Crossplane
Model a CLI that plans and applies a configuration when someone runs it controllers that reconcile continuously
State a state file in a backend (S3, HCP Terraform) the Kubernetes API (etcd) holds desired state; the cloud holds actual state
Drift found at the next plan; fixed at the next apply corrected within the poll interval
Interface for developers module blocks in HCL, a PR to an infrastructure repo, or a wrapper (Atlantis, HCP Terraform, a portal action) Kubernetes objects of your own kinds; works with kubectl, Argo CD, Kyverno, RBAC
Abstraction modules (inputs → resources) XRDs + Compositions (your API → resources), versioned as packages
Provider ecosystem the largest; almost every API has a provider large for the big clouds (many generated from Terraform providers); thinner for niche services
Plan preview terraform plan before every change crossplane render for compositions; changes apply as soon as they're accepted
Needs a runner with credentials a Kubernetes cluster running Crossplane, its providers and functions (itself a production system)
Failure modes forgotten applies, stale state, locks a broken control plane cluster blocks all infrastructure changes; reconcile storms against API rate limits

A model: what happens over a month

Picture the same database fleet managed both ways. Changes arrive from Git (wanted) and from the console (drift). With Terraform, a drift lives until the next pipeline run for that root; with Crossplane, until the next reconcile:

python · try it yourself
# events: (day, kind, database)
events = [(2, "drift", "orders"), (5, "git", "orders"), (9, "drift", "billing"),
          (17, "drift", "orders"), (24, "git", "billing"), (27, "drift", "links")]
pipeline_runs = {"orders": [5, 12, 19, 26], "billing": [24], "links": []}  # applies happen on merges + weekly job for orders
reconcile_hours = 1   # providers re-check every few minutes by default; count a full hour to be generous

def drift_hours_terraform():
    total = 0
    for day, kind, db in events:
        if kind != "drift":
            continue
        later = [d for d in pipeline_runs[db] if d >= day]
        fixed = later[0] if later else 31
        total += (fixed - day) * 24
        print(f"  drift on {db:8} day {day:2} -> " + (f"fixed day {fixed}" if later else "still drifted at month end"))
    return total

print("Terraform (apply on merge, plus a weekly job for orders):")
tf = drift_hours_terraform()
cp = sum(reconcile_hours for _, kind, _ in events if kind == "drift")
print(f"total hours in drift: Terraform {tf}, Crossplane {cp}")
Terraform (apply on merge, plus a weekly job for orders):
  drift on orders   day  2 -> fixed day 5
  drift on billing  day  9 -> fixed day 24
  drift on orders   day 17 -> fixed day 19
  drift on links    day 27 -> still drifted at month end
total hours in drift: Terraform 576, Crossplane 4

The model exaggerates in Crossplane's favour (a scheduled terraform plan with drift alerts closes much of the gap, and Terraform shows you the plan before it changes anything), but it captures the real difference: continuous reconciliation versus change-time application.

Common combinations

  1. Terraform for the foundation, Crossplane for team self-service. Accounts, VPCs, clusters and the Crossplane installation itself are created by Terraform owned by the platform team (changed rarely, reviewed carefully, with plans). Team-facing resources (databases, buckets, queues) are Crossplane XRs in team namespaces.
  2. Terraform everywhere, with a self-service front. Teams submit requests (a PR or a portal form), and a pipeline runs a catalog module per request (Self-Service Infrastructure). Simple to run; drift handling is scheduled plans.
  3. Crossplane calling Terraform. The Terraform provider for Crossplane (provider-terraform) runs HCL inside a managed resource: a migration path for existing modules behind a Kubernetes API.
  4. Operators for specific services. CloudNativePG, Strimzi (Kafka) or a cloud's own operator (AWS Controllers for Kubernetes, Google Config Connector, Azure Service Operator) can fill the same role for one service family, often composed by Crossplane.

How to choose

If… Lean towards
your teams already deploy everything through Argo CD and want one way of working Crossplane (resources live next to the apps, same GitOps flow)
infrastructure changes need a reviewed plan, and drift is rare Terraform
you have no Kubernetes expertise in the platform team Terraform; Crossplane needs a well-run control-plane cluster
you need a provider for a niche SaaS Terraform (or provider-terraform)
you want developers to use their namespace's RBAC and policies for infrastructure Crossplane

Whatever you pick, keep the request format independent of it (kind: Database, size: s), so the decision stays reversible.

Test yourself

What is the core behavioural difference between Terraform and Crossplane?

  1. Language
  2. Terraform applies when someone runs it; Crossplane reconciles continuously
  3. Only Crossplane supports AWS
  4. Only Terraform has modules

In the common 'both' setup, what does Terraform usually manage?

  1. Every team database
  2. The foundation: accounts, networks, clusters and the Crossplane installation itself
  3. Nothing
  4. Only DNS