Skip to content

Look at a Terraform estate

behold draws a directory of .tf files the way it draws a chant project: roots as boxes, resources as cards, and the references the configuration actually states as edges.

Terminal window
npx @intentius/behold demo terraform-estate # the bundled estate
npx @intentius/behold serve ./infra # your own

No cloud account, no Docker, no terraform binary.

This is the posture rather than an implementation detail. @intentius/chant-lexicon-terraform reads the HCL an estate already has and emits one entity per block, so a Terraform estate is a chant project whose only lexicon is a reader, and chant graph serves it like any other. behold ships no HCL parser and never has.

The lexicon and the @cdktn/hcl2json wasm blob underneath it are optional peers: declared in behold’s package.json, never installed by it, probed when you serve, and refused with one install line and where behold looked.

Terminal window
npm install --no-save @intentius/chant-lexicon-terraform @cdktn/hcl2json

That keeps a ~1.8 MB parser out of the install of everyone who serves an ordinary chant project.

Roots are discovered, and the skips are reported

Section titled “Roots are discovered, and the skips are reported”

A root is a directory with a .tf declaring a line-start terraform { or provider " block beside a resource, data or module block. A regex probe at depth, never a parse.

Two exclusions stand beside it, and both are named in the graph’s note with their reason:

  • a directory under a modules/ segment is a called module, and the roots that call it draw its blocks already;
  • a directory with nothing to draw, such as a lone backend fragment, is reported rather than drawn as an empty box.

The probe alone is not enough, and the bundled estate is built to show why: the shared module’s versions.tf is byte-for-byte a root’s. Nothing in the file says which is which. Water park’s real estate is what refuted the first version of this rule.

Measured on a real estate: 247 nodes for 43 resources, four fifths of it not infrastructure.

zoom blocks drawn why
default (detail 0-2) resource, data, module the estate: what is declared, what it reads, what it composes
attributes (detail 3) + output, variable its interface: real, and a second question
never terraform, provider, locals settings, not estate

Nothing is dropped silently. The status line says what is not drawn and where to see it.

Edges arrive from chant or not at all.

A module call expands into its own contents, with the reference edges the lexicon resolves from the HCL. Those are real: one block names another.

A cross-root read is different, and behold draws nothing for it. In the bundled estate platform declares a KMS key and envs/prod reads it back:

data "aws_kms_key" "estate" {
key_id = "alias/${var.name}-estate"
}

Both ends carry the same unresolved ${var.name} interpolation. Matching them would be a coincidence of variable naming rather than a relationship either root states, so the data source card says what it reads and no edge is drawn. That was measured on a real estate before it was refused.

behold serve <terraform-dir> reads source. There is no --env, no drift colour, and no overlay: behold strips live, overlay and env for a Terraform member, because a reader lexicon would be asking chant to observe entities it never applied.

What the cloud actually holds is a different question with two other answers here:

  • a choudoufu estate reads ownership from markers on the live resources, and a green card there means this is ours;
  • a committed Op observes whatever its own lexicon observes.

Painting a Terraform estate green would be claiming an observation behold never made.

Both involve Terraform and they answer different questions.

This asks what is in your Terraform: draw it, box it by root, tell the roots from the modules.

The carve lens asks what it would cost to leave: chant carve advise ranks each resource by peelability, and behold carve draws that ranking with the score arithmetic behind each card.

An estate being drawn here is not being migrated, and carries no score.