Skip to main content

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

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
Customize Your Structure

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
Terraform: Root Modules vs Child Modules

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.

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
Choose Based on Your Needs

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.