README.md1.2 KB
View on GitHubStack Names Example
This example demonstrates imperative stack naming using the name field in stack manifests.
Overview
Stack names are determined by the following precedence (highest to lowest):
name- Explicit name from the stack manifest (always wins)name_template- Template-based naming (if configured)name_pattern- Pattern-based naming (if configured)- Filename - Basename of the stack file (fallback)
This example demonstrates the name field, which always takes precedence over other naming methods.
Stacks
| File | Name Field | Canonical Name |
|---|---|---|
stacks/dev.yaml | (none) | dev |
stacks/prod.yaml | production | production |
Usage
# List all stacks
atmos list stacks
# Dev stack - uses filename
atmos terraform plan mock -s dev
# Prod stack - uses explicit name
atmos terraform plan mock -s production
# This will NOT work (filename is not the canonical name):
# atmos terraform plan mock -s prod
Key Points
- The
namefield takes precedence over the filename - Only the canonical name is valid for the
-sflag - This is useful for migrations, legacy infrastructure, or matching existing Terraform workspace names