Use when creating or editing Nullstone IaC YAML files under `.nullstone/` — adding or wiring apps, datastores, networks, domains, subdomains, ingresses, clusters, cluster-namespaces; setting `vars`, `environment`, `connections`, or `capabilities`; configuring `events`. Triggers on file paths `.nullstone/config.yml`, `.nullstone/{env}.yml`, `.nullstone/previews.yml`, and anything under `.nullstone/stacks/{stack}/`.
80
100%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
You can use the Nullstone UI to configure your applications and infrastructure, but there are times when you want to configure in code. Placing configuration in code allows you to automate configuration, track infrastructure changes in version control, and share configuration with your team.
Having configuration in code allows you to correlate infrastructure changes with code changes. As an example, let's say you are adding a new feature that requires the use of new infrastructure. In the same commit or PR, you can add both the configuration to the IaC (infrastructure as code) file and the code for the new feature. As the PR is opened, a preview environment is created and launched. Because the configuration is in the IaC file, the preview environment will be configured with the new infrastructure. You can test the new feature in the preview environment and ensure it works as expected.
There are two types of Nullstone IaC files that are placed in .nullstone/ directory of your repository.
.nullstone/config.yml - Used as a primary source of configurationnullstone/config.yml or from the Nullstone UI.An overrides file is either named previews.yml (for all preview environments) or <env-name>.yml (for a specific environment override). Nullstone GitOps runs a synchronization per environment so the effective config will be a merge of config.yml and the env-specific overrides file. If you change a previews.yml in a pull request, it will only affect the preview environment(s) that are synced on that branch.
TIP
You can manage multiple stacks from a single repository using stack-specific subdirectories (e.g. .nullstone/stacks/<stack-name>/config.yml). See Multi-Stack Configuration for details.
The format of the IaC file is similar to a docker-compose file. An example is shown below.
version: "0.1"
apps:
acme-api:
vars:
num_tasks: 1
cpu: 256
memory: 512
environment:
DATABASE_URL: "{{ POSTGRES_URL }}"
ANOTHER_VAR: abc123Nullstone supports auto-completion and validation in your editor.
We publish a JSON schema (it applies to YAML as well) to schemastore.org.
The following editors are supported:
If you want to download the JSON schema file directly, you can find it on our open-source repository nullstone-io/iac.