Skip to content

Configure a scan with nimzo.yaml

When you connect a repository, Nimzo scans it to find your stacks and their environments. Add a nimzo.yaml file to a folder to change what the scan finds there: give the stack a name, list its environments yourself, or skip the folder.

The file can also be named nimzo.yml: both names work the same way. A folder with both reads nimzo.yaml and ignores nimzo.yml.

A nimzo.yaml applies to the folder it sits in. Each folder can have its own. Nimzo reads them each time it scans the repository. To scan a connected repository again after you change a nimzo.yaml, go to Stacks, select Add a stack, and pick the repository.

Nimzo publishes a schema of nimzo.yaml at https://staging.nimzo.dev/schemas/nimzo.schema.json. Point your editor at it, and it completes field names, describes each field as you type, and underlines a misspelled field or a wrong value before you push.

  1. Install the YAML extension by Red Hat.
  2. Add this to .vscode/settings.json at the root of the repository:
.vscode/settings.json
{
"yaml.schemas": {
"https://staging.nimzo.dev/schemas/nimzo.schema.json": ["**/nimzo.yaml", "**/nimzo.yml"]
}
}

Nimzo finds most stacks on its own, from their Terraform, OpenTofu or Terragrunt code. To make a folder a stack even when Nimzo does not recognize it, add an empty nimzo.yaml to it.

A stack takes the name of its folder. A stack at the root of the repository takes the name of the repository. To choose another name, set name:

network/nimzo.yaml
name: Core network

Nimzo finds a stack’s environments from its variables files. Each .tfvars or .tfvars.json file in the stack’s folder, or below it, is one environment, named after the file: envs/prod.tfvars becomes prod.

To list the environments yourself, set environments. The list replaces the environments Nimzo would find, so include every environment the stack has:

network/nimzo.yaml
environments:
- file: envs/prod.tfvars
name: Production
kind: production
- file: envs/staging.tfvars

Each environment has these fields:

Field Required What it does
file Yes The environment’s variables file, relative to the folder of the nimzo.yaml. It must be in that folder or below it.
name No The environment’s name. Without it, the environment is named after its file: prod for prod.tfvars.
kind No One of your organization’s environments, written exactly as in Settings › General › Environments. Without it, Nimzo picks one from the file’s path.

A kind that matches none of your organization’s environments puts the environment in your default environment, the one marked Default in the settings.

Environments apply to Terraform and OpenTofu stacks. Terragrunt stacks ignore them.

To keep a folder out of your stacks, set skip. Nimzo still scans the folders below it:

examples/nimzo.yaml
skip: true

To keep a folder and every folder below it out of your stacks, set skipRecursive:

sandbox/nimzo.yaml
skipRecursive: true

A skipRecursive in the nimzo.yaml at the root of the repository skips the whole repository.

Field Type Default What it does
name Text The folder’s name The name of the stack.
environments List Found from the code The environments of the stack. See above.
skip Boolean false When true, this folder is not a stack. The folders below it still can be.
skipRecursive Boolean false When true, neither this folder nor any folder below it is a stack.

A nimzo.yaml seems to have no effect. Nimzo ignores a file it cannot read: one that is not valid YAML, or that has a field not listed on this page. Check the spelling of each field, including capitals: skipRecursive, not skip_recursive. The rest of the scan runs as if the file were not there. An editor set up with the schema points out these mistakes as you type.

An environment is missing. Nimzo leaves out an environment whose file does not exist, or sits outside the folder of the nimzo.yaml. Check the path from that folder.