Terraform configuration for FinFlow's AWS infrastructure.
- Compute: EKS (Kubernetes) with Managed Node Groups
- API service (2 replicas) — Node.js, exposed via ALB Ingress
- Worker service (3 replicas) — Python, internal only
- Data: RDS PostgreSQL, ElastiCache Redis, S3
- CI/CD: GitHub Actions (see
.github/workflows/) - Monitoring: CloudWatch
- Networking: VPC with public subnets, ALB via AWS Load Balancer Controller
cd environments/production
terraform init
terraform plan
terraform applyAfter the EKS cluster is created:
# Configure kubectl
aws eks update-kubeconfig --name finflow-production --region eu-west-1
# Install AWS Load Balancer Controller (via Helm)
helm repo add eks https://aws.github.io/eks-charts
helm repo update
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
-n kube-system \
--set clusterName=finflow-production \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller
# Deploy the application
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/# Check cluster status
kubectl get nodes
# Check deployments
kubectl -n finflow get deployments
# Check pods
kubectl -n finflow get pods
# View logs
kubectl -n finflow logs -l app=finflow-api --tail=100
kubectl -n finflow logs -l app=finflow-worker --tail=100
# Rolling restart
kubectl -n finflow rollout restart deployment/finflow-api
kubectl -n finflow rollout restart deployment/finflow-workerfinflow-infra/
├── environments/
│ └── production/ # Terraform root module
│ ├── main.tf
│ └── variables.tf
├── modules/
│ ├── compute/ # EKS cluster, node group, addons
│ ├── data/ # RDS, ElastiCache, S3
│ ├── iam/ # IAM roles (EKS cluster, nodes, LB controller)
│ ├── monitoring/ # CloudWatch log groups
│ └── networking/ # VPC, subnets, security groups
├── k8s/ # Kubernetes manifests
│ ├── namespace.yaml
│ ├── api-deployment.yaml
│ ├── api-service.yaml
│ ├── ingress.yaml
│ ├── worker-deployment.yaml
│ └── aws-load-balancer-controller-sa.yaml
└── .github/workflows/ # CI/CD pipeline
production— single AWS account, eu-west-1- Staging runs on a separate EC2 instance with docker-compose (not managed by Terraform)