Once the Node/Express image is in ECR and the ECS service is running on Fargate, treat the task definition as the contract: CPU/memory, container port, and environment must match what the process actually listens on. Prefer a cheap liveness probe on a /health (or equivalent) that only checks the process — keep DB depth on a separate readiness path so a brief RDS blip does not force the service to thrash replacements. Inject secrets at task/runtime, not into the image layers that ECR retains.
Ops prove-out after the first stable revision: confirm the service shows healthy tasks, hit the ALB (or service discovery) path once and the task private IP:port once, and compare status codes and Host / X-Forwarded-* behaviour against what Express assumed on localhost. If the target group flaps, check security groups, the mapped container port, and whether the health check path still depends on a dependency that is not ready at start.
I especially found your point about separating liveness and readiness checks useful. I'm currently learning and building my StudentHub project using AWS ECS Fargate, so these are valuable things to consider as I move towards deployment and testing.
I'll keep the task definition, runtime secrets, and health-check behaviour in mind during the next phase. Appreciate you taking the time to share these practical suggestions!
Good luck with StudentHub. One Fargate-specific check that pays off before you open traffic: point the ALB health check at the readiness route (dependency-aware), and keep a separate process-only path for the container-level health check so a cold RDS connect at start doesn't replace the task in a loop. After the first stable revision, hit both the ALB URL and the task private IP:port once and compare Host and X-Forwarded-* — Express redirect and cookie settings often differ between those two hops.
Node Edge Ops
Once the Node/Express image is in ECR and the ECS service is running on Fargate, treat the task definition as the contract: CPU/memory, container port, and environment must match what the process actually listens on. Prefer a cheap liveness probe on a /health (or equivalent) that only checks the process — keep DB depth on a separate readiness path so a brief RDS blip does not force the service to thrash replacements. Inject secrets at task/runtime, not into the image layers that ECR retains.
Ops prove-out after the first stable revision: confirm the service shows healthy tasks, hit the ALB (or service discovery) path once and the task private IP:port once, and compare status codes and Host / X-Forwarded-* behaviour against what Express assumed on localhost. If the target group flaps, check security groups, the mapped container port, and whether the health check path still depends on a dependency that is not ready at start.