{"id":31078109,"url":"https://github.com/andre-2112/agentic-aws-stage3-v4","last_synced_at":"2026-04-12T06:34:40.845Z","repository":{"id":314192645,"uuid":"1054529398","full_name":"andre-2112/agentic-aws-stage3-v4","owner":"andre-2112","description":"🚀 Complete Zero-Error AWS ECS Fargate deployment with PostgreSQL RDS, Docker containers, and SSL/TLS - Live at https://stage3-v4.a-g-e-n-t-i-c.com","archived":false,"fork":false,"pushed_at":"2025-09-11T01:37:31.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T05:26:09.253Z","etag":null,"topics":["auto-scaling","aws","docker","ecs","fargate","fastapi","infrastructure-as-code","loadbalancer","nodejs","postgresql","pulumi","rds","ssl"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andre-2112.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-11T01:22:39.000Z","updated_at":"2025-09-11T01:37:34.000Z","dependencies_parsed_at":"2025-09-11T05:36:22.835Z","dependency_job_id":null,"html_url":"https://github.com/andre-2112/agentic-aws-stage3-v4","commit_stats":null,"previous_names":["andre-2112/agentic-aws-stage3-v4"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/andre-2112/agentic-aws-stage3-v4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-2112%2Fagentic-aws-stage3-v4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-2112%2Fagentic-aws-stage3-v4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-2112%2Fagentic-aws-stage3-v4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-2112%2Fagentic-aws-stage3-v4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andre-2112","download_url":"https://codeload.github.com/andre-2112/agentic-aws-stage3-v4/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andre-2112%2Fagentic-aws-stage3-v4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275384116,"owners_count":25454910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-scaling","aws","docker","ecs","fargate","fastapi","infrastructure-as-code","loadbalancer","nodejs","postgresql","pulumi","rds","ssl"],"created_at":"2025-09-16T08:03:34.632Z","updated_at":"2025-09-16T08:03:36.821Z","avatar_url":"https://github.com/andre-2112.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agentic AWS Stage3-v4 ECS Deployment\n\n🚀 **Complete Zero-Error AWS ECS Fargate deployment with PostgreSQL RDS, Docker containers, and SSL/TLS**\n\n## 📋 Overview\n\nThis repository contains the complete infrastructure and application code for **Stage3-v4** deployment, featuring:\n\n- **Infrastructure as Code**: Pulumi TypeScript with 8 pre-corrections applied\n- **Containerized Applications**: FastAPI backend + Node.js frontend\n- **Database**: PostgreSQL RDS with managed secrets\n- **Networking**: VPC with public/private subnets, load balancers, SSL/TLS\n- **Deployment**: AWS ECS Fargate with auto-scaling\n\n## ✅ Deployment Status\n\n**LIVE URL**: https://stage3-v4.a-g-e-n-t-i-c.com\n\n**All 6 endpoints fully functional:**\n- `/health` - Health check\n- `/api/status` - System status with database connectivity\n- `/api/db-test` - Complete database operations test\n- `/api/fastapi` - FastAPI backend proxy\n- `/api/config` - Configuration details\n- `/api/environment` - Environment variables\n\n**Database connectivity**: ✅ `database_connected: true` achieved\n\n## 🏗️ Architecture\n\n```\nInternet → Public ALB → Node.js (ECS) → Internal ALB → FastAPI (ECS) → PostgreSQL RDS\n                                                                              ↓\n                                                                        Secrets Manager\n```\n\n### Infrastructure Components\n- **VPC**: 10.2.0.0/16 CIDR (isolated from Stage3-v3)\n- **Public Subnets**: 10.2.1.0/24, 10.2.2.0/24\n- **Private Subnets**: 10.2.3.0/24, 10.2.4.0/24  \n- **Database Subnets**: 10.2.5.0/24, 10.2.6.0/24\n- **ECS Cluster**: Fargate with auto-scaling\n- **RDS**: PostgreSQL 15.13 with read replica capability\n- **SSL**: ACM certificate with DNS validation\n\n## 📁 Repository Structure\n\n```\n├── docs/                          # Deployment documentation\n│   ├── DEPLOYMENT_PLAN.md         # Complete deployment strategy\n│   ├── DEPLOYMENT_MITIGATION_PLAN.md  # Risk mitigation procedures\n│   ├── DEPLOYMENT_ISSUES_REPORT.md    # Pre-corrections from Stage3-v3\n│   └── PROMPT_DEPLOYMENT.md       # Initial deployment instructions\n├── infrastructure/                # Pulumi TypeScript IaC\n│   ├── index.ts                  # Main infrastructure definitions\n│   ├── package.json              # Pulumi dependencies\n│   └── Pulumi.yaml              # Pulumi project configuration\n├── docker-images/               # Container applications\n│   ├── fastapi/                # FastAPI backend container\n│   │   ├── main.py            # FastAPI application with DB handling\n│   │   ├── requirements.txt   # Python dependencies\n│   │   └── Dockerfile        # FastAPI container definition\n│   └── nodejs/               # Node.js frontend container\n│       ├── server.js         # Express.js application\n│       ├── package.json      # Node.js dependencies\n│       ├── package-lock.json # Dependency lockfile\n│       ├── public/          # Static web assets\n│       │   └── index.html   # Dashboard UI\n│       └── Dockerfile       # Node.js container definition\n└── README.md                # This file\n```\n\n## 🚀 Deployment Instructions\n\n### Prerequisites\n- AWS CLI configured with appropriate permissions\n- Pulumi CLI installed\n- Docker Desktop running\n- Domain configured in Route 53 (a-g-e-n-t-i-c.com)\n\n### Deploy Infrastructure\n\n1. **Set up Pulumi stack:**\n```bash\ncd infrastructure\npulumi stack init stage3-v4\n```\n\n2. **Configure deployment parameters:**\n```bash\npulumi config set project-name \"agentic-aws-stage3-v4\"\npulumi config set environment \"stage3-v4\"\npulumi config set vpc-cidr \"10.2.0.0/16\"\npulumi config set --plaintext availability-zones '[\"us-east-1a\",\"us-east-1b\"]'\npulumi config set domain-name \"a-g-e-n-t-i-c.com\"\npulumi config set subdomain \"stage3-v4\"\npulumi config set db-instance-class \"db.t3.micro\"\npulumi config set db-allocated-storage 20\npulumi config set db-name \"stage3v4db\"\npulumi config set db-backup-retention 7\npulumi config set ecs-cpu 256\npulumi config set ecs-memory 512\npulumi config set desired-count 1\npulumi config set min-capacity 1\npulumi config set max-capacity 3\npulumi config set log-retention-days 30\npulumi config set cpu-threshold 70\npulumi config set memory-threshold 80\n```\n\n3. **Deploy infrastructure:**\n```bash\npulumi up\n```\n\n### Build and Deploy Applications\n\n1. **Build Docker images:**\n```bash\n# FastAPI\ncd docker-images/fastapi\ndocker build -t agentic-aws-stage3-v4-fastapi .\n\n# Node.js  \ncd ../nodejs\nnpm install\ndocker build -t agentic-aws-stage3-v4-nodejs .\n```\n\n2. **Push to ECR:**\n```bash\naws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 211050572089.dkr.ecr.us-east-1.amazonaws.com\n\ndocker tag agentic-aws-stage3-v4-fastapi:latest 211050572089.dkr.ecr.us-east-1.amazonaws.com/agentic-aws-stage3-v4-fastapi:latest\ndocker tag agentic-aws-stage3-v4-nodejs:latest 211050572089.dkr.ecr.us-east-1.amazonaws.com/agentic-aws-stage3-v4-nodejs:latest\n\ndocker push 211050572089.dkr.ecr.us-east-1.amazonaws.com/agentic-aws-stage3-v4-fastapi:latest\ndocker push 211050572089.dkr.ecr.us-east-1.amazonaws.com/agentic-aws-stage3-v4-nodejs:latest\n```\n\n## 🔍 Testing\n\nTest all endpoints after deployment:\n\n```bash\n# Health check\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/health\n\n# System status (includes database connectivity)\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/api/status\n\n# Database test (CREATE/INSERT/SELECT/DROP operations)\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/api/db-test\n\n# FastAPI backend\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/api/fastapi\n\n# Configuration\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/api/config\n\n# Environment\ncurl https://stage3-v4.a-g-e-n-t-i-c.com/api/environment\n```\n\n## 🛡️ Security Features\n\n- **VPC Isolation**: Separate network from other environments\n- **Private Subnets**: Backend services not directly accessible\n- **Security Groups**: Restrictive network access controls\n- **SSL/TLS**: End-to-end encryption with ACM certificates\n- **Secrets Management**: RDS credentials via AWS Secrets Manager\n- **Non-root Containers**: Security-hardened container images\n\n## 🔧 Key Technical Features\n\n### Pre-corrections Applied\n- **Resource Naming**: Length-optimized for AWS limits\n- **RDS Secrets**: Proper username/password-only structure handling\n- **CIDR Separation**: Environment isolation (10.2.x.x vs 10.1.x.x)\n- **SSL Validation**: Automated DNS validation process\n- **Container Security**: Non-root users and health checks\n- **Database Connection**: Robust error handling and retry logic\n\n### Monitoring \u0026 Observability\n- **CloudWatch Logs**: Centralized logging for all services\n- **Health Checks**: ALB and container-level health monitoring\n- **Auto-scaling**: CPU and memory-based scaling policies\n- **Metrics**: Container Insights enabled\n\n## 📊 Performance Characteristics\n\n- **Startup Time**: ~2-3 minutes for full deployment\n- **Response Time**: \u003c200ms for API endpoints\n- **Scaling**: Automatic based on CPU/memory thresholds\n- **Availability**: Multi-AZ deployment with load balancing\n\n## 🚨 Troubleshooting\n\nCommon issues and solutions documented in:\n- `docs/DEPLOYMENT_ISSUES_REPORT.md` - Known issues and fixes\n- `docs/DEPLOYMENT_MITIGATION_PLAN.md` - Risk mitigation strategies\n\n## 🤝 Contributing\n\nThis deployment represents a production-ready reference architecture with all pre-corrections applied from previous deployment iterations.\n\n## 📄 License\n\nGenerated with Claude Code - Anthropic AI Assistant\n\n---\n\n**Deployment completed**: 2025-09-11  \n**Status**: ✅ PRODUCTION READY  \n**Database**: ✅ CONNECTED  \n**All Endpoints**: ✅ FUNCTIONAL","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-2112%2Fagentic-aws-stage3-v4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandre-2112%2Fagentic-aws-stage3-v4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandre-2112%2Fagentic-aws-stage3-v4/lists"}