Abstract Component
Atmos Design Pattern
The Abstract Component pattern marks a component as a blueprint that cannot be deployed directly. Abstract components serve as base configurations that other components inherit from, preventing accidental deployment of incomplete or template configurations.
Use-cases
Use the Abstract Component pattern when:
-
You have base components that should never be deployed on their own
-
You want to prevent accidental
atmos terraform applyon template configurations -
You need a clear distinction between "blueprints" and "deployable" components
How It Works
Set metadata.type: abstract to mark a component as non-deployable:
stacks/catalog/vpc/defaults.yaml
Components that inherit from abstract components are deployable by default:
stacks/deploy/prod.yaml
Error on Deploy Attempt
If you try to deploy an abstract component:
atmos terraform apply vpc/defaults -s prod
Atmos returns an error:
abstract component 'vpc/defaults' cannot be provisioned since it's explicitly
prohibited from being deployed by 'metadata.type: abstract' attribute