# runatlantis/atlantis-tests architecture

> Architecture diagram of the GitHub repository runatlantis/atlantis-tests, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/runatlantis/atlantis-tests
- Repository: https://github.com/runatlantis/atlantis-tests

## Overview

##### Project type and purpose
- This repository is not a full-stack application; it’s a set of example Terraform projects used for end-to-end (E2E) testing of the Atlantis Terraform orchestration tool (see README).
- The goal is to supply a variety of Terraform directory layouts (multi-project, standalone, workspace-based) so that Atlantis’s CI/CD workflows can be exercised against each.

##### File structure
- Top level:
- `.github/workflows/repo-sync.yml` – sync workflow, not central to architecture
- `atlantis.yaml` – Atlantis configuration for project detection
- `multi-projects/` – two Terraform root modules (project1, project2)
- `standalone-with-workspace/` – single root with a subfolder for `env`/staging.tfvars
- `standalone/` – single root Terraform module
- Each Terraform root contains `main.tf` and possibly `env/*.tfvars`, showing two common layout patterns.

##### README for additional insights
- Confirms this is a test fixture repo for Atlantis E2E tests.

##### Detail is king—capture every piece
- Folder as a node under “Terraform Projects”
- `atlantis.yaml` feeding into the Atlantis Server component

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% CI Infrastructure
    subgraph "CI Infrastructure"
        Developer["Developer"]:::external
        GitHub["GitHub Repo"]:::ci
        Workflow["GitHub Actions Workflow"]:::ci
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        Atlantis_Config["atlantis.yaml"]:::orch
        Atlantis["Atlantis Server (Docker)"]:::orch
        CLI["Terraform CLI"]:::orch
    end

    %% Terraform Projects
    subgraph "Terraform Projects"
        MP1["multi-projects/project1/main.tf"]:::iac
        MP2["multi-projects/project2/main.tf"]:::iac
        MP2Env["multi-projects/project2/env/staging.tfvars"]:::iac
        SWRoot["standalone-with-workspace/main.tf"]:::iac
        SWEnv["standalone-with-workspace/env/staging.tfvars"]:::iac
        SR["standalone/main.tf"]:::iac
        README["README.md"]:::external
    end

    %% State Backend
    subgraph "External Systems"
        Backend["State Backend / Cloud API"]:::external
    end

    %% Flow
    Developer -->|"opens PR"| GitHub
    GitHub -->|"triggers"| Workflow
    Workflow -->|"reads config"| Atlantis_Config
    Workflow -->|"spins up"| Atlantis
    Atlantis -->|"loads config"| Atlantis_Config
    Atlantis -->|"invokes"| CLI
    CLI -->|"loads modules"| MP1
    CLI -->|"loads modules"| MP2
    CLI -->|"loads vars"| MP2Env
    CLI -->|"loads modules"| SWRoot
    CLI -->|"loads vars"| SWEnv
    CLI -->|"loads modules"| SR
    CLI -->|"reads state"| Backend
    CLI -->|"writes state"| Backend
    CLI -->|"returns plan/apply"| Atlantis
    Atlantis -->|"posts comments"| GitHub
    README -.-> GitHub

    %% Click Events
    click Workflow "https://github.com/runatlantis/atlantis-tests/blob/main/.github/workflows/repo-sync.yml"
    click Atlantis_Config "https://github.com/runatlantis/atlantis-tests/blob/main/atlantis.yaml"
    click MP1 "https://github.com/runatlantis/atlantis-tests/blob/main/multi-projects/project1/main.tf"
    click MP2 "https://github.com/runatlantis/atlantis-tests/blob/main/multi-projects/project2/main.tf"
    click MP2Env "https://github.com/runatlantis/atlantis-tests/blob/main/multi-projects/project2/env/staging.tfvars"
    click SWRoot "https://github.com/runatlantis/atlantis-tests/blob/main/standalone-with-workspace/main.tf"
    click SWEnv "https://github.com/runatlantis/atlantis-tests/blob/main/standalone-with-workspace/env/staging.tfvars"
    click SR "https://github.com/runatlantis/atlantis-tests/blob/main/standalone/main.tf"
    click README "https://github.com/runatlantis/atlantis-tests/blob/main/README.md"

    %% Styles
    classDef ci fill:#fffae6,stroke:#f2c94c,stroke-width:2px
    classDef orch fill:#e6f7ff,stroke:#2f80ed,stroke-width:2px
    classDef iac fill:#e8f7e4,stroke:#27ae60,stroke-width:2px
    classDef external fill:#f0f0f0,stroke:#9b9b9b,stroke-width:1px,stroke-dasharray: 5 5
```
