# praveenmogili/devops-2023 architecture

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

- Interactive diagram: https://gitdiagram.com/praveenmogili/devops-2023
- Repository: https://github.com/praveenmogili/devops-2023

## Overview

##### Main Components
- Terraform Module(s) & Scripts: Representing the infrastructure provisioning elements. This includes cloud networking (VCN, subnets – one public and one private), gateways (internet and service), routing (route tables), security components (security lists and network security groups), and compute instances.
- OCI Cloud Infrastructure: Show it as the environment where resources are created. Display components like VCN, subnets, and compute instances with labels like “ic_pub_vm-A”, “ic_pvt_vm-B”, etc.
- Ansible Roles & Playbooks: Representing configuration management tasks. There should be roles for deploying the programming challenge, performing instance configuration, and executing validations such as ping tests.
- Python Programming Challenge Component: Represent this as a separate module or artifact that runs on the provisioned instance. Note that it uses an external JSON file (problem.json) to drive its logic.

##### Architectural Patterns & Design Principles
- Separation of Concerns: Clearly distinguish between the provisioning layer (Terraform) and the configuration/deployment layer (Ansible), ensuring each has a clearly defined responsibility.
- Infrastructure as Code (IaC) and Configuration as Code: This is the underlying principle of the design; all infrastructure and configuration tasks are codified.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Provisioning Layer
    subgraph "Provisioning Layer"
        Terraform["Terraform"]
    end

    %% OCI Environment
    subgraph "OCI Environment"
        VCN["IC_VCN"]
        PubSubnet["IC_pub_snet-A"]
        PvtSubnet["IC_pvt_snet-B"]
        IG["IC_IG-A"]
        SG["IC_SG-A"]
        PubVM["ic_pub_vm-A"]
        PvtVM1["ic_pvt_vm-B"]
        PvtVM2["ic_pvt_vm-C"]
        PubRT["ic_pub_rt-A"]
        PvtRT["ic_pvt_rt-B"]
        PubSL["ic_pub_sl-A"]
        PvtSL["ic_pvt_sl-B"]
        NSG["ic_pvt_nsg-B"]
    end

    %% Configuration & Deployment Layer
    subgraph "Configuration & Deployment Layer"
        Ansible["Ansible"]
        AnsiblePlaybooks["Ansible Roles & Playbooks"]
        PythonChallenge["Python Programming Challenge"]
    end

    %% Reference Documentation
    Docs["Reference Docs"]

    %% Connections from Provisioning Layer to OCI Environment
    Terraform -->|"provisions"| VCN

    %% OCI Environment internal relationships
    VCN -->|"contains"| PubSubnet
    VCN -->|"contains"| PvtSubnet
    PubSubnet -->|"attached_to"| IG
    PubSubnet -->|"hosts"| PubVM
    PvtSubnet -->|"attached_to"| SG
    PvtSubnet -->|"hosts"| PvtVM1
    PvtSubnet -->|"hosts"| PvtVM2
    IG -->|"routes"| PubRT
    SG -->|"routes"| PvtRT
    PubSubnet -->|"secures"| PubSL
    PvtSubnet -->|"secures"| PvtSL
    PvtSubnet -->|"NSG"| NSG

    %% Deployment flow from Ansible to OCI Compute Instance
    AnsiblePlaybooks -->|"configures"| PubVM
    PubVM -->|"deploys"| PythonChallenge
    PythonChallenge -->|"reads"| ProblemJSON["problem.json"]

    %% Link to Reference Documentation
    Terraform -.->|"docs"| Docs
    AnsiblePlaybooks -.->|"docs"| Docs

    %% Class styles for color-coding
    classDef orchestration fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef static fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px;
    classDef app fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef doc fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;

    class Terraform,Ansible,AnsiblePlaybooks orchestration;
    class VCN,PubSubnet,PvtSubnet,IG,SG,PubVM,PvtVM1,PvtVM2,PubRT,PvtRT,PubSL,PvtSL,NSG static;
    class PythonChallenge,ProblemJSON app;
    class Docs doc;

    %% Click Events for Component Mapping
    click AnsiblePlaybooks "https://github.com/praveenmogili/devops-2023/blob/master/ansible/playbook.yml"
    click AnsiblePlaybooks "https://github.com/praveenmogili/devops-2023/blob/master/playbook.yml"
    click ProblemJSON "https://github.com/praveenmogili/devops-2023/blob/master/problem.json"
    click Docs "https://github.com/praveenmogili/devops-2023/blob/master/Steps to Access Oracle Cloud.md"
    click Docs "https://github.com/praveenmogili/devops-2023/blob/master/demo-stack-diagram.pdf"
```
