Skip to content

Synthesis and Output Layout

Synthesis exports your Netherframe object graph as configuration for an existing Terraform/OpenTofu workflow. For new projects, use hybrid execution to plan and apply the Python app directly.

What nf synth Produces

For compatibility exports, Netherframe writes one output tree per app and one directory per stack under that app.

Typical layout:

.nf.out/
  my-app/
    network/
      nf.tf.json
      plan.sh
      apply.sh
      destroy.sh
    storage/
      nf.tf.json
      plan.sh
      apply.sh
      destroy.sh

Why Synthesis Matters

Synthesis gives teams:

  • inspectable artifacts
  • a stable bridge into Terraform-oriented workflows
  • a clean separation between authoring and execution
  • a place to understand what Netherframe resolved from the Python source

What Gets Resolved During Synthesis

During synthesis, Netherframe can:

  • serialize resources, providers, outputs, and variables
  • resolve runtime-aware values where appropriate
  • process cross-stack references
  • generate phased stack artifacts when cycles require them
  • emit orchestration scripts alongside stack output

Output Format

The direct app.synth(...) API supports:

  • json
  • hcl

nf synth uses Terraform JSON for its compatibility exports.

HCL writes nested blocks (versioning { ... }) and attributes (tags = { ... }) differently, and only the provider schema says which an argument is. Generated provider classes carry their schema's block types, so HCL follows the schema for them. Terraform also takes an attribute of list or set of object type as blocks (aws_security_group's ingress), and HCL writes its objects that way, so each can leave out what it doesn't set; an empty list stays ingress = []. A construct without a schema (Resource(nf_type=...), a hand-written class) is written by the shape of its values: a list of objects is repeated blocks, an object that holds objects is a block, and any other value is an attribute. JSON output needs no schema.