Prompt
Do I need declarative infrastructure if I can script provisioning?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
Not strictly, but declarative infrastructure usually gives you important benefits that scripting alone doesn’t.
If you script provisioning, you get:
- Full flexibility
- Easy one-off automation
- Direct control over sequence and logic
But declarative infrastructure adds:
- Idempotency: apply the same config repeatedly without creating drift or duplicates
- State awareness: tools know what exists vs. what should exist
- Safer updates: easier to detect and reconcile changes
- Reviewability: you can see the desired end state, not just the steps
- Repeatability: more reliable across environments and teams
The tradeoff
- Scripting is good for procedural workflows and custom logic.
- Declarative is better for managing long-lived infrastructure at scale.
Practical rule
- Use scripts for:
- bootstrapping
- glue code
- migrations
- one-off operational tasks
- Use declarative tools for:
- servers, networks, IAM, Kubernetes, databases
- anything you want to keep consistent over time
Bottom line
You can provision with scripts, but if you want infrastructure that is easier to audit, reproduce, and maintain, declarative infrastructure is usually worth it.
If you want, I can also give you a decision matrix for when to use scripting vs Terraform/CloudFormation/Ansible-style declarative tools.