Skip to content

Latest commit

 

History

History

load-balancer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Load Balancer Module Example

This module is used to create Load Balancer Resources

Example Usage

data "ibm_resource_group" "resource_group" {
  name = (var.resource_group != null ? var.resource_group : "default")
}

module "load-balancer" {
  source = "terraform-ibm-modules/vpc/ibm//modules/load-balancer"

  create_load_balancer     = var.create_load_balancer
  name                     = var.name
  resource_group_id        = data.ibm_resource_group.resource_group.id
  subnets                  = var.subnets
  security_groups          = var.security_groups
  type                     = var.type
  profile                  = var.profile
  logging                  = var.logging
  tags                     = var.tags
  load_balancer            = var.load_balancer
  lb_pools                 = var.lb_pools
  lb_pool_members          = var.lb_pool_members
  lb_listeners             = var.lb_listeners
  lb_listener_policies     = var.lb_listener_policies
  lb_listener_policy_rules = var.lb_listener_policy_rules
}

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.64.0, <2.0.0

Modules

No modules.

Resources

Name Type
ibm_is_lb.lbs resource
ibm_is_lb_listener.lb_listeners resource
ibm_is_lb_listener_policy.lb_listener_policies resource
ibm_is_lb_listener_policy_rule.lb_listener_policy_rules resource
ibm_is_lb_pool.lb_pools resource
ibm_is_lb_pool_member.lb_members resource
ibm_is_lb.lb_ds data source

Inputs

Name Description Type Default Required
create_load_balancer True to create new Load Balancer. False if Load Balancer is already existing and Load Balancer pools/listeners are to be added bool n/a yes
lb_listeners List of Load Balancer Listeners
list(object({
port = number
protocol = string
default_pool = string
certificate_instance = string
connection_limit = number
accept_proxy_protocol = bool
lb_listener_policies = list(object({
name = string
action = string
priority = number
target_id = string
target_http_status_code = number
target_url = string
rules = object({
condition = string
type = string
field = string
value = string
})
lb_listener_policy_rules = list(object({
name = string
condition = string
type = string
field = string
value = string
}))
}))
}))
[] no
lb_pools List of Load Balancer Pool
list(object({
name = string
algorithm = string
protocol = string
health_delay = number
health_retries = number
health_timeout = number
health_type = string
health_monitor_url = string
health_monitor_port = number
session_persistence_type = string
session_persistence_cookie_name = string
lb_pool_members = list(object({
port = number
target_address = string
target_id = string
weight = number
}))
}))
[] no
load_balancer Existing Load Balancer's name to which pools/listeners are to be attached. string null no
logging Logging of Load Balancer. Conflicts with 'profile' bool null no
name Name of the Load Balancer string null no
profile The profile to use for this load balancer. Conflicts with 'logging' string null no
resource_group_id Resource group ID string null no
security_groups Load Balancer securitygroups list list(string) null no
subnets Load Balancer subnets list list(string) [] no
tags List of Tags for the Load Balancer list(string) null no
type Type of Load balancer string null no

Outputs

Name Description
lb_id The ID of the Load balancer
lb_listener_policies All IDs of Load balancer Listener Policies
lb_listener_policy_rules All IDs of Load balancer Listener Policy Rules
lb_listeners All IDs of Load balancer Listeners
lb_pool_members All IDs of Load balancer Pool Members
lb_pools All IDs of Load balancer Pools