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.
Set up your editor
Section titled “Set up your editor”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.
- Install the YAML extension by Red Hat.
- Add this to
.vscode/settings.jsonat the root of the repository:
{ "yaml.schemas": { "https://staging.nimzo.dev/schemas/nimzo.schema.json": ["**/nimzo.yaml", "**/nimzo.yml"] }}Zed ships with YAML support. Add this to .zed/settings.json at the root of the repository:
{ "lsp": { "yaml-language-server": { "settings": { "yaml": { "schemas": { "https://staging.nimzo.dev/schemas/nimzo.schema.json": ["**/nimzo.yaml", "**/nimzo.yml"] } } } } }}- Open Settings › Languages & Frameworks › Schemas and DTDs › JSON Schema Mappings.
- Select + to add a mapping, and give it a name such as
nimzo.yaml. - In Schema file or URL, paste
https://staging.nimzo.dev/schemas/nimzo.schema.json. - Select Add mapping, choose File name pattern, and type
nimzo.yaml. - Select Add mapping again, choose File name pattern, and type
nimzo.yml. - Select OK.
The same steps work in the other JetBrains IDEs, such as PyCharm or GoLand.
Mark a folder as a stack
Section titled “Mark a folder as a stack”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.
Name a stack
Section titled “Name a stack”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:
name: Core networkDeclare the environments of a stack
Section titled “Declare the environments of a stack”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:
environments: - file: envs/prod.tfvars name: Production kind: production - file: envs/staging.tfvarsEach 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.
Skip folders
Section titled “Skip folders”To keep a folder out of your stacks, set skip. Nimzo still scans the folders below it:
skip: trueTo keep a folder and every folder below it out of your stacks, set skipRecursive:
skipRecursive: trueA skipRecursive in the nimzo.yaml at the root of the repository skips the whole repository.
All fields
Section titled “All fields”| 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. |
Troubleshooting
Section titled “Troubleshooting”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.