Stack Configuration
Stacks are YAML files that configure your environments. They define which components to deploy, with what settings, and how they relate to each other. This is where configuration livesβseparate from your Terraform code.
Configuration Sectionsβ
Stack manifests support various configuration sections at different scopes:
| Section | Description | Scopes |
|---|---|---|
| name | Explicit stack name override | Stack manifest only |
| vars | Variables passed to components | Global, component-type, component |
| locals | File-scoped temporary variables | Global, component-type, component |
| env | Environment variables | Global, component-type, component |
| settings | Integrations and metadata | Global, component-type, component |
| metadata | Component behavior and inheritance | Component only |
| hooks | Lifecycle event handlers | Global, component-type, component |
| command | Override default executable | Component-type, component |
| backend | Terraform state storage | Component-type, component |
| providers | Terraform provider configuration | Component-type, component |
| auth | Authentication configuration | Global (atmos.yaml), component |
Component Typesβ
Atmos supports three component types, each with specific configuration options:
| Type | Purpose | Documentation |
|---|---|---|
| Terraform | Infrastructure as Code | Cloud resources, networking, IAM |
| Helmfile | Kubernetes deployments | Helm chart releases |
| Packer | Machine image building | AMIs, VM images |
Composition and Reuseβ
Build maintainable configurations using these patterns:
| Pattern | Description |
|---|---|
| Imports | Include configuration from other files |
| Catalogs | Reusable component configurations |
| Inheritance | Inherit settings between components |
| Overrides | Override inherited configuration |
| Mixins | Composable configuration snippets |
| depends_on | Define component dependencies |
Sharing Stateβ
Share data between components and stacks:
| Topic | Description |
|---|---|
| Remote State | Access Terraform state from other components |
| Share Data | Share configuration between components |
Describing Stacksβ
Use atmos describe stacks to view the fully computed, deep-merged configuration of any stack. This is invaluable for debugging and understanding what configuration will actually be applied.
# View all stacks
atmos describe stacks
# Filter by specific stack
atmos describe stacks --stack plat-ue2-prod
# Filter by component and section
atmos describe stacks --components vpc --sections vars
# Output as JSON for processing with jq
atmos describe stacks --format json | jq '.["plat-ue2-prod"]'
The output shows the final resolved configuration after all imports, inheritance, and overrides have been applied. Use --sections to filter output to specific sections like vars, env, settings, metadata, backend, or workspace.
ποΈ name
Use the name field to explicitly set a stack's logical name, or use name_template for programmatic naming.
ποΈ import
Imports let you split stack configurations across multiple files and reuse them. Each import is deep-merged on top of previous imports, building up the final configuration.
ποΈ overrides
Use the 'Component Overrides' pattern to modify components' configuration and behavior in the current scope.
ποΈ hooks
Use lifecycle hooks to take action at various points in the lifecycle of your components.
ποΈ vars
Use the vars section to pass variables to your Terraform, Helmfile, or Packer components.
ποΈ dependencies
Use the dependencies section to declare tool version requirements and component dependencies.
ποΈ env
Use the env section to set environment variables for your Terraform, Helmfile, or Packer components.
ποΈ locals
Use the locals section to define file-scoped temporary variables that reduce repetition and improve readability.
ποΈ settings
1 item
ποΈ auth
Use the auth section to configure credential management for cloud providers and external services.
ποΈ backend
Use the backend section to generate Terraform backend configuration files for state storage.
ποΈ providers
Use the providers section to generate Terraform provider configuration files for your components.
ποΈ command
Use the command setting to override the default executable for Terraform, Helmfile, or Packer.
ποΈ generate
Use the generate section to create auxiliary configuration files for Terraform components.
ποΈ components
5 items