Skip to main content

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

Use ComputeFactory.build() to declare ECS compute. The factory validates props, wires defaults, and returns a construct you add to your application.
With 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, instantiate EcsCluster 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

The cluster object controls the shared ALB for every service.

Service and Health Checks

Each entry in services 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.
The container 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 a routing 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:
  1. Consolidating services behind one cluster ALB with path or host routing.
  2. Disabling the ALB (loadBalancer: false) for services that never receive external traffic.
  3. 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.