Skip to main content
atmos scaffold: one file per selection via matrix
 
00:00.0 / 00:00.0
README.md1.8 KB
View on GitHub

Example: Scaffold Matrix

Generate one file per selection instead of hand-maintaining a pile of near-duplicate files.

Learn more in the Scaffold Command Documentation.

What You'll See

  • A spec.files[].matrix entry expanding one discovered template file into one generated file per selected environment
  • The resolved combination available as .matrix.<axis> in both the output path and the generated file's own content

Try It

# List available scaffold templates
atmos scaffold list

# Generate one stacks/<env>.yaml file per selected environment
atmos scaffold generate example ./my-project --set environments=dev,staging

Selecting dev and staging generates stacks/dev.yaml and stacks/staging.yaml — the matrix-driven files, one per selected environment, instead of hand-maintaining a near-duplicate file per environment yourself.

Key Files

FilePurpose
scaffold.yamlTemplate configuration: one environments multiselect field, one matrix-expanded file entry
environment.yamlDiscovered template expanded by matrix into one stacks/<env>.yaml per selected environment
atmos.yamlTemplate for generated Atmos configuration (this whole directory is source: "." for the example template, so it's copied verbatim, like in examples/scaffolding)
README.mdThis file, also copied verbatim into the generated project for the same reason

Learn More

An axis's values aren't limited to a literal list or a multiselect answer — they can also come from a free-text answer or be computed from nested/structured answer data. See the atmos scaffold generate docs for the full matrix reference.