# l1-alb — Application Load Balancer primitive (multi-resource L1) An L1 module for an Application Load Balancer (load balancer + target group + listener). Substrate-agnostic (the IR types are `aws:elbv2:loadbalancer`, `aws:elbv2:listener`, `aws:elbv2:targetgroup`, not Terraform resource types). This is a multi-resource L1: the interface declares the group's inputs/outputs plus a `resources` array listing the IR types it emits. The IR instance (Phase 14/15) will have multiple `resources` entries all with `module: "l1-alb@1.0.0"`. ## Interface (the IR-typed contract) See `interface.json`: inputs `name` (string), `subnets` (string, comma-separated, ref to l1-vpc), `security_group` (string), `port` (number, default 80), `protocol` (string, default "HTTP"), `region` (string); outputs `lb_arn` (arn) + `listener_arn` (arn) + `target_group_arn` (arn); no NFRs. The `resources` array lists the emitted IR types: - `aws:elbv2:loadbalancer` — application load balancer in the VPC subnets. - `aws:elbv2:targetgroup` — target group for the ECS service tasks. - `aws:elbv2:listener` — listener forwarding the LB port to the target group. ## IR → Terraform mapping (performed by the adapter) The Terraform adapter (`adapters/terraform/adapter.py`) translates each emitted IR resource to Terraform: | IR | Terraform | |----|-----------| | `resource.type = aws:elbv2:loadbalancer` | `resource "aws_lb" "" { ... }` | | `resource.inputs.name` | `name = ` arg | | `resource.inputs.subnets` | `subnets = []` arg (comma-split) | | `resource.inputs.security_group` | `security_groups = []` arg (comma-split) | | `resource.outputs.lb_arn` | `output "lb_arn" { value = aws_lb..id }` | | `resource.type = aws:elbv2:targetgroup` | `resource "aws_lb_target_group" "" { ... }` | | `resource.inputs.port` | `port = ` arg | | `resource.inputs.protocol` | `protocol = ` arg | | `resource.outputs.target_group_arn` | `output "target_group_arn" { value = aws_lb_target_group..arn }` | | `resource.type = aws:elbv2:listener` | `resource "aws_lb_listener" "" { ... }` | | `resource.inputs.lb_arn` | `load_balancer_arn = ` arg (identity) | | `resource.inputs.port` | `port = ` arg | | `resource.inputs.protocol` | `protocol = ` arg | | `resource.outputs.listener_arn` | `output "listener_arn" { value = aws_lb_listener..id }` | The adapter is a thin layer (ARCHITECTURE.md §12.2); it does not own L1 content — it only translates. ## Versioning (W3.D) `1.0.0` — interface MAJOR, behavior MINOR, lifecycle PATCH. MAJOR bumps require a new registry entry (immutable publication); old entries enter a 12-month deprecation window.