Configure Project Repository
Atmos supports both the monorepo and polyrepo architectures when managing the configurations for components and stacks.
A "monorepo" is a version-controlled repository that stores all the code, configurations and scripts for the entire infrastructure composed of individual components with independent lifecycles. Monorepos usually improve collaboration, CI/CD build speed, and overall productivity. A monorepo should not be confused with a monolith, which is a single, often large, codebase for an application.
Polyrepo architectures consists of several version-controlled repositories for code, configurations and scripts for different parts of the
infrastructure. For example, depending on various requirements (including security, lifecycle management, access control, audit, etc.), separate repositories can be used to manage infrastructure per account (e.g. dev, staging, prod), per service, or per team.
In this Quick Start guide, we will be using a monorepo to provision the following resources into multiple AWS accounts (dev, staging, prod)
and regions (us-east-2 and us-west-2):
Common Directories and Files
Atmos requires a few common directories and files, which need to be configured in the infrastructure repo:
componentsdirectory (required) - contains centralized component configurationsstacksdirectory (required) - contains centralized stack configurationsatmos.yaml(required) - CLI config filevendor.yaml(optional) - Atmos vendor config fileMakefile(optional)Dockerfile(optional)rootfsdirectory (optional) - root filesystem for the Docker image (ifDockerfileis used)
Atmos separates code from configuration (separation of concerns). The code is in the components directories and the configurations for different environments are in the stacks directory. This allows the code (Terraform and Helmfile components) to be environment-agnostic, meaning the components don't know and don't care how and where they will be provisioned. They can be provisioned into many accounts and regions - the configurations for different environments are defined in the stacks directory.
While it's recommended to use the directory names as shown above, the stacks and components directory names and filesystem locations are
configurable in the atmos.yaml CLI config file. Refer to Configure CLI for more details.
The following example provides the simplest filesystem layout that Atmos can work with:
│ # Centralized stacks configuration
├── stacks/
│ ├── <stack_1>.yaml
│ ├── <stack_2>.yaml
│ └── <stack_3>.yaml