atmos validate stacks
Use this command to validate Atmos stack manifest configurations.
Usage​
Execute the validate stacks
command like this:
atmos validate stacks
This command validates Atmos stack manifests and checks the following:
-
All YAML manifest files for YAML errors and inconsistencies
- Note: Template files (
.yaml.tmpl
,.yml.tmpl
,.tmpl
) are excluded from validation since they may contain template placeholders that are invalid YAML before being rendered - Template files are still automatically detected and processed during normal operations (imports, etc.)
- Note: Template files (
-
All imports: if they are configured correctly, have valid data types, and point to existing manifest files
-
Schema: if all sections in all YAML manifest files are correctly configured and have valid data types
-
Misconfiguration and duplication of components in stacks. If the same Atmos component in the same Atmos stack is defined in more than one stack manifest file, and the component configurations are different, an error message will be displayed similar to the following:
Run atmos validate stacks --help
to see all the available options
Examples​
# Use the default (embedded) JSON Schema
atmos validate stacks
# Point to the JSON Schema on the local filesystem
atmos validate stacks --schemas-atmos-manifest schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
# Point to the remote JSON Schema
atmos validate stacks --schemas-atmos-manifest https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
Flags​
Flag | Description | Alias | Required |
---|---|---|---|
--schemas-atmos-manifest | Path to JSON Schema to validate Atmos stack manifests. Can be a URL, an absolute path, or a path relative to the base_path setting in atmos.yaml | no |
Validate Atmos Manifests using JSON Schema​
Atmos uses the Atmos Manifest JSON Schema to validate Atmos manifests, and has a default (embedded) JSON Schema.
If you don't configure the path to a JSON Schema in atmos.yaml
and don't provide it on the command line using the --schemas-atmos-manifest
flag,
the default (embedded) JSON Schema will be used when executing the command atmos validate stacks
.
To override the default behavior, configure JSON Schema in atmos.yaml
:
-
Add the Atmos Manifest JSON Schema to your repository, for example in
stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
-
Configure the following section in the
atmos.yaml
CLI config fileatmos.yaml# Validation schemas (for validating atmos stacks and components)
schemas:
# JSON Schema to validate Atmos manifests
atmos:
# Can also be set using 'ATMOS_SCHEMAS_ATMOS_MANIFEST' ENV var, or '--schemas-atmos-manifest' command-line arguments
# Supports both absolute and relative paths (relative to the `base_path` setting in `atmos.yaml`)
manifest: "stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
# Also supports URLs
# manifest: "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json" -
Instead of configuring the
schemas.atmos.manifest
section inatmos.yaml
, you can provide the path to the Atmos Manifest JSON Schema file by using the ENV variableATMOS_SCHEMAS_ATMOS_MANIFEST
or the--schemas-atmos-manifest
command line flag:ATMOS_SCHEMAS_ATMOS_MANIFEST=stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json atmos validate stacks
atmos validate stacks --schemas-atmos-manifest stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
atmos validate stacks --schemas-atmos-manifest https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
In case of any validation errors (invalid YAML syntax, Atmos manifest JSON Schema errors, invalid imports, etc.), you'll get an output from the command similar to the following: