# shukrikhalid/mbank-infra architecture

> Architecture diagram of the GitHub repository shukrikhalid/mbank-infra, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shukrikhalid/mbank-infra
- Repository: https://github.com/shukrikhalid/mbank-infra

## Overview

Mbank Infrastructure Platform is an AWS landing-zone and self-service infrastructure system. Application teams define shared and environment-specific YAML; the generator merges platform defaults and overrides, enforces compliance locks, validates the result, and emits Terraform inputs and a module invocation. Platform capabilities include reusable workload modules and centralized organization, networking, security, and shared services. The generator and validator relationships are supported by sampled source; broader AWS account and service relationships are documented in the README, while unsampled implementation details are not inferred.

Main entry points: [`pipeline/generator/generator.py`](https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/generator.py) (Infrastructure Generator), [`applications`](https://github.com/shukrikhalid/mbank-infra/tree/main/applications) (App Config), [`pipeline/generator/merger.py`](https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/merger.py) (Defaults Merger), [`platform/modules`](https://github.com/shukrikhalid/mbank-infra/tree/main/platform/modules) (Reusable Modules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Application Config"]
  node_app_yaml["App Config"]
  node_env_yaml["Environment Overrides"]
  node_defaults["Platform Defaults"]
end

subgraph group_pipeline["Config Processing"]
  node_generator["Infrastructure Generator<br/>[generator.py]"]
  node_merger["Defaults Merger<br/>[merger.py]"]
  node_enforcer["Compliance Enforcer<br/>[enforcer.py]"]
  node_schema["Schema Validator<br/>[infra-schema.json]"]
  node_generated["Terraform Inputs"]
end

subgraph group_modules["Infrastructure Modules"]
  node_platform_modules["Reusable Modules"]
end

subgraph group_foundation["AWS Foundation"]
  node_aft["Account Vending"]
  node_organizations["Organizations and SCPs"]
  node_network["Hub Network"]
  node_shared["Shared Services"]
end

subgraph group_controls["Security Controls"]
  node_security["Security Monitoring"]
end

node_team(("Application Team"))
node_aws{{"AWS Environment"}}

node_team -->|"defines infrastructure"| node_app_yaml
node_app_yaml -->|"provides config"| node_generator
node_generator -->|"merges defaults"| node_merger
node_merger -->|"loads defaults"| node_defaults
node_generator -->|"loads overrides"| node_env_yaml
node_generator -->|"enforces locks"| node_enforcer
node_generator -->|"validates against"| node_schema
node_generator -->|"writes Terraform inputs"| node_generated
node_generated -->|"selects compute module"| node_platform_modules
node_platform_modules -.->|"provisions infrastructure"| node_aws
node_aft -->|"vends accounts"| node_aws
node_organizations -->|"sets organization controls"| node_aws
node_network -->|"provides inspected connectivity"| node_aws
node_shared -->|"provides shared services"| node_aws
node_security -->|"monitors accounts"| node_aws

click node_app_yaml "https://github.com/shukrikhalid/mbank-infra/tree/main/applications"
click node_env_yaml "https://github.com/shukrikhalid/mbank-infra/tree/main/applications"
click node_defaults "https://github.com/shukrikhalid/mbank-infra/tree/main/platform/defaults"
click node_generator "https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/generator.py"
click node_merger "https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/merger.py"
click node_enforcer "https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/enforcer.py"
click node_schema "https://github.com/shukrikhalid/mbank-infra/blob/main/platform/schema/infra-schema.json"
click node_generated "https://github.com/shukrikhalid/mbank-infra/tree/main/applications"
click node_platform_modules "https://github.com/shukrikhalid/mbank-infra/tree/main/platform/modules"
click node_aft "https://github.com/shukrikhalid/mbank-infra/tree/main/org/management/aft"
click node_organizations "https://github.com/shukrikhalid/mbank-infra/tree/main/org/management/organizations"
click node_network "https://github.com/shukrikhalid/mbank-infra/tree/main/org/network"
click node_shared "https://github.com/shukrikhalid/mbank-infra/tree/main/org/shared-services"
click node_security "https://github.com/shukrikhalid/mbank-infra/tree/main/org/security"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_yaml,node_env_yaml,node_defaults toneBlue
class node_generator,node_merger,node_enforcer,node_schema,node_generated toneAmber
class node_platform_modules toneMint
class node_aft,node_organizations,node_network,node_shared toneRose
class node_security,node_team,node_aws toneIndigo
```

## Components

### Application Config

- [App Config](https://github.com/shukrikhalid/mbank-infra/tree/main/applications): `applications`
- [Environment Overrides](https://github.com/shukrikhalid/mbank-infra/tree/main/applications): `applications`
- [Platform Defaults](https://github.com/shukrikhalid/mbank-infra/tree/main/platform/defaults): `platform/defaults`

### Config Processing

- [Infrastructure Generator](https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/generator.py): `pipeline/generator/generator.py`
- [Defaults Merger](https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/merger.py): `pipeline/generator/merger.py`
- [Compliance Enforcer](https://github.com/shukrikhalid/mbank-infra/blob/main/pipeline/generator/enforcer.py): `pipeline/generator/enforcer.py`
- [Schema Validator](https://github.com/shukrikhalid/mbank-infra/blob/main/platform/schema/infra-schema.json): `platform/schema/infra-schema.json`
- [Terraform Inputs](https://github.com/shukrikhalid/mbank-infra/tree/main/applications): `applications`

### Infrastructure Modules

- [Reusable Modules](https://github.com/shukrikhalid/mbank-infra/tree/main/platform/modules): `platform/modules`

### AWS Foundation

- [Account Vending](https://github.com/shukrikhalid/mbank-infra/tree/main/org/management/aft): `org/management/aft`
- [Organizations and SCPs](https://github.com/shukrikhalid/mbank-infra/tree/main/org/management/organizations): `org/management/organizations`
- [Hub Network](https://github.com/shukrikhalid/mbank-infra/tree/main/org/network): `org/network`
- [Shared Services](https://github.com/shukrikhalid/mbank-infra/tree/main/org/shared-services): `org/shared-services`

### Security Controls

- [Security Monitoring](https://github.com/shukrikhalid/mbank-infra/tree/main/org/security): `org/security`

### Other components

- **Application Team**
- **AWS Environment**

## Connections

- Application Team → App Config: defines infrastructure (evidence: `README.md`)
- App Config → Infrastructure Generator: provides config (evidence: `pipeline/generator/generator.py`)
- Infrastructure Generator → Defaults Merger: merges defaults (evidence: `pipeline/generator/generator.py`)
- Defaults Merger → Platform Defaults: loads defaults (evidence: `pipeline/generator/merger.py`)
- Infrastructure Generator → Environment Overrides: loads overrides (evidence: `pipeline/generator/generator.py`)
- Infrastructure Generator → Compliance Enforcer: enforces locks (evidence: `pipeline/generator/generator.py`)
- Infrastructure Generator → Schema Validator: validates against (evidence: `pipeline/generator/generator.py`)
- Infrastructure Generator → Terraform Inputs: writes Terraform inputs (evidence: `pipeline/generator/generator.py`)
- Terraform Inputs → Reusable Modules: selects compute module
- Reusable Modules → AWS Environment: provisions infrastructure
- Account Vending → AWS Environment: vends accounts (evidence: `README.md`)
- Organizations and SCPs → AWS Environment: sets organization controls (evidence: `README.md`)
- Hub Network → AWS Environment: provides inspected connectivity (evidence: `README.md`)
- Shared Services → AWS Environment: provides shared services (evidence: `README.md`)
- Security Monitoring → AWS Environment: monitors accounts (evidence: `README.md`)
