atlantis.yaml & projects
Multi-directory, multi-workspace repos.
Real repos are not a single Terraform directory — they have many projects (a vpc dir, a database dir, per-environment folders), possibly with workspaces. An atlantis.yaml in the repo root tells Atlantis how to handle them: it defines projects (each a directory + workspace + optional terraform version) and how to autoplan them. Without it, Atlantis uses defaults; with it, you get precise control over what runs where.
version: 3projects:- name: prod-vpcdir: live/prod/vpcworkspace: defaultterraform_version: v1.9.2autoplan:when_modified: ["*.tf", "../../../modules/vpc/**/*.tf"]enabled: trueapply_requirements: [approved, mergeable]- name: prod-dbdir: live/prod/databaseapply_requirements: [approved]
Per-project control
Defining projects lets each one carry its own settings: which files trigger its plan (when_modified — including shared modules, so a module change re-plans dependents), its apply requirements, its Terraform version, and its workflow. This is how a monorepo of infrastructure stays sane — a change to the prod database plans only the prod database, and a change to a shared module plans everything that uses it. The atlantis.yaml is the map of your infrastructure repo.