Skip to content

Configuration

The Watt TF blueprint file (typically blueprint.yaml) is the core definition of your infrastructure transformations. It follows a declarative structure that maps input data to Terraform resources.

Top Level Structure

KeyTypeDescription
variablesmapA map of variables for use in interpolations and CEL expressions
pluginsarrayA list of external plugins to hook into the transformation lifecycle.
transformarrayThe sequence of transformation rules applied to your resources.
includearrayA list of other blueprint files to include and process as part of this blueprint.

The transform Block

KeyTypeDescription
targetstringThe path where the value will be placed (e.g., resource.aws_s3_bucket.main).
valueanyThe payload or configuration data to set at the target.
ifstringAn optional CEL expression that determines if this block should execute.
for_eachstringAn optional CEL expression that iterates over a collection.

The plugins Block

KeyTypeDescription
namestringA unique identifier for the plugin.
versionstringThe version string of the plugin.
onstringThe lifecycle event: beforeTransform or afterTransform.
cmdstringThe base command to execute (e.g., python, node, ./script.sh).
argsarrayA list of arguments passed to the command (e.g., ["plugin.py"]).

Example Blueprint

yaml
plugins:
  - name: my-custom-plugin
    version: 1.0.0
    on: beforeTransform
    cmd: python
    args: ["plugin.py"]

include:
  - "another-blueprint.yaml"

transform:
  # Example of conditional resource creation
  - if: input.environment == "prod"
    target: resource.aws_instance.web
    value:
      instance_type: "t3.large"
      monitoring: true

  # Example of loop-based resource creation
  - for_each: input.subnets
    target: resource.aws_subnet.${item.name}
    value:
      cidr_block: "${item.cidr}"

You can find the full JSON schema for the blueprint configuration here: Blueprint Schema.

In case you want to learn more about the key concepts of Watt TF, check out the Core Concepts guide.