Prompt
Terraform vs Crossplane for reusable infrastructure
Latest observation
Terraform and Crossplane can both be used for reusable infrastructure, but they optimize for different operating models.
Short version
- Terraform is best when you want a platform team or infra team to define reusable infrastructure modules and apply them centrally.
- Crossplane is best when you want Kubernetes-native self-service for developers, with infrastructure exposed as custom resources and continuously reconciled.
If your goal is simply “make infrastructure reusable,” Terraform is usually the faster, simpler choice.
If your goal is “let app teams request infrastructure declaratively through Kubernetes and enforce policies continuously,” Crossplane is often the better fit.
Terraform for reusable infrastructure
How it works
- You write modules for common patterns: VPCs, EKS clusters, databases, IAM roles, etc.
- Teams consume those modules with inputs.
- Terraform manages the desired state by applying plans.
Strengths
- Mature ecosystem and large provider support.
- Simple mental model for most infra engineers.
- Good for:
- standardized modules
- multi-cloud and SaaS resources
- controlled change management
- mature CI/CD workflows
- Easier to start with if your org already uses Terraform.
Tradeoffs
- Reuse is usually at the module level, not as a native API.
- Self-service is possible, but typically through wrappers, pipelines, or portals.
- State management and workflow discipline are important.
- Not continuously reconciling by default; drift handling depends on your process.
Best when
- Infra team owns provisioning.
- You want reusable building blocks, not a Kubernetes-style control plane.
- You need broad provider coverage.
- You want predictable infrastructure release workflows.
Crossplane for reusable infrastructure
How it works
- You define infrastructure abstractions as Custom Resources / Composite Resources.
- Users request them via Kubernetes manifests, GitOps, or APIs.
- Crossplane continuously reconciles actual state to desired state.
Strengths
- Very good for platform engineering and internal developer platforms.
- Lets you create high-level abstractions like:
PostgresInstanceBackendServicePrivateNetwork
- Supports policy, composition, and control in a Kubernetes-native way.
- Continuous reconciliation is a strong fit for declarative platform management.
Tradeoffs
- More conceptual overhead than Terraform.
- Requires comfort with Kubernetes APIs, CRDs, compositions, and reconciliation.
- Provider ecosystem and ergonomics can be less straightforward than Terraform in some cases.
- Debugging and operational maturity may take more effort.
Best when
- Your platform is already Kubernetes-centric.
- You want app teams to provision infra like they request apps in Kubernetes.
- You want API-driven, opinionated self-service with guardrails.
- You want to expose infrastructure through custom abstractions rather than raw resource modules.
Key difference for “reusable infrastructure”
Terraform reuse = modules
You define reusable templates and call them with parameters.
Example:
module "postgres" { ... }
This is great for standardization, but consumers still interact with Terraform.
Crossplane reuse = platform APIs
You define reusable infrastructure products as Kubernetes resources.
Example:
apiVersion: platform.example.org/v1alpha1kind: PostgresInstance
This is better if you want consumers to treat infrastructure like an internal API.
Comparison table
| Area | Terraform | Crossplane |
|---|---|---|
| Primary abstraction | Modules | Custom resources / compositions |
| Workflow | Plan/apply | Reconciliation |
| Best audience | Infra/platform engineers | Platform teams + app teams in Kubernetes environments |
| Reuse style | Code reuse via modules | Product/API reuse via abstractions |
| Drift handling | Via re-apply/process | Continuous reconciliation |
| Learning curve | Lower | Higher |
| Ecosystem | Very large | Smaller, Kubernetes-oriented |
| Self-service | Possible, but indirect | Native fit |
| Multi-cloud/SaaS | Excellent | Good, but depends on provider support |
| GitOps fit | Good | Excellent |
Practical guidance
Choose Terraform if:
- You need reusable infra quickly.
- Your team is already comfortable with Terraform.
- You want a broad, proven provider ecosystem.
- You do not want to build a Kubernetes control plane.
Choose Crossplane if:
- You are building a platform for developers.
- Kubernetes is already your operational hub.
- You want infra as an internal product/API.
- You want stronger declarative self-service and continuous reconciliation.
Consider both if:
Many orgs use:
- Terraform for foundational infrastructure and resources outside Kubernetes
- Crossplane for higher-level self-service platform abstractions
That can be a very effective split:
- Terraform provisions clusters, networking, accounts, org-level foundations
- Crossplane exposes developer-facing services like databases, buckets, queues, and app environments
Rule of thumb
If you ask:
- “How do we make infra reusable for engineers?” → Terraform
- “How do we make infra consumable as a platform product?” → Crossplane
If you want, I can also give you:
- a decision matrix for your org,
- a sample architecture using both, or
- how reusable patterns differ in Terraform modules vs Crossplane compositions.
Brands