# bmppa/iac-demo architecture

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

- Interactive diagram: https://gitdiagram.com/bmppa/iac-demo
- Repository: https://github.com/bmppa/iac-demo

## Overview

##### Project type and purpose
- This is an “iac-demo” repository: a multi‑cloud Infrastructure‑as‑Code (IaC) demo using Terraform.
- It contains Terraform configurations for both AWS and GCP, plus GitHub Actions workflows to automate plan/apply.
- The purpose is to showcase how to provision cloud resources (e.g., S3 buckets, networks) in AWS and GCP via Terraform CI/CD.

##### File structure
- Top‑level:
- .github/workflows – CI/CD pipeline definitions (main.yml, pccs.yaml, yor.yml)
- terraform/aws – AWS Terraform code (main.tf, s3.tf)
- terraform/gcp – GCP Terraform code (main.tf, networks.tf)
- .gitignore excludes local state/artifacts.
- No nested “modules” directory suggests flat per‑provider configs.
- terraform/aws/s3.tf implies an S3 backend or bucket resource; main.tf likely defines providers and resources.
- terraform/gcp/networks.tf suggests VPC/network setup.

##### README for additional insights
- README only has the title; no architecture notes—everything must be inferred from the file tree.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Source Control
    subgraph "Source Control"
        Developer["Developer Workstation"]:::external
        GitHubRepo["GitHub Repository"]:::code
        Readme["README.md"]:::code
        Gitignore[".gitignore"]:::code
    end

    Developer -->|"push code"| GitHubRepo
    GitHubRepo --> Readme
    GitHubRepo --> Gitignore

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        subgraph "GitHub Actions Workflows"
            mainYml["main.yml"]:::ci
            pccs["pccs.yaml"]:::ci
            yor["yor.yml"]:::ci
        end
        subgraph "Terraform AWS"
            AWSMain["main.tf"]:::code
            AWSS3TF["s3.tf"]:::code
        end
        subgraph "Terraform GCP"
            GCPMain["main.tf"]:::code
            GCPNet["networks.tf"]:::code
        end
    end

    GitHubRepo --> mainYml
    GitHubRepo --> pccs
    GitHubRepo --> yor

    mainYml -->|"init/plan/apply"| AWSMain
    pccs   -->|"init/plan/apply"| AWSMain
    yor    -->|"init/plan/apply"| AWSMain

    mainYml -->|"init/plan/apply"| GCPMain
    pccs   -->|"init/plan/apply"| GCPMain
    yor    -->|"init/plan/apply"| GCPMain

    AWSMain --> AWSS3TF
    GCPMain --> GCPNet

    %% Cloud Infrastructure
    subgraph "AWS Account"
        AWSS3Bucket["S3 Bucket (Demo/State)"]:::resource
        AWSOther["Other AWS Resources"]:::resource
    end
    subgraph "GCP Project"
        GCPVPC["VPC Network"]:::resource
        GCPOther["Other GCP Resources"]:::resource
    end

    AWSS3TF -->|provision| AWSS3Bucket
    AWSMain   -->|provision| AWSOther

    GCPNet  -->|provision| GCPVPC
    GCPMain -->|provision| GCPOther

    AWSS3Bucket -->|store state| AWSS3Bucket

    %% Click Events
    click mainYml "https://github.com/bmppa/iac-demo/blob/main/.github/workflows/main.yml"
    click pccs "https://github.com/bmppa/iac-demo/blob/main/.github/workflows/pccs.yaml"
    click yor "https://github.com/bmppa/iac-demo/blob/main/.github/workflows/yor.yml"
    click AWSMain "https://github.com/bmppa/iac-demo/blob/main/terraform/aws/main.tf"
    click AWSS3TF "https://github.com/bmppa/iac-demo/blob/main/terraform/aws/s3.tf"
    click GCPMain "https://github.com/bmppa/iac-demo/blob/main/terraform/gcp/main.tf"
    click GCPNet "https://github.com/bmppa/iac-demo/blob/main/terraform/gcp/networks.tf"
    click Gitignore "https://github.com/bmppa/iac-demo/blob/main/.gitignore"
    click Readme "https://github.com/bmppa/iac-demo/blob/main/README.md"

    %% Styles
    classDef code      fill:#e0f7fa,stroke:#0288d1,stroke-width:1px
    classDef ci        fill:#e8f5e9,stroke:#43a047,stroke-width:1px
    classDef external  fill:#fff8e1,stroke:#f9a825,stroke-width:1px
    classDef resource  fill:#fff3e0,stroke:#fb8c00,stroke-width:1px
    classDef cloud     fill:#e8eaf6,stroke:#3949ab,stroke-width:1px
    classDef state     fill:#f3e5f5,stroke:#8e24aa,stroke-width:1px
```
