Prompt
What are the tradeoffs between Terraform modules and Crossplane compositions for team standards?
Latest observation
Terraform modules and Crossplane compositions both help teams create reusable, standardized infrastructure patterns, but they sit at different layers and optimize for different things.
Short version
- Terraform modules are best when you want reusable IaC building blocks inside a Terraform workflow.
- Crossplane compositions are best when you want to expose opinionated platform APIs to developers and let Kubernetes manage infrastructure continuously.
Main tradeoffs
1. Abstraction style
Terraform modules
- Package up HCL into reusable units.
- Consumers still work in Terraform terms: variables, outputs, providers, state.
- Good for teams that are already comfortable with Terraform.
Crossplane compositions
- Define higher-level abstractions as Kubernetes-native custom resources.
- Consumers request “a database” or “a service environment,” not a set of resources.
- Better if you want a platform API, not just reusable code.
Tradeoff:
Terraform modules standardize implementation; Crossplane compositions standardize the interface to the platform.
2. Enforcing standards
Terraform modules
- Standards are enforced when teams use the module.
- But teams can often bypass modules and write raw Terraform if permissions allow.
Crossplane compositions
- Standards can be enforced more centrally by exposing only approved composite resources.
- Better fit for strong guardrails and “golden path” offerings.
Tradeoff:
Crossplane usually gives stronger policy/control at the platform boundary; Terraform modules rely more on convention and process.
3. Day-2 operations and drift
Terraform modules
- Great for provisioning and planned changes.
- Less ideal for continuously reconciling resources after creation.
- Drift detection exists, but it’s not a continuous control loop in the same way.
Crossplane compositions
- Continuously reconciles desired vs actual state.
- Better for long-lived managed resources and self-healing behavior.
Tradeoff:
Terraform is excellent for declarative changes; Crossplane is stronger for ongoing reconciliation.
4. User experience for application teams
Terraform modules
- Developers need to understand Terraform inputs, outputs, and workflows.
- Usually consumed by infra/platform engineers more than app developers.
Crossplane compositions
- Can provide a simple Kubernetes-native API.
- App teams can request infrastructure with YAML or via GitOps workflows.
Tradeoff:
Crossplane can be more self-service for platform consumers, especially in Kubernetes-centric orgs.
5. Ecosystem and maturity
Terraform modules
- Very mature, huge ecosystem, broad provider support.
- Easier to find examples and operators with Terraform experience.
Crossplane compositions
- Strong Kubernetes-native model, but generally newer and smaller ecosystem.
- Some resource coverage and patterns may require more custom work.
Tradeoff:
Terraform is often lower risk and easier to adopt broadly; Crossplane can be more powerful for platform engineering but may require more maturity.
6. Operational complexity
Terraform modules
- Simpler mental model if you already use Terraform.
- State management is a key concern, but tooling is familiar.
Crossplane compositions
- Introduce Kubernetes CRDs, controllers, compositions, claims, and provider lifecycle.
- More moving parts, especially if you’re not already a Kubernetes-native shop.
Tradeoff:
Terraform is simpler to operate in traditional IaC environments; Crossplane adds platform power at the cost of more system complexity.
7. Composability
Terraform modules
- Modules can be composed, but nesting and interface design can get awkward.
- Reuse is good, but deep abstraction layers can become hard to maintain.
Crossplane compositions
- Designed specifically for composition into platform APIs.
- Strong fit for building a layered internal platform with multiple abstractions.
Tradeoff:
Crossplane is generally better suited to building a true internal platform architecture.
When to choose Terraform modules
Choose Terraform modules if:
- Your team already standardizes on Terraform.
- You want reusable patterns, not a new platform API.
- Most users are infra engineers.
- You need broad provider support and mature tooling.
- You want a relatively low-friction way to codify standards.
When to choose Crossplane compositions
Choose Crossplane if:
- You want Kubernetes-native self-service infrastructure.
- You want to offer platform APIs to developers.
- You need continuous reconciliation and stronger operational control.
- You’re building an internal developer platform.
- Your org is already deeply invested in Kubernetes/GitOps.
Common real-world pattern
Many teams use both:
- Terraform for foundational infrastructure and bootstrap work.
- Crossplane for ongoing platform abstractions and self-service provisioning.
- Or Terraform modules for platform engineering teams, and Crossplane compositions for app-team consumption.
Rule of thumb
- If your goal is reuse → Terraform modules.
- If your goal is standardized self-service platform APIs → Crossplane compositions.
- If your goal is continuous reconciliation and Kubernetes-native operations → Crossplane.
- If your goal is broad, established IaC workflows → Terraform.
If you want, I can also give you:
- a decision matrix,
- a side-by-side example of the same standard implemented in Terraform vs Crossplane, or
- guidance on how to combine them safely in one org.