Watt TF is a declarative blueprint engine that compiles raw data (JSON/YAML) into clean, standard Terraform JSON.
Instead of forcing your developers to fight complex HCL syntax, or asking your platform team to maintain brittle custom templating scripts, Platform Engineers define reusable blueprints using Google CEL (Common Expression Language), while Developers just supply simple data.
Why Watt TF? ⚡
- No HCL Gymnastics: Stop writing unreadable nested
for/for_each loops, dynamic blocks, and ternary string-splitting in Terraform.
- 100% Type-Safe JSON: No text-replacement hacks (like Jinja2 or Go templates) that generate broken syntax. We compile directly to Terraform JSON.
- Platform-Engineering Native: Build clean, opinionated interfaces for your developers to deploy apps without exposing them to the raw horror of naked infrastructure code.
Quick Look: How it Works
1. Simple Data ( JSON or YAML )
Developers supply only what they care about:
{
"service": {
"name": "ms-orders",
},
"app": {
"image": "ghcr.io/acme/ms-orders",
"version": "v1.0.0",
"port": 8080
},
"database": {
"type": "postgres",
"version": "14",
"size": "20Gi"
}
}
The platform team defines how that data translates to Terraform modules, using powerful embedded Google CEL logic:
transform:
- target: module.app.${input.service.name}
value:
source: "git::https://git.acme.com/terraform-modules/app.git?ref=v1.0.0"
version: "${input.app.version}"
port: "${input.app.port}"
min_replicas: ${has(input.app.min_replicas) ? optional(input.app.min_replicas) : optional.none()}
max_replicas: ${has(input.app.max_replicas) ? optional(input.app.max_replicas) : optional.none()}
ram: ${env.ENVIRONMENT == "production" ? "2Gi" : "512Mi"}
database: ${has(input.database) ? "module.database.${input.service.name}.dsn" : optional.none()}
- target: module.database.${input.service.name}
if: has(input.database)
value:
source: "git::https://git.acme.com/terraform-modules/database.git?ref=v1.0.0"
type: "${input.database.type}"
version: "${input.database.version}"
size: "${input.database.size}"
wtf build --input input.json --blueprint blueprint.yaml --output terraform.json
Expected Result
{
"module": {
"app": {
"ms-orders": {
"source": "git::https://git.acme.com/terraform-modules/app.git?ref=v1.0.0",
"version": "v1.0.0",
"port": 8080,
"min_replicas": null,
"max_replicas": null,
"ram": "512Mi",
"database": "module.database.ms-orders.dsn"
}
},
"database": {
"ms-orders": {
"source": "git::https://git.acme.com/terraform-modules/database.git?ref=v1.0.0",
"type": "postgres",
"version": "14",
"size": "20Gi"
}
}
}
}
Getting Started
The fastest way to install and try out Watt TF locally:
curl -sSL https://raw.githubusercontent.com/devsebastianops/watt-tf/main/install.sh | bash
wtf --help
For more installation methods and the full documentation check out watt-tf.dev.
Examples
All configurations in the /examples directory are actively tested in our E2E pipeline on every commit.
You can use these to understand how Watt TF works, or as a starting point for your own blueprints.
[!TIP]
Have a look into our real world examples at watt-tf.dev/examples/overview.
We ❤️ contributions! Whether you found a bug, want to propose a new feature, or improve the codebase:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by devsebastianops. Happy Terraforming! 🚀