Overview
Fjall provisions an Application Load Balancer (ALB) automatically inside an ECS cluster. You do not create the ALB directly. You declare an ECS cluster, and the cluster builds one shared ALB for all of its services. The ALB operates at Layer 7 and distributes incoming traffic across tasks in multiple Availability Zones.Recommended Entry Point
UseComputeFactory.build() to declare ECS compute. The factory validates props, wires defaults, and returns a construct you add to your application.
cluster.domain set, the ALB serves HTTPS on port 443, requests an ACM certificate validated by DNS, creates a Route 53 A record, and redirects HTTP to HTTPS.
Direct EcsCluster Usage
For lower-level control, instantiateEcsCluster directly. The props shape nests cluster-wide settings under cluster and lists services under services.
getLoadBalancer() returns undefined when the ALB is disabled (cluster.loadBalancer: false or cluster.directAccess: true). Guard the result before use.
Cluster Configuration
Thecluster object controls the shared ALB for every service.
Service and Health Checks
Each entry inservices gets its own task definition and target group, all registered behind the cluster ALB. The first container with a port is the primary container that receives ALB traffic.
healthCheck runs inside the task. ALB target-group health checks default to path / on the traffic port and are configured automatically per service.
Multiple Services and Routing
When a cluster has more than one service with a port, each service needs arouting rule so the ALB knows which traffic to send where. Routing supports path patterns and host headers.
Default ALB Settings
Fjall configures the cluster ALB with these defaults.Outputs
The cluster exports the ALB DNS name as a CloudFormation output, keyed by the sanitised cluster name.Cost
Load Balancer Capacity Units (LCUs) bill on the highest of new connections, active connections, processed bytes, and rule evaluations.
Save cost by:
- Consolidating services behind one cluster ALB with path or host routing.
- Disabling the ALB (
loadBalancer: false) for services that never receive external traffic. - Keeping health-check frequency reasonable for the workload.
Troubleshooting
Inspect the deployed ALB with the AWS CLI:
Next Steps
ECS Cluster
Configure the cluster that owns the load balancer.
VPC
Choose the network the ALB and tasks run in.
Security Group
Control inbound and outbound traffic to the ALB.
Compute Factory
Declare ECS compute with the recommended factory entry point.