# hashicorp/terraform-guides architecture

> Architecture diagram of the GitHub repository hashicorp/terraform-guides, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hashicorp/terraform-guides
- Repository: https://github.com/hashicorp/terraform-guides

## Overview

##### Main Components
- Governance: This section covers the Sentinel policies (with directories for first-generation, second-generation, and third-generation) that ensure the cloud resources comply with organization rules. Create a “Governance & Sentinel Policies” component, and include notes that these policies are cloud-specific (AWS, Azure, GCP, and even VMware) and are versioned and tested.
- Supporting Modules and Best Practices: There are also directories like “hashistack” and various examples (terraform-0.12-examples, terraform-0.13-examples) which serve as further examples or libraries that support best practices. You may note these as “Reference Modules & Examples” or “Best Practices Libraries.”

##### Architectural Patterns & Design Principles
- Multi-cloud Support: Mark that the configurations are provided for multiple cloud providers (AWS, Azure, GCP, VMware). This layered cloud component shows that while the Terraform core engine is common, per-cloud specifics (modules/configurations) are maintained separately.
- Environment and Testing Support: With test directories (as seen under governance, mocks, and test directories) the repository supports policy testing. Consider a “Testing & Mocks” sub-component under Governance or near infrastructure examples.

##### Relevant Technologies & Frameworks
- Terraform: Central technology for infrastructure provisioning.
- Sentinel: For policy as code.
- Shell scripting and automation (for operations interactions with the Terraform Enterprise API).
- Cloud provider services (AWS, Azure, GCP, and even Kubernetes clusters).
- Container tools (as seen in self-serve-infrastructure with Dockerfiles) for application deployment.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Provisioning"
        A["Infrastructure-as-Code"]:::provisioning
        B["Self-Serve Infrastructure"]:::provisioning
        C["Cloud Management Platform"]:::platform
    end

    subgraph "Governance & Policy"
        D["Governance & Sentinel Policies"]:::policy
    end

    subgraph "Operations & Automation"
        E["Operations & Automation"]:::operations
    end

    subgraph "Reference Modules & Best Practices"
        F1["hashistack"]:::reference
        F2["terraform-0.12-examples"]:::reference
        F3["terraform-0.13-examples"]:::reference
    end

    E -->|"Config_Deployment"| A
    E -->|"Config_Deployment"| B

    D -->|"Policy_Enforcement"| A

    C -->|"Unified_View"| A
    C -->|"Unified_View"| B

    F1 ---|"Support"| A
    F2 ---|"Support"| A
    F3 ---|"Support"| A

    F1 ---|"Support"| B
    F2 ---|"Support"| B
    F3 ---|"Support"| B

    click A "https://github.com/hashicorp/terraform-guides/tree/master/infrastructure-as-code"
    click B "https://github.com/hashicorp/terraform-guides/tree/master/self-serve-infrastructure"
    click D "https://github.com/hashicorp/terraform-guides/tree/master/governance"
    click E "https://github.com/hashicorp/terraform-guides/tree/master/operations"
    click C "https://github.com/hashicorp/terraform-guides/tree/master/cloud-management-platform"
    click F1 "https://github.com/hashicorp/terraform-guides/tree/master/infrastructure-as-code/hashistack"
    click F2 "https://github.com/hashicorp/terraform-guides/blob/master/infrastructure-as-code/terraform-0.12-examples"
    click F3 "https://github.com/hashicorp/terraform-guides/blob/master/infrastructure-as-code/terraform-0.13-examples"

    classDef provisioning fill:#D5E8D4,stroke:#82B366,stroke-width:2px;
    classDef policy fill:#F8CECC,stroke:#B85450,stroke-width:2px;
    classDef operations fill:#DAE8FC,stroke:#6C8EBF,stroke-width:2px;
    classDef platform fill:#FFF2CC,stroke:#D6B656,stroke-width:2px;
    classDef reference fill:#E1D5E7,stroke:#9673A6,stroke-width:2px;
```
