MPAC Platform - Infrastructure Architecture
Multi-Region Overview
┌──────────────────────────────────────────┐
│ MPAC SmartPOS Platform │
└──────────────────────────────────────────┘
┌─────────────────────────┐ ┌──────────────────────────┐ ┌───────────────────────────┐
│ ap-northeast-1 │ │ ap-northeast-1 │ │ ap-northeast-1 │
│ mpac-smartpos │ │ mpac-pgw │ │ mpac-obs │
│ │ │ │ │ │
│ VPC: 10.1.0.0/16 │ │ VPC: 10.0.0.0/16 │ │ VPC: 10.100.0.0/16 │
│ │ │ │ │ │
│ ┌───────────────────┐ │ │ ┌────────────────────┐ │ │ ┌─────────────────────┐ │
│ │ ALB (public) │ │ │ │ ALB (public) │ │ │ │ ALB (public) │ │
│ │ api.mpac-cloud- │ │ │ │ api.pgw.mpac- │ │ │ │ grafana.obs. │ │
│ │ dev.com │ │ │ │ │ │ │ │ mpac-cloud-dev.com │ │
│ └────────┬──────────┘ │ │ └────────┬───────────┘ │ │ └────────┬────────────┘ │
│ │ │ │ │ │ │ │ │
│ ┌────────┴──────────┐ │ │ ┌────────┴───────────┐ │ │ ┌────────┴────────────┐ │
│ │ ECS Fargate │ │ │ │ ECS Fargate │ │ │ │ ECS Fargate │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ ┌─────────────┐ │ │ │ │ ┌──────────────┐ │ │ │ │ ┌───────────────┐ │ │
│ │ │ svc-portal │ │ │ │ │ │ pgw-backend │ │ │ │ │ │ Grafana │ │ │
│ │ │ (Python) │ │ │ │ │ │ (Go/Gin) │ │ │ │ │ │ 12.3.0 │ │ │
│ │ └─────────────┘ │ │ │ │ └──────────────┘ │ │ │ │ └───────────────┘ │ │
│ │ ┌─────────────┐ │ │ │ │ │ │ │ │ ┌───────────────┐ │ │
│ │ │ svc-smarttab│ │ │ │ │ ┌──────────────┐ │ │ │ │ │ Alloy │ │ │
│ │ │ (Go/Gin) │ │ │ │ │ │ matcher │ │ │ │ │ │ (OTLP) │ │ │
│ │ └─────────────┘ │ │ │ │ │ (scheduled) │ │ │ │ │ └───────────────┘ │ │
│ └───────────────────┘ │ │ │ └──────────────┘ │ │ │ └─────────────────────┘ │
│ │ │ └────────────────────┘ │ │ │
│ ┌───────────────────┐ │ │ ┌────────────────────┐ │ │ ┌─────────────────────┐ │
│ │ RDS PostgreSQL │ │ │ │ RDS PostgreSQL │ │ │ │ EC2 OBS Box │ │
│ │ (shared DB) │ │ │ │ (own DB) │ │ │ │ ┌───────────────┐ │ │
│ └───────────────────┘ │ │ └────────────────────┘ │ │ │ │ Prometheus │ │ │
│ │ │ │ │ │ │ Loki │ │ │
│ ┌───────────────────┐ │ │ ┌────────────────────┐ │ │ │ │ Tempo │ │ │
│ │ ElastiCache Redis │ │ │ │ ElastiCache Redis │ │ │ │ └───────────────┘ │ │
│ └───────────────────┘ │ │ └────────────────────┘ │ │ └─────────────────────┘ │
│ │ │ │ │ │
│ ┌───────────────────┐ │ │ ┌────────────────────┐ │ │ ┌─────────────────────┐ │
│ │ Kong API Gateway │ │ │ │ Bastion Host │ │ │ │ S3 (Loki data) │ │
│ └───────────────────┘ │ │ └────────────────────┘ │ │ │ S3 (Tempo data) │ │
│ │ │ │ │ └─────────────────────┘ │
└─────────────────────────┘ └──────────────────────────┘ └───────────────────────────┘Network Architecture
mpac-smartpos (ap-northeast-1, VPC 10.1.0.0/16)
Internet
│
├── Public Subnets (10.1.1.0/24, 10.1.2.0/24)
│ └── Application Load Balancer
│ └── Kong API Gateway → routes to ECS services
│
├── Private Subnets (10.1.10.0/24, 10.1.11.0/24)
│ ├── ECS Fargate: svc-portal (FastAPI)
│ └── ECS Fargate: svc-smarttab (Go/Gin)
│
└── Database Subnets (10.1.20.0/24, 10.1.21.0/24)
├── RDS PostgreSQL (shared between svc-portal and svc-smarttab)
└── ElastiCache Redismpac-pgw (ap-northeast-1, VPC 10.0.0.0/16)
Internet
│
├── Public Subnets (10.0.1.0/24, 10.0.2.0/24)
│ ├── Application Load Balancer (direct, no API Gateway)
│ └── Bastion Host (for DB access)
│
├── Private Subnets (10.0.10.0/24, 10.0.11.0/24)
│ └── ECS Fargate: pgw-backend (Go/Gin)
│ └── Scheduled Task: matcher (daily reconciliation)
│
└── Database Subnets (10.0.20.0/24, 10.0.21.0/24)
├── RDS PostgreSQL (own DB, no cross-DB FK)
└── ElastiCache Redismpac-obs (ap-northeast-1, VPC 10.100.0.0/16)
Internet
│
├── Public Subnets
│ └── Application Load Balancer
│ ├── grafana.obs.mpac-cloud-dev.com → Grafana
│ └── otlp.obs.mpac-cloud-dev.com → Alloy (OTLP)
│
└── Private Subnets
├── ECS Fargate: Grafana (UI dashboard)
├── ECS Fargate: Alloy (OTLP collector)
└── EC2 OBS Box (t3.medium)
├── Prometheus (metrics, port 9090)
├── Loki (logs, port 3100) → S3 storage
└── Tempo (traces, port 3200/4317) → S3 storageInter-System Communication
mpac-smartpos ────HMAC-SHA256────→ mpac-pgw (payment operations)
mpac-smartpos ────HTTPS/OTLP────→ mpac-obs (telemetry data)
mpac-pgw ────HTTPS/OTLP────→ mpac-obs (telemetry data)All inter-system communication traverses public internet over HTTPS. There are no VPC peering connections between the three systems.
CloudFormation Stack Dependencies
mpac-smartpos
- Single stack:
ecs-stack.yaml(VPC + RDS + Redis + ECS + ALB)
mpac-pgw
- Single stack:
ecs-stack.yaml(VPC + RDS + Redis + ECS + ALB + Bastion)
mpac-obs (multi-stack)
vpc-stack.yaml ──→ obs-box-stack.yaml ──→ ecs-stack.yaml
└→ dns-stack.yaml ──────→ ecs-stack.yamlDeploy order: VPC → DNS (optional) → OBS Box → ECS