# theendofline/hashicat-app architecture

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

- Interactive diagram: https://gitdiagram.com/theendofline/hashicat-app
- Repository: https://github.com/theendofline/hashicat-app

## Overview

##### Main Components

a. Terraform Configuration Layer
- Main Terraform configuration components (main.tf, variables.tf, outputs.tf)
- Remote backend configuration possibility (remote_backend.tf.example)
- Variables input source (terraform.tfvars.example)

b. Policy Management Layer
- Sentinel policy framework
- Three distinct policy types:
- Tag enforcement
- Trusted modules verification
- Cost restriction

c. Azure Infrastructure Layer
- Azure resources being deployed
- Application deployment component (deploy_app.sh)
- "Meow World" website infrastructure

##### Application Layer

Use the following visual elements:

- Rectangles: Terraform configuration files
- Hexagons: Sentinel policies
- Clouds: Azure infrastructure components
- Rounded rectangles: Application components

- Blue: Terraform configuration files
- Red: Policy controls
- Green: Azure resources
- Orange: Application components
- Gray: Optional/example components

c. Connections:

##### A "Configuration Layer" at the top
- [variables.tf] ← [terraform.tfvars] → [main.tf] → [outputs.tf]
- ↓
- [remote_backend.tf (optional)]

##### "Policy Layer" below
- [Sentinel Policy Framework]
- [Tag Enforcement]
- [Trusted Modules]
- [Cost Restrictions]

- [Azure Resources]
- [Networking]
- [Compute]
- [Storage]

##### Finally, add the "Application Layer"
- [deploy_app.sh] → [Meow World Website]

##### Important Elements to Emphasize

- Flow of configuration from Terraform files to Azure resources
- How Sentinel policies gate and control deployments
- Where variable inputs can affect the infrastructure
- Relationship between infrastructure and application deployment

##### Notes for Clarity

- Use clear labels for all components
- Brief descriptions for key components

Remember to include a title: "HashiCat Azure - Infrastructure as Code Architecture" and any relevant metadata such as version numbers or environment indicators.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[("HashiCat Azure - IaC Architecture")]:::title

    %% Configuration Layer
    subgraph ConfigLayer["Configuration Layer"]
        variables["Variables Definition"]
        tfvars["Variable Inputs"]
        main["Main Configuration"]
        outputs["Output Definition"]
        backend["Remote Backend"]
    end

    %% Policy Layer
    subgraph PolicyLayer["Policy Control Layer"]
        sentinel["Sentinel Policy Framework"]
        tagpolicy["Tag Enforcement"]
        modpolicy["Trusted Modules"]
        costpolicy["Cost Restrictions"]
    end

    %% Azure Infrastructure Layer
    subgraph AzureLayer["Azure Infrastructure Layer"]
        network["Networking"]:::azure
        compute["Compute Resources"]:::azure
        storage["Storage"]:::azure
    end

    %% Application Layer
    subgraph AppLayer["Application Layer"]
        deploy["Deployment Script"]
        website["Meow World Website"]:::app
    end

    %% Relationships
    tfvars --> variables
    variables --> main
    main --> outputs
    main --> backend
    
    main --> sentinel
    sentinel --> tagpolicy
    sentinel --> modpolicy
    sentinel --> costpolicy
    
    tagpolicy --> AzureLayer
    modpolicy --> AzureLayer
    costpolicy --> AzureLayer
    
    main --> network
    main --> compute
    main --> storage
    
    compute --> deploy
    deploy --> website

    %% Styles
    classDef title fill:#f9f,stroke:#333,stroke-width:4px
    classDef azure fill:#0072C6,stroke:#fff,color:#fff
    classDef app fill:#FF7F00,stroke:#fff,color:#fff
    
    %% Click Events
    click main "https://github.com/theendofline/hashicat-app/blob/main/main.tf"
    click variables "https://github.com/theendofline/hashicat-app/blob/main/variables.tf"
    click outputs "https://github.com/theendofline/hashicat-app/blob/main/outputs.tf"
    click backend "https://github.com/theendofline/hashicat-app/blob/main/remote_backend.tf.example"
    click tfvars "https://github.com/theendofline/hashicat-app/blob/main/terraform.tfvars.example"
    click sentinel "https://github.com/theendofline/hashicat-app/blob/main/policies/sentinel.hcl"
    click tagpolicy "https://github.com/theendofline/hashicat-app/blob/main/policies/enforce-mandatory-tags.sentinel"
    click modpolicy "https://github.com/theendofline/hashicat-app/blob/main/policies/enforce-trusted-modules.sentinel"
    click costpolicy "https://github.com/theendofline/hashicat-app/blob/main/policies/restrict-deployment-cost.sentinel"
    click deploy "https://github.com/theendofline/hashicat-app/blob/main/files/deploy_app.sh"

    %% Legend
    subgraph Legend
        l1["Configuration Component"]
        l2["Azure Resource"]:::azure
        l3["Application Component"]:::app
    end
```
