Skip to main content

Configuration Schema Reference

StackTest configurations are defined in stacktest.yaml, stacktest.yml, or stacktest.json. Files are parsed by extension (YAML or JSON), then validated by the same Zod models in @stack-test/core.

Auto-discovery order (when --config is omitted): stacktest.yamlstacktest.ymlstacktest.json.

Machine-readable schema

A JSON Schema is generated from the same Zod models and checked into the repository:

  • Repository path: schemas/stacktest.schema.json
  • Raw URL: https://raw.githubusercontent.com/gattasrikanth/stacktest/main/schemas/stacktest.schema.json

Point your editor at the schema for autocomplete:

# yaml-language-server: $schema=../../schemas/stacktest.schema.json
project:
name: my-project
{
"$schema": "../../schemas/stacktest.schema.json",
"project": { "name": "my-project" }
}

Note: JSON Schema validates structural shape. Runtime validation via stacktest lint is stricter: it enforces that referenced providers exist, that each test uses either a single provider+template or stages (not both), and that stage names are unique. An optional "$schema" property in JSON configs is ignored by Zod validation.


1. Project Configuration (project)

Defines the namespace for the test execution.

FieldTypeRequiredDescription
namestringYesUnique project name. Must be lowercase, alphanumeric with hyphens, and start with a letter. Maximum 30 characters.

2. Providers Configuration (providers)

A dictionary mapping provider identifiers (like aws-cloudformation) to settings. Additional provider-specific keys are allowed.

FieldTypeRequiredDescription
regionsstring[]NoDefault deployment target environments (for example AWS regions) used when a test does not set its own regions.

3. Tests Configuration (tests)

A dictionary mapping suite names to configurations. At least one test suite is required.

FieldTypeRequiredDescription
providerstringConditionalProvider name when not using sequential stages. Must be defined under providers.
templatestringConditionalPath to the IaC template file (relative to the config file directory).
parametersRecord<string, string | number | boolean | null>NoDefault parameter values passed to the template. Keys must match provider/template parameter names (for CloudFormation: the template Parameters keys).
stagesTestStageConfig[]ConditionalSequential multi-provider stages. Mutually exclusive with top-level provider/template.
regions(string | RegionConfig)[]NoTarget regions for this test. Overrides provider-level regions when set.

Region entries (regions)

Each entry may be either a region name string or an object with per-region parameter overrides:

FormExample
String"us-east-1"
Object{ region: "us-west-2", parameters: { DelaySeconds: 5 } }

Region-level parameters are merged over test-level (or stage-level) parameters for that plan expansion.

Stage entries (stages[])

FieldTypeRequiredDescription
namestringYesUnique stage name within the test (alphanumeric, dashes, underscores).
providerstringYesProvider for this stage.
templatestringYesTemplate path for this stage.
parametersRecord<string, string | number | boolean | null>NoParameters for this stage.

Parameter example

tests:
parameterized-queue:
provider: aws-cloudformation
template: templates/parameterized-queue.yaml
parameters:
QueueName: $[stacktest_project_name]-$[stacktest_region]
DelaySeconds: 0
regions:
- region: us-east-1
parameters:
DelaySeconds: 0
- region: us-west-2
parameters:
DelaySeconds: 5

See also Parameter Overrides and the AWS CloudFormation parameters example.