# flavius-dinu/oci-adoption-framework-thunder architecture

> Architecture diagram of the GitHub repository flavius-dinu/oci-adoption-framework-thunder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flavius-dinu/oci-adoption-framework-thunder
- Repository: https://github.com/flavius-dinu/oci-adoption-framework-thunder

## Overview

##### Project type and purpose
- This is an open-source Terraform-based **Infrastructure-as-Code (IaC) framework** for Oracle Cloud Infrastructure (OCI).
- It provides **examples** (crawl, walk, run, network_architectures, dev_tools, free_tier, enterprise_tier) and **reusable modules** for setting up OCI resources quickly.

##### File structure
Top-level folders:
- examples/ – Example **root configurations** organized by stage (crawl, walk, run, etc.).
- modules/ – Reusable Terraform **modules** (network, compute, db, monitoring, IAM, etc.).
- userdata/ – Shell/PowerShell scripts executed on instances.
- intro/, workshop/, images/ – Documentation and workshop assets.
Plus root files: README.md, LICENSE, .gitignore.

##### README for additional insights
- Describes **crawl** (basic resources), **walk** (advanced), **run**, **network architectures**, **developer tools**, **free/enterprise tiers**.
- All examples import the **OCI provider**, pass credentials via `.auto.tfvars`, and reference modules under `modules/`.

##### Key components
a. **Developer Workstation**
– Terraform CLI
– Git repo (examples/, modules/, userdata/, docs)
– Terraform state (local or remote backend)
b. **Terraform Examples** (each folder under examples/)
– Root-level `.tf` that:
- Defines `provider "oci"` block (via `.auto.tfvars`)
- References modules from modules/
- Passes variables and invokes userdata scripts
c. **Terraform Modules** (modules/*)
– Encapsulate OCI resource definitions (network, compute, object-storage, database, logging, security)
– Clearly labeled outputs/variables
d. **Userdata Scripts**
– Shell or PowerShell scripts that bootstrap/configure instances
e. **OCI Provider & API**
– The Terraform OCI provider issues API calls to OCI
f. **OCI Cloud Resources**
– Virtual Cloud Network (VCN), Subnets, Internet Gateway, Route Tables
– Compute Instances, Auto Scaling Groups (ASG)
– Databases (ADW, DBaaS, Autonomous DB)
– Object Storage, Block Volumes, File Storage (FSS)
– Load Balancers, API Gateway, Functions, Event Services
– Monitoring & Logging (Grafana, Alarms, Cloud Guard)
– IAM (Users, Groups, Policies, Dynamic Groups)
– Additional services: KMS, Service Connector, WAAS, Blockchain, Marketplace Instances

##### Relationships and interactions
1. **User invokes** `terraform init/plan/apply` on an example folder.
2. Terraform **loads** local modules from modules/*.
3. Terraform **merges** `.auto.tfvars` (credentials & variables) into provider configuration.
4. Terraform **executes** module code to generate an execution plan.
5. Terraform OCI provider **calls** the OCI REST APIs to **create/update** cloud resources.
6. Instances **run** userdata scripts for in-instance configuration.
7. Terraform **writes** state to local or remote backend.

##### Architectural patterns and principles
– **Modular design**: All resource definitions live in reusable modules under modules/.
– **Layered examples**: crawl → walk → run represents increasing complexity.
– **Separation of concerns**: Examples drive end-to-end scenarios; modules encapsulate resource creation logic.
– **Infrastructure-as-Code**: declarative Terraform manifests, version controlled.
– **Extensibility**: New examples or modules can be added without affecting others.

##### Detailed elements
– **Callouts** for credential injection (`terraform.tfvars`), Terraform state, and userdata execution.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Workstation
    DevWS["Developer Workstation<br/>Terraform CLI & Git Repo"]:::workstation
    DevWS -->|"git pull<br/>terraform init/plan/apply"| ExamplesFolder
    DevWS -->|"terraform state read/write"| StateBackend

    %% Terraform State Backend
    StateBackend["Terraform State Backend"]:::state

    %% Examples Folder
    ExamplesFolder["examples/"]:::example
    subgraph "Examples (root configurations)"
        direction TB
        Crawl["crawl"]:::example
        Walk["walk"]:::example
        Run["run"]:::example
        NetArch["network_architectures"]:::example
        DevTools["dev_tools"]:::example
        FreeTier["free_tier"]:::example
        Enterprise["enterprise_tier"]:::example
        CISHub["cis-hub_and_spoke"]:::example
        CISQuick["cis-quickstart"]:::example
    end
    ExamplesFolder --> Crawl
    ExamplesFolder --> Walk
    ExamplesFolder --> Run
    ExamplesFolder --> NetArch
    ExamplesFolder --> DevTools
    ExamplesFolder --> FreeTier
    ExamplesFolder --> Enterprise
    ExamplesFolder --> CISHub
    ExamplesFolder --> CISQuick

    %% Modules Folder
    ExamplesFolder --> ModulesFolder
    ModulesFolder["modules/"]:::module
    subgraph "Terraform Modules"
        direction TB
        ModNetwork["network"]:::module
        ModInstances["instances"]:::module
        ModASG["asg"]:::module
        ModObjStore["object-storage"]:::module
        ModBlockchain["blockchain"]:::module
        ModDBAAS["dbaas"]:::module
        ModADW["adw"]:::module
        ModLB["load-balancer"]:::module
        ModAPIGW["api-gateway"]:::module
        ModFuncs["functions"]:::module
        ModEvents["events"]:::module
        ModNotif["notifications"]:::module
        ModLogging["logging"]:::module
        ModAlarms["alarms"]:::module
        ModCloudGuard["cloud_guard"]:::module
        ModIAM["iam"]:::module
        ModDynGrp["dynamic_group"]:::module
        ModKMS["kms"]:::module
        ModServiceConn["service_connector"]:::module
        ModVuln["vulnerability_scan"]:::module
        ModFastConnect["fastconnect"]:::module
        ModRemotePeer["remote-peering"]:::module
        ModIPSec["ipsec"]:::module
        ModBastion["bastion"]:::module
        ModContainers["containers"]:::module
        ModMarketplace["marketplace_instance"]:::module
        ModContent["content-experience"]:::module
        ModFSS["fss"]:::module
        ModFSSLocal["fss-instance-client-local"]:::module
        ModFSSDest["fss-instance-client-dest"]:::module
    end

    %% Provider and Cloud Resources
    ModulesFolder --> Provider
    Provider["OCI Provider"]:::provider
    Provider --> CloudResources

    subgraph "OCI Cloud Resources"
        direction TB
        VCN["VCN, Subnets, IGW, Route Tables"]:::cloud
        Compute["Compute Instances, ASG"]:::cloud
        Database["DBaaS, ADW, Autonomous DB"]:::cloud
        ObjStore["Object Storage, Block Volumes, FSS"]:::cloud
        LB["Load Balancers"]:::cloud
        APIGW["API Gateway, Functions, Events"]:::cloud
        Monitoring["Monitoring & Logging"]:::cloud
        IAMRes["IAM: Users, Groups, Policies"]:::cloud
        Additional["KMS, Service Connector, WAAS, Blockchain"]:::cloud
    end

    %% Userdata Scripts
    Compute --> Userdata
    subgraph "Userdata Scripts"
        direction TB
        UD_Linux["linux_mount.sh"]:::userdata
        UD_Win["win_mount.ps1"]:::userdata
        UD_FSSLocal["fss_replication_local.sh"]:::userdata
        UD_FSSDest["fss_replication_dest.sh"]:::userdata
    end

    %% Click Events
    click DevWS "https://github.com/flavius-dinu/oci-adoption-framework-thunder/blob/main/README.md"
    click ExamplesFolder "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/"
    click Crawl "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/crawl/"
    click Walk "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/walk/"
    click Run "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/run/"
    click NetArch "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/network_architectures/"
    click DevTools "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/dev_tools/"
    click FreeTier "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/free_tier/"
    click Enterprise "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/enterprise_tier/"
    click CISHub "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/cis-hub_and_spoke/"
    click CISQuick "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/examples/cis-quickstart/"
    click ModulesFolder "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/"
    click ModNetwork "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/network/"
    click ModInstances "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/instances/"
    click ModASG "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/asg/"
    click ModObjStore "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/object-storage/"
    click ModBlockchain "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/blockchain/"
    click ModDBAAS "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/dbaas/"
    click ModADW "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/adw/"
    click ModLB "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/load-balancer/"
    click ModAPIGW "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/api-gateway/"
    click ModFuncs "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/functions/"
    click ModEvents "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/events/"
    click ModNotif "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/notifications/"
    click ModLogging "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/logging/"
    click ModAlarms "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/alarms/"
    click ModCloudGuard "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/cloud_guard/"
    click ModIAM "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/iam/"
    click ModDynGrp "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/dynamic_group/"
    click ModKMS "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/kms/"
    click ModServiceConn "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/service_connector/"
    click ModVuln "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/vulnerability_scan/"
    click ModFastConnect "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/fastconnect/"
    click ModRemotePeer "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/remote-peering/"
    click ModIPSec "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/ipsec/"
    click ModBastion "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/bastion/"
    click ModContainers "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/containers/"
    click ModMarketplace "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/marketplace_instance/"
    click ModContent "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/content-experience/"
    click ModFSS "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/fss/"
    click ModFSSLocal "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/fss-instance-client-local/"
    click ModFSSDest "https://github.com/flavius-dinu/oci-adoption-framework-thunder/tree/main/modules/fss-instance-client-dest/"
    click UD_Linux "https://github.com/flavius-dinu/oci-adoption-framework-thunder/blob/main/userdata/linux_mount.sh"
    click UD_Win "https://github.com/flavius-dinu/oci-adoption-framework-thunder/blob/main/userdata/win_mount.ps1"
    click UD_FSSLocal "https://github.com/flavius-dinu/oci-adoption-framework-thunder/blob/main/userdata/fss_replication_local.sh"
    click UD_FSSDest "https://github.com/flavius-dinu/oci-adoption-framework-thunder/blob/main/userdata/fss_replication_dest.sh"

    %% Styles
    classDef workstation fill:#D0E6FF,stroke:#0366D6,color:#0366D6
    classDef example fill:#E8F1FF,stroke:#007BFF,color:#0056B3
    classDef module fill:#E6F4EA,stroke:#2E8B57,color:#2E8B57
    classDef provider fill:#FFEEDA,stroke:#E08F0C,color:#A65F00
    classDef cloud fill:#F0F0F0,stroke:#555,color:#333
    classDef userdata fill:#FFF5CC,stroke:#D4A017,color:#B36B00
    classDef state fill:#FFEFFC,stroke:#D6336C,color:#A2214D
```
