Skip to main content
EXAMPLE

Stack Inheritance

Inherit shared component defaults from a catalog and override them per environment — the pattern that eliminates copy-pasted stack config.

Stacks
cloudposse / atmos

Try it out

Copy the example into a new directory and make it your own:

atmos init examples/demo-stacks
cd demo-stacks

Follow the README for prerequisites and next steps.

See it in action

RECORDED DEMO
demo-stacks
 
Recorded from this example
Real commands. Real output.
README.md1.7 KB
View on GitHub

Example: Demo Stacks

Inherit configuration across environments to eliminate duplication.

Learn more about Stack Inheritance.

What You'll See

Try It

cd examples/demo-stacks

# See how configuration is inherited (--query focuses on the vars section)
atmos describe component myapp -s dev --query .vars
atmos describe component myapp -s prod --query .vars

# Compare the resolved configuration across environments
atmos describe stacks --components myapp --sections vars

TIP

Drop --query/--sections to see the full resolved configuration, including imports, inheritance chain, and deps.

Key Files

FilePurpose
stacks/catalog/myapp.yamlBase component configuration (shared defaults)
stacks/deploy/dev.yamlDev environment with imports and overrides
stacks/deploy/prod.yamlProd environment with different overrides