Overview
Load Balancers distribute incoming traffic across your ECS containers. Fjall automatically creates and configures Application Load Balancers (ALB) when you deploy ECS services withComputeFactory - you don’t need to create them manually.
Automatic Provisioning
When you useComputeFactory with type: "ecs", Fjall automatically:
- Creates an Application Load Balancer
- Configures target groups for your containers
- Sets up health checks
- Provisions SSL certificates (when domain configured)
- Creates security groups for ALB traffic
Domain Configuration
With Custom Domain
- Creates ALB with HTTPS listener
- Provisions SSL certificate via ACM
- Creates Route53 A record pointing to ALB
- Redirects HTTP → HTTPS
Access the URL
Health Checks
Fjall configures default health checks:Custom Health Check Path
If your app uses a different health endpoint:Multi-Service Clusters
Deploy multiple services behind one ALB with path-based routing:- One ALB for all services
- Path-based routing rules
- Separate target groups per service
- Single SSL certificate for the domain
Load Balancer Types
Application Load Balancer (ALB)
Default for ECS services - automatically created by Fjall:- HTTP/HTTPS traffic
- Path and host-based routing
- WebSocket support
- SSL termination
- Layer 7 routing
Network Load Balancer (NLB)
For TCP/UDP traffic (manual creation required):Accessing Load Balancer Details
Get DNS Name
Get ARN
SSL/TLS Configuration
Automatic HTTPS
With domain configuration, Fjall automatically:- Requests ACM certificate
- Validates via DNS
- Configures HTTPS listener
- Redirects HTTP to HTTPS
Custom Certificate
Use an existing certificate:Connection Draining
Graceful shutdown when scaling down:Logging
Enable access logs:Best Practices
- Let Fjall create ALBs for ECS services
- Use custom domains for production deployments
- Configure health check paths to match your application
- Set appropriate timeouts based on your app’s response time
- Use path-based routing for multiple services on one ALB
- Enable access logs for debugging
- Monitor target health in CloudWatch
- Use connection draining for graceful shutdowns
Troubleshooting
Service Unhealthy
If containers fail health checks:- Check health endpoint - Does
/or/healthreturn 200? - Verify container port - Does
containerPortmatch your app? - Check container logs - Is the app starting successfully?
- Review security groups - Can ALB reach containers?
- Adjust timeouts - Does your app need more startup time?
502 Bad Gateway
Common causes:- Container not listening on
containerPort - Health check failing
- Container crashing on startup
- Security group blocking ALB → container traffic
SSL Certificate Issues
If HTTPS isn’t working:- Verify domain DNS is pointing to Route53 hosted zone
- Check ACM certificate validation status
- Ensure
parentDomainmatches Route53 hosted zone - Wait for DNS propagation (can take 24-48 hours)
Cost Optimization
ALB Pricing
- Fixed cost: ~$16-23/month per ALB
- Variable cost: Per LCU (Load Balancer Capacity Unit)
Reduce Costs
- Share ALBs using path-based routing (multi-service clusters)
- Use NLB for simple TCP traffic (cheaper per connection)
- Delete unused ALBs from stopped environments
- Monitor LCU usage in CloudWatch
See Also
- ComputeFactory - Automatic ALB provisioning
- ECS Cluster - Container orchestration
- Security Group - ALB network access
- VPC - Load balancer networking