Folder Structure
Atmos discovers your components (Terraform root modules, Helmfile releases, etc.) and stack configurations based on paths you define in atmos.yaml. The folder structure is fully customizableβorganize however makes sense for your project.
You will learn
- How to organize your project on the file system
- How to separate configuration from components
- Different ways to organize your project
Recommended Filesystem Layoutβ
Atmos is fully configurable, and you can organize your project in any way that makes sense for your team by adjusting the paths in atmos.yaml. We also provide detailed guidance on organizing your folder structure, whether it's for a simple project or enterprise-scale architecture in our Design Patterns section. For complex organizational structures, see the Organizational Structure Configuration pattern. Choose the model that best fits the stage you plan to reach when you complete the project.
Here's a simple layout, if you just have 3 deployments for things like dev, staging, and prod:
βββ components/ # Folder containing all your components, usually organized by toolchain
β βββ terraform/ # Folder for all Terraform "root modules"
βββ stacks/
βββ deploy/ # Folder for deployable stacks
β βββ dev/ # Folder for development environment configurations
β βββ staging/ # Folder for staging environment configurations
β βββ prod/ # Folder for production environment configurations
βββ catalog/ # Folder for the service catalog
βββ schemas/ # Folder for the schema validations
βββ workflows/ # Folder for workflows that operate on top of stacks
The folder structure is fully customizable via base_path settings. If you only use Terraform (no Helmfile or other toolchains), you could use base_path: "terraform", base_path: "components", or even base_path: ".". The components/terraform convention exists because Atmos supports multiple toolchains, but organize however makes sense for your project.
Alternatively, here's a more complex layout for a larger project broken into multiple organizations, organizational units, and environments:
βββ components/ # Folder containing all your components, usually organized by toolchain
β βββ terraform/ # Folder for all Terraform "root modules"
βββ stacks/
βββ orgs/ # Folder for deployable stacks
β βββ acme/ # Folder for the Acme organization
β βββ core/ # OU for core services
β β βββ security/ # Folder for security-related configurations
β β βββ audit/ # Folder for audit-related configurations
β β βββ identity/ # Folder for identity management configurations
β β βββ network/ # Folder for networking-related configurations
β βββ plat/ # OU for platform environments
β βββ dev/ # Folder for development environment configurations
β βββ staging/ # Folder for staging environment configurations
β βββ prod/ # Folder for production environment configurations
βββ catalog/ # Folder for the service catalog
βββ schemas/ # Folder for the schema validations
βββ workflows/ # Folder for workflows that operate on top of stacks
Note, that these are just a couple of examples.
components/- folder containing all your components, usually organized by your toolchain
components/terraform- folder for all Terraform "root modules"
stacks/orgs/- folder for deployable stacks
stacks/catalog/- folder for the service catalog
stacks/workflows/- folder for workflows that operate on top of stacks.
You can find some demos of how we organize projects in the Atmos GitHub repository under the examples/ folder. Or check out our Reference Architecture for AWS for a more detailed look at how we organize our projects.
To effectively organize an Atmos project, we want to ensure you have specific locations for Atmos to find your stack configurations and components. At a minimum, we recommend the following folder structure in your project:
Components Folderβ
This folder contains your components, organized by toolchain. Each toolchain has its own base_path setting in atmos.yaml:
- Terraform/OpenTofu:
components/terraform/β Contains your Terraform root modules - Helmfile:
components/helmfile/β Contains your Helmfile releases
For Terraform users: Atmos only discovers root modulesβthe top-level configurations you deploy directly. Child modules (reusable modules called via module "..." { source = "..." }) can live anywhere and don't need to be configured in Atmos.
Organizing Components for Version Managementβ
Folder structure has a tight relationship with version management. How you organize your components folder determines how you manage versions across environments.
We have extensive documentation on version management covering strategies for balancing stability with velocity, avoiding anti-patterns, and choosing the right approach for your organization.
Continuous Version Deployment (Recommended)β
All environments converge to the same component version. Simple and promotes consistency.
components/
βββ terraform/
βββ vpc/
βββ eks/
βββ rds/
Release Tracks/Channelsβ
Components organized by maturity level. Environments subscribe to tracks; you promote tracks, not pins.
components/
βββ terraform/
βββ alpha/ # Development track
β βββ vpc/
β βββ eks/
βββ beta/ # Staging track
β βββ vpc/
β βββ eks/
βββ stable/ # Production track
βββ vpc/
βββ eks/
Strict Version Pinningβ
Explicit SemVer versions for maximum control and rollback capability.
components/
βββ terraform/
βββ vpc/
βββ 1.2/
βββ 1.3/
βββ 2.0/
Folder-Based Versioningβ
Simple approach for breaking changesβcreate a new folder when the interface changes.
components/
βββ terraform/
βββ vpc/ # Current version
βββ vpc-v2/ # Breaking change version
- Simple projects: Start with Continuous Version Deployment
- Progressive rollout: Use Release Tracks
- Strict compliance: Use Version Pinning
- External components: See Vendoring
See the Version Management Overview for detailed guidance on trade-offs.
Stack Configurations Folderβ
Stack organization determines how you manage configuration across environments, tenants, and regions.
Simple Structureβ
For projects with a few environments (dev, staging, prod):
stacks/
βββ catalog/ # Reusable component defaults
β βββ vpc/
β βββ defaults.yaml
βββ dev.yaml
βββ staging.yaml
βββ prod.yaml
Organizational Structureβ
For enterprise multi-org, multi-tenant, multi-region deployments:
stacks/
βββ catalog/
βββ mixins/
β βββ region/
β βββ stage/
βββ orgs/
βββ acme/
βββ _defaults.yaml
βββ core/
β βββ _defaults.yaml
βββ plat/
βββ dev/
β βββ us-east-1.yaml
βββ prod/
βββ us-east-1.yaml
See Organizational Structure Configuration for complete implementation details.
Stack Folder Conventionsβ
stacks/catalog/- Reusable component defaults organized by component name. See Component Catalog.
stacks/mixins/- Reusable configuration fragments for regions, stages, and tenants.
stacks/schemas/- JSON or OPA schemas used to validate stack configurations.
stacks/workflows/- Workflow definitions that operate on stacks. See Workflows.
Related Patternsβ
- Component Catalog β Centralized reusable component defaults
- Defaults Pattern β DRY configuration with
_defaults.yamlinheritance - Layered Stack Configuration β Separation of concerns across layers