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
-
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​
atmos validate stacks
atmos validate stacks --schemas-atmos-manifest 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 an absolute path or a path relative to the base_path setting in atmos.yaml | no |
Validate Atmos Manifests using JSON Schema​
Atmos can use the Atmos Manifest JSON Schema to validate Atmos stack manifests
on the command line by executing the command atmos validate stacks
.
For this to work, configure the following:
-
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" -
Execute the command
atmos validate stacks
-
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 argument: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
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: