Schemas
Configure the paths where Atmos finds OPA and JSON Schema files to validate stack manifests and components. Schemas enable you to enforce consistency and catch configuration errors early.
Configuration
Schemas are configured in the schemas section:
atmos.yaml
Configuration Options
schemas.jsonschema.base_pathBase path to JSON Schema files for component validation. Supports both absolute and relative paths. Can also be set using
ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATHenvironment variable or--schemas-jsonschema-dircommand-line argument.schemas.opa.base_pathBase path to OPA (Open Policy Agent) policy files for component validation. Supports both absolute and relative paths. Can also be set using
ATMOS_SCHEMAS_OPA_BASE_PATHenvironment variable or--schemas-opa-dircommand-line argument.schemas.atmos.manifestPath to the JSON Schema used to validate Atmos stack manifests. Supports both absolute and relative paths (relative to
base_path). Can also be set usingATMOS_SCHEMAS_ATMOS_MANIFESTenvironment variable or--schemas-atmos-manifestcommand-line argument.
Directory Structure
A typical schema directory structure:
stacks/schemas/
├── jsonschema/
│ ├── vpc.json
│ ├── eks-cluster.json
│ └── rds.json
├── opa/
│ ├── vpc.rego
│ ├── security.rego
│ └── compliance.rego
└── atmos/
└── atmos-manifest/
└── 1.0/
└── atmos-manifest.json
Atmos Manifest JSON Schema
The Atmos Manifest JSON Schema validates Atmos stack manifests and provides auto-completion in supported editors.
IDE Auto-Completion and Validation
In supported editors like JetBrains IDEs, Microsoft Visual Studio, or Visual Studio Code, the schema can offer auto-completion and validation to ensure that Atmos stack manifests are correct.
A list of editors that support validation using JSON Schema can be found here.
Command-Line Validation
Atmos can validate stack manifests on the command line using atmos validate stacks:
atmos validate stacks
You can also specify the schema path via environment variable or 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
If not specified, Atmos defaults to the schema corresponding to the currently installed version.
Validation Output Example
In case of validation errors, you'll see output similar to:
Environment Variables
ATMOS_SCHEMAS_JSONSCHEMA_BASE_PATH- Base path to JSON Schema files.
ATMOS_SCHEMAS_OPA_BASE_PATH- Base path to OPA policy files.
ATMOS_SCHEMAS_ATMOS_MANIFEST- Path to Atmos manifest JSON Schema.
References
Related Commands
📄️ atmos validate
Validate Atmos stacks and components
📄️ atmos validate stacks
Validate stack manifests against JSON Schema
📄️ atmos validate component
Validate components with OPA policies
See Also
- CLI Configuration — Overview of CLI configuration
- Component Validation — Validating components with OPA and JSON Schema
- Configure Validation — Quick start guide for validation