Prompt
What should I use for infrastructure as code if I need compliance controls?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
If compliance controls are a priority, the best choice is usually Terraform with policy-as-code around it—often paired with HashiCorp Sentinel or OPA/Conftest for guardrails.
Good options, depending on your environment
1. Terraform
Best general-purpose IaC choice for compliance-heavy environments.
Why:
- Mature ecosystem
- Works across many clouds and services
- Strong support for:
- reviewable code
- versioning
- drift detection
- modules for standardization
- Easy to add compliance checks in CI/CD
Pair it with:
- OPA / Conftest for policy checks
- Sentinel if you use Terraform Cloud/Enterprise
- tfsec, Checkov, or Terrascan for static security/compliance scanning
2. Pulumi
Good if your team prefers using general-purpose programming languages.
Why:
- Policies can be written in code
- Good developer experience
- Supports policy as code via Pulumi CrossGuard
Tradeoff:
- Usually less common in regulated orgs than Terraform
- Slightly more complexity in governance/process than declarative-only IaC
3. Cloud-native tools
Examples:
- AWS CloudFormation
- Azure Bicep/ARM
- Google Cloud Deployment Manager (less common now)
Why:
- Tight integration with the cloud provider
- Easier to use provider-native compliance/governance features
Tradeoff:
- Less portable
- More fragmented if you use multiple clouds
What matters most for compliance
No matter the tool, compliance usually comes from the controls around it:
- Policy as code: enforce rules before deployment
- Approved modules/templates: standardize resources
- CI/CD approvals: change review and separation of duties
- State management and audit logs: who changed what and when
- Drift detection: catch out-of-band changes
- Secrets management: never store secrets in plain IaC
Practical recommendation
If you want a default answer:
- Use Terraform
- Add OPA/Conftest or Checkov/tfsec
- Use Sentinel if you’re on Terraform Cloud/Enterprise
- Build a library of approved modules
- Enforce deployment through CI/CD with approvals and audit trails
If you tell me which cloud you’re on and what compliance framework you care about, I can recommend a more specific stack.