Component Inheritance
Atmos Design Pattern
The Component Inheritance pattern allows an Atmos component to inherit configuration from a base component, then override specific values. This creates DRY configurations where common settings are defined once and reused.
Use-cases
Use the Component Inheritance pattern when:
-
Multiple components share common configuration
-
You want to define defaults once and override only what differs
How It Works
A component inherits from a base component using metadata.inherits:
stacks/catalog/vpc/defaults.yaml
stacks/deploy/dev.yaml
The vpc component inherits all vars from vpc/defaults, then overrides max_subnet_count.
Inheritance Order
When multiple sources define the same value, later sources win:
base component → inherited components (in order) → inline vars
This allows progressive specialization from general defaults to specific overrides.
Related Patterns
- Multiple Inheritance - Inherit from multiple base components
- Abstract Component - Prevent base components from being deployed
- Multiple Component Instances - Deploy multiple instances of the same component