How kcnaiamh/distributed-microservices-using-vxlan-pulumi-bash-aws works
Project Type and Purpose
• This is an infrastructure-as-code (IaC) project that automates the provisioning of AWS networking & compute resources (VPC, subnets, EC2s) with Pulumi (Python), Bash scripts, and a Makefile, then deploys a suite of e-commerce microservices across three EC2 hosts using Docker Compose.
• The goal is to create an overlay network (VXLAN) so that all containers—spread across three EC2 instances—share a single “br-vxlan” bridge network, enabling service-to-service calls as if they were on the same LAN.
File-Structure Analysis
• Top-level:
• Pulumi.yaml & src/ – IaC definitions (custom VPC, subnets, EC2 provisioning, security, network interfaces).
• scripts/ – Bash scripts to configure VXLAN, hostfile updates, cleanup.
• host_1/, host_2/, host_3/ – Per-EC2 directories containing docker-compose.yml, service code (FastAPI microservices under app/), nginx gateway configs, and environment files.
• Makefile – High-level orchestration (make build, make cleanup).
• Patterns:
• Three hosts in distinct subnets inside one VPC.
• Each host runs a Docker bridge named “br-vxlan” (external in compose).
• API gateways (nginx) in Active-Active on host_1 & host_2 behind a Route53 failover DNS record.
• Microservices communicate via the overlay network at fixed container IPs.
• Databases (PostgreSQL for inventory & users; MongoDB for product & orders) live on host_3.
README Insights
• Confirms 3 EC2 instances, VXLAN overlay, Active-Active API GW, all DB storage on EC2-3.
• Describes challenges and solutions (single VNI, Route53 failover, fixed IPs + /etc/hosts, external network in compose).