# samilincoln/cloud-capstone-ou-automation architecture

> Architecture diagram of the GitHub repository samilincoln/cloud-capstone-ou-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/samilincoln/cloud-capstone-ou-automation
- Repository: https://github.com/samilincoln/cloud-capstone-ou-automation

## Overview

##### Project type and purpose
- From the file tree and the minimal README, this is a small backend Python service (microservice) whose job is to automate the creation of AWS Organizations, Organizational Units, Accounts, and IAM credentials/roles. It exposes at least one HTTP endpoint via Flask (`flask_endpoint.py`) to drive those operations.

##### File structure
- Top-level scripts:
- create_account.py – logic to spin up a new AWS account
- create_ou.py – logic to create an Organizational Unit
- organization_creation.py – orchestrates higher-level “organization” workflows
- credential_and_role.py – sets up IAM roles/credentials in the target account/OU
- flask_endpoint.py – exposes an HTTP API for external callers
- Configuration:
- .envdummy – placeholder for environment variables (e.g., AWS_ACCESS_KEY_ID, SECRET, region)
- requirements.txt – Python dependencies (Flask, boto3, python-dotenv, etc.)
- No persistent database layer—state is managed via AWS Organizations and IAM.

##### README for additional insights
- The README only gives the project name (“Quotient-organization-rough”), so our architecture inference comes primarily from the file names and common AWS patterns.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Client
    Client["Client / Consumer"]:::external

    %% Configuration Files
    subgraph "Configuration"
        Env[".envdummy"]:::config
        Req["requirements.txt"]:::config
        Readme["README.md"]:::config
    end

    %% Application Service Boundary
    subgraph "Application Service"
        direction TB
        FlaskAPI["Flask API Service"]:::api

        subgraph "Business Logic Layer"
            direction TB
            OrgOrch["Organization Workflow Orchestrator"]:::biz
            CreateOU["Organizational Unit Creation Module"]:::biz
            CreateAccount["Account Creation Module"]:::biz
            CredRole["IAM Credential & Role Setup Module"]:::biz
        end

        AWSSDK["AWS SDK Layer (boto3)"]:::sdk
    end

    %% AWS External Services
    subgraph "AWS Services"
        direction TB
        Orgs["AWS Organizations"]:::ext
        IAM["AWS IAM"]:::ext
    end

    %% Connections
    Client -->|"HTTP POST /create-org"| FlaskAPI
    Env --> FlaskAPI
    Req --> FlaskAPI
    Readme --> FlaskAPI

    FlaskAPI -->|"invoke orchestrator"| OrgOrch

    OrgOrch -->|"create_ou()"| CreateOU
    OrgOrch -->|"create_account()"| CreateAccount
    OrgOrch -->|"setup_credentials()"| CredRole

    CreateOU -->|"boto3 call"| AWSSDK
    CreateAccount -->|"boto3 call"| AWSSDK
    CredRole -->|"boto3 call"| AWSSDK

    AWSSDK -->|"Organizations API"| Orgs
    AWSSDK -->|"IAM API"| IAM

    %% Click Events
    click FlaskAPI "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/flask_endpoint.py"
    click CreateAccount "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/create_account.py"
    click CreateOU "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/create_ou.py"
    click OrgOrch "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/organization_creation.py"
    click CredRole "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/credential_and_role.py"
    click Env "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/.envdummy"
    click Req "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/requirements.txt"
    click Readme "https://github.com/samilincoln/cloud-capstone-ou-automation/blob/main/README.md"

    %% Styles
    classDef api fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef biz fill:#90EE90,stroke:#333,stroke-width:1px
    classDef sdk fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef ext fill:#FFA500,stroke:#333,stroke-width:1px
    classDef external fill:#f9f,stroke:#333,stroke-width:1px
    classDef config fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef externalGroup fill:#FFEFD5,stroke:#333,stroke-width:1px
```
