# Load Balancer
Provides an e2e loadbalancer resource.
This resource allows you to manage loadbalancer on your e2e clusters. When applied, a new loadbalancer is created. When destroyed, this loadbalancer is removed.
```hcl
resource "e2e_loadbalancer" "lb1" {
plan_name = "E2E-LB-2"
lb_name = "E2E-LB-2-301"
lb_mode = "HTTP"
node_list_type = "S"
enable_bitninja = false
backends {
balance = "source"
name= "backend-server-ts"
servers {
id = 163745
port = 8000
}
servers {
id = 149020
port = 8080
}
http_check = false
}
acl_list {
acl_name = "acl-7718"
acl_condition = "path_end -i"
acl_matching_path = "/suf"
}
acl_map {
acl_name = "acl-7718"
acl_backend = "backend-server-ts"
}
vpc_list = [e2e_vpc.VPC-TS-01.id]
is_ipv6_attached = false
project_id=22878
}
resource "e2e_vpc" "VPC-TS-01" {
region="Delhi"
vpc_name="VPC-TS-01"
}
```
## Schema
### Required
- `lb_mode` (String) In which mode load balancer is going to launch http, https, both
- `lb_name` (String) It is the name of load balancer, letter,digit,underscore,hyphen are allowed
- `plan_name` (String) It is the plan of which load balancer is going to launch
- `project_id` (String) This is your project ID in which you want to create the resource.
- Either `Backend` or `Tcp Backend` is required. Details are mentioned below.
- `NOTE` - ACl list and ACL map are not allowed with TCP backend.
### Optional
- `acl_list` (Block List) This will give the acl rule which you want to apply (see [below for nested schema](#nestedblock--acl_list))
- `acl_map` (Block List) This will give you how you want to route request according to acl rule (see [below for nested schema](#nestedblock--acl_map))
- `backends` (Block List) This will contain the backend details which will be attached to load balancer (see [below for nested schema](#nestedblock--backends))
- `enable_bitninja` (Boolean) Modular security tool used to enable load balancer from wide range of cyber attacks
- `enable_eos_logger` (Block List) If you want to get the logs of loadbalancer. Please connect eos bucket (see [below for nested schema](#nestedblock--enable_eos_logger))
- `is_ipv6_attached` (Boolean) This is used to attach IPV6 on your load balancer
- `lb_reserve_ip` (String) This field is for any reserve IP which is going to attach on load balancer
- `lb_type` (String) It is used to define internal or external load balancer
- `location` (String) This is the region of your loadbalancer
- `node_list_type` (String) It is used to find out either node is static(S) or dynamic autoscaling(D)
- `power_status` (String) power_on to start the load balancer and power_off to power off the load balancer
- `tcp_backend` (Block List) Need Information of TCP backend If user wants to attach (see [below for nested schema](#nestedblock--tcp_backend))
- `vpc_list` (Set of Number) List of vpc Id which you want to attach
### Read-Only
- `disk` (String) This is the disk storage allotted to your loadbalancer
- `host_target_ipv6` (String) This is the ipv6 allotted to your loadbalancer
- `id` (String) The ID of this resource.
- `private_ip` (String) Private IP of load balancer
- `public_ip` (String) Public IP of load balancer
- `ram` (String) This is the ram allotted to your loadbalancer
- `status` (String) This is the status of your loadbalancer, only to get the status from my account.
- `vcpu` (Number) This is the vcpu allotted to your loadbalancer
### Nested Schema for `acl_list`
Required:
- `acl_condition` (String) Condition in which ACL rule will match
- `acl_matching_path` (String) path in which this rule will work
- `acl_name` (String) Name of your ACL rule
### Nested Schema for `acl_map`
Required:
- `acl_backend` (String) Name of your backend server
- `acl_name` (String) Name of your ACL rule
Optional:
- `acl_condition_state` (Boolean) status of acl condition state
### Nested Schema for `backends`
Required:
- `balance` (String) This will contain the type of algorithm used while load balancing
- `name` (String) This will be the name of your backend.
Optional:
- `check_url` (String) endpoint of health check to ping
- `checkbox_enable` (Boolean) This checkbox is to enable health check
- `domain_name` (String) domain name for health check
- `http_check` (Boolean) Check if http health check in enable
- `scaler_id` (String) Need scalar ID if you want to attach autoscaling
- `scaler_port` (String) Need scalar port if you want to attach autoscaling
- `servers` (Block List) description of servers that are going to attach on backend (see [below for nested schema](#nestedblock--backends--servers))
### Nested Schema for `backends.servers`
Required:
- `id` (String) Node id which you want to attach
- `port` (String) Port Number of the node
### Nested Schema for `enable_eos_logger`
Required:
- `access_key` (String) Access key of your object storage bucket
- `bucket` (String) Bucket name of your object storage bucket
- `secret_key` (String) Secret key of your object storage bucket
Optional:
- `appliance_id` (Number) ID of the appliance
### Nested Schema for `tcp_backend`
Required:
- `backend_name` (String) Your TCP backend name
- `balance` (String) This will contain the type of algorithm used while load balancing
- `port` (String) Port number for your TCP backend. 8080, 10050, 9101,80 or 443 port not allowed
- `servers` (Block List, Min: 1) description of servers that are going to attach on backend (see [below for nested schema](#nestedblock--tcp_backend--servers))
### Nested Schema for `tcp_backend.servers`
Required:
- `id` (String) Node id which you want to attach
- `port` (String) Port Number of the node
---