CLI: Load Balancer Management

Manage load balancers with the agentmetal lb subcommand.

CLI: Load Balancer Management

Overview

The agentmetal lb subcommand manages load balancers for distributing traffic across instances. Both HTTP (Layer 7) and TCP (Layer 4) load balancers are supported.

Operations

Create a Load Balancer

agentmetal lb create \
  --name web-lb \
  --type http \
  --vpc vpc-abc123
FlagRequiredDescription
--nameYesLoad balancer name
--typeYesType: http (Layer 7) or tcp (Layer 4)
--vpcYesVPC ID for the load balancer
--listenerNoListener in format listen_port:target_port:protocol (repeatable)
--health-pathNoHealth check path for HTTP (default: /)
--health-intervalNoHealth check interval in seconds (default: 10)
### List Load Balancers
agentmetal lb list
ID          NAME     TYPE   STATE    PUBLIC IP        VPC
lb-a1b2c3   web-lb   http   active   203.0.113.100    vpc-abc123
lb-d4e5f6   tcp-lb   tcp    active   203.0.113.101    vpc-abc123

Get / Delete

agentmetal lb get lb-a1b2c3
agentmetal lb delete lb-a1b2c3

Examples

Create an HTTP load balancer with multiple listeners:

agentmetal lb create \
  --name api-lb \
  --type http \
  --vpc vpc-abc123 \
  --listener "80:8080:http" \
  --listener "443:8080:https" \
  --health-path /healthz \
  --health-interval 15

Create a TCP load balancer for database connections:

agentmetal lb create \
  --name db-lb \
  --type tcp \
  --vpc vpc-abc123 \
  --listener "5432:5432:tcp"

LoadBalancerSpec Fields

FieldTypeDescription
typestringhttp or tcp
vpc_idstringVPC for the load balancer
listenersarrayList of listener configurations
health_checkobjectHealth check settings (path, interval, threshold)