watt-tf

module
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT

README

Watt TF Mascot

Watt TF

Terraform without the HCL gymnastics.

CI Status Latest Release License

Documentation | Quick Start | Real-World Examples


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"
  }
}

2. The Platform Blueprint

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}"

3. Transform to Terraform JSON

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.


Community, Feedback & Support

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! 🚀

Directories

Path Synopsis
cmd
wtf command
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL