aws_lb cost estimation
A managed load balancer (ALB or NLB). Priced per hour plus per LCU/NLCU based on processed traffic.
An aws_lb is either an Application Load Balancer (ALB, Layer 7) or a Network Load Balancer (NLB, Layer 4), selected by the load_balancer_type attribute. Both have a similar two-part pricing model.
First, a flat hourly rate. ALB and NLB both cost about $0.0225/hour (~$16.43/month) just to exist. Gateway Load Balancer (GWLB) is slightly more.
Second, a Load Balancer Capacity Units charge. ALB uses LCUs, NLB uses NLCUs, GWLB uses GWLCUs. Each LCU represents a tracked dimension of traffic: new connections per second, active connections, processed bytes, and rule evaluations (for ALB). You're billed for whichever dimension is highest at any given hour, summed across the month.
In practice, LCU costs depend entirely on how busy the load balancer is. A small ALB serving a few hundred requests per second costs $16 base + maybe $5-10 of LCU per month. A busy ALB handling a million RPS can rack up $500+ in LCU charges on top of the base.
Classic Load Balancer (CLB, the older aws_elb resource, not aws_lb) is priced differently: $0.025/hour plus $0.008/GB processed. AWS encourages moving to ALB/NLB.
c3x reads the load balancer type from the resource. LCU and data costs are usage-based and require c3x-usage.yml entries with expected new connections, active connections, and processed bytes.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_lb" "api" {
name = "api-alb"
load_balancer_type = "application"
internal = false
security_groups = [aws_security_group.lb.id]
subnets = aws_subnet.public[*].id
enable_deletion_protection = true
}
resource "aws_lb_target_group" "api" {
name = "api-targets"
port = 8080
protocol = "HTTP"
vpc_id = aws_vpc.main.id
target_type = "ip"
health_check {
enabled = true
path = "/health"
}
}
resource "aws_lb_listener" "https" {
load_balancer_arn = aws_lb.api.arn
port = 443
protocol = "HTTPS"
certificate_arn = aws_acm_certificate.api.arn
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.api.arn
}
}Pricing dimensions
What you actually pay for when you provision aws_lb.
| Dimension | Unit | What's being charged |
|---|---|---|
| Load balancer hours | per hour | Flat hourly rate for the load balancer to exist, billed by load_balancer_type. $0.0225/hour ≈ $16.43/month for ALB and NLB |
| LCU/NLCU usage | per LCU-hour | Billed by whichever dimension (new connections, active connections, processed bytes, rule evaluations) is highest. Usage-based. $0.008/LCU-hour for ALB |
| Cross-zone load balancing | per GB | If enabled (default on ALB, optional on NLB), traffic between AZs incurs inter-AZ data transfer charges. |
Optimization tips
Common ways to reduce aws_lb cost without changing the workload.
Consolidate load balancers using listener rules
$16/month per consolidated LBOne ALB can host many applications via path-based or host-based listener rules. Two services on separate ALBs cost $32/month base; on a single ALB, $16/month plus negligible extra LCU.
Use NLB instead of ALB for high-throughput TCP
Workload-dependentNLB is generally cheaper per LCU at high throughput. For pure TCP workloads (databases, gRPC backends, raw TCP), NLB also has lower latency.
Disable cross-zone load balancing for NLB if you don't need it
Inter-AZ data transfer costNLB cross-zone is opt-in. Enabling it means inter-AZ traffic charges. If your targets are evenly distributed across AZs already, you don't need cross-zone.
Delete idle load balancers
$16+/month per deleted LBAn ALB with no traffic still costs $16/month. Audit periodically and delete LBs for retired services. Use AWS Config or Cost Explorer to find candidates.
FAQ
What's the difference between aws_lb and aws_elb in c3x?
aws_lb is the modern ALB/NLB/GWLB resource. aws_elb is the legacy Classic Load Balancer, still supported but discouraged. Pricing models differ: CLB is per-hour + per-GB; ALB/NLB are per-hour + per-LCU.
How does c3x estimate LCU charges?
LCU usage is dominated by your traffic shape. Add expected monthly_new_connections, monthly_processed_bytes_gb, and average_concurrent_connections under the load balancer in c3x-usage.yml. Without these, c3x shows only the base hourly cost.
Is health-check traffic counted in LCU?
Health checks count toward new connections and active connections dimensions. For high-target-count load balancers with aggressive health check intervals, this can be non-trivial. Default 30-second health checks are usually fine.
What about API Gateway vs ALB for HTTP APIs?
API Gateway has no base hourly cost but a per-request fee. ALB has $16/month base plus traffic-based LCU. For low-RPS APIs (<1M requests/month), API Gateway is cheaper. For sustained high RPS, ALB is cheaper. c3x can estimate both.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_lb.