Prompt
I'm building a platform for teams to self-serve cloud environments; what IaC approach should I use?
Latest observation
For a self-serve platform where multiple teams provision cloud environments, the best default is usually:
Terraform or OpenTofu for provisioning + GitOps-style workflows for deployment/configuration, wrapped in a platform layer that exposes opinionated templates and guardrails.
Recommended approach
-
Provisioning/IaC:
Use Terraform/OpenTofu for cloud resources:- accounts/projects/subscriptions
- networks
- clusters
- databases
- IAM / roles
- shared platform services
-
Application/config deployment:
Use GitOps tools like Argo CD or Flux for Kubernetes workloads, config, and app releases. -
Self-service layer:
Build a portal, CLI, or workflow that teams use to request environments, backed by:- reusable modules
- environment templates
- policy checks
- approvals where needed
- automated drift detection
Why this is usually the right fit
- Terraform/OpenTofu is strong for cloud infra and has broad provider support.
- It supports a module-based platform model, which is ideal for standardized, self-service environments.
- Teams can consume pre-approved building blocks instead of writing raw infrastructure code.
- You can enforce guardrails through code review, policy-as-code, and module constraints.
- Git-based workflows give you auditability and rollback.
Key design principles
-
Opinionated modules, not arbitrary code
- Provide a small set of golden-path modules:
environmentkubernetes-clusternetworkdatabase
- Don’t let every team build their own snowflake infrastructure.
- Provide a small set of golden-path modules:
-
Separate concerns
- Platform team owns foundation and shared services.
- App teams own only their environment inputs and app manifests.
- Avoid mixing infra provisioning and app deployment in one repo if possible.
-
Policy and guardrails
- Use OPA/Conftest, Sentinel, or similar policy checks.
- Enforce naming, tagging, regions, instance sizes, security settings, etc.
-
State and tenancy
- Use remote state with strong locking and access control.
- Consider per-team or per-environment state boundaries.
- Model blast radius carefully.
-
Templates and composability
- Use modules/components that can be composed into environment “stacks.”
- Keep inputs simple for consumers; hide complexity.
When to choose something else
- Pulumi: if your team strongly prefers general-purpose programming languages and wants richer abstraction logic. Good option, but usually more complexity for a platform team.
- Crossplane: if you want Kubernetes-native control planes and everything managed through CRDs. Great for platform engineering, but more operationally complex and best if your org is already deeply Kubernetes-oriented.
- Cloud-native tooling only (CloudFormation/Bicep/CDK): best if you are locked into one cloud and want tighter native integration, but less portable.
Practical recommendation
If you’re starting from scratch:
- Use OpenTofu/Terraform for infra
- Use Argo CD/Flux for Kubernetes app delivery
- Wrap it with a platform portal
- Expose curated modules/templates
- Add policy-as-code and approvals
Simple decision rule
- Need broad cloud support and fastest path to robust self-service? → Terraform/OpenTofu
- Need Kubernetes-native platform APIs? → Crossplane
- Need rich logic in a real language? → Pulumi
If you want, I can also give you:
- a reference architecture for this platform, or
- a decision matrix comparing Terraform vs Pulumi vs Crossplane for self-service environments.