Skip to content

Think-Cube/terraform-azure-loadbalancer

Repository files navigation

Requirements

Name Version
terraform >= 1.6.3
azurerm 4.46.0

Providers

Name Version
azurerm 4.46.0

Modules

No modules.

Resources

Name Type
azurerm_lb.main resource
azurerm_lb_backend_address_pool.main resource
azurerm_lb_outbound_rule.main resource
azurerm_lb_probe.main resource
azurerm_lb_rule.main resource
azurerm_public_ip.main resource
azurerm_resource_group.main data source

Inputs

Name Description Type Default Required
default_tags Key-value tags to assign to all resources for identification. map(any) n/a yes
environment Environment name to differentiate resources (e.g., dev, prod). string "dev" no
frontend_ip_config_name Name of the frontend IP configuration. string "DynamicFrontendIPConfig" no
ip_version IP version to use: IPv4 or IPv6. string "IPv4" no
lb_backend_address_pools List of Load Balancer backend address pools.
list(object({
name = string
loadbalancer_id = string
virtual_network_id = optional(string, null)
tunnel_interface = optional(list(object({
identifier = string
type = string
protocol = string
port = number
})), [])
}))
[] no
lb_name Name of the Load Balancer. string "TestLoadBalancer" no
lb_outbound_rules List of Load Balancer outbound rules.
list(object({
name = string
loadbalancer_id = string
backend_address_pool_id = string
protocol = string
enable_tcp_reset = optional(bool, false)
allocated_outbound_ports = optional(number, 1024)
idle_timeout_in_minutes = optional(number, 4)
frontend_ip_configuration = optional(list(object({
name = string
})), [])
}))
[] no
lb_probes List of Load Balancer probes.
list(object({
name = string
loadbalancer_id = string
protocol = optional(string, "Tcp")
port = number
probe_threshold = optional(number, 1)
request_path = optional(string, null)
interval_in_seconds = optional(number, 15)
number_of_probes = optional(number, 2)
}))
[] no
lb_rules List of Load Balancer rules.
list(object({
name = string
protocol = string
frontend_port = number
backend_port = number
frontend_ip_configuration_name = string
backend_address_pool_ids = list(string)
probe_id = string
load_distribution = string
idle_timeout_in_minutes = number
enable_floating_ip = bool
disable_outbound_snat = bool
}))
[] no
lb_sku Azure Load Balancer SKU. Values: Basic, Standard, or Gateway. string "Standard" no
lb_zones List of Availability Zones for the Load Balancer. list(string) [] no
pip_allocation_method IP allocation method: Static or Dynamic. string "Static" no
pip_enable_zones Enable Availability Zones for the public IP. bool false no
pip_sku Public IP SKU. Possible values: Basic or Standard. string "Standard" no
pip_zones List of Availability Zones for the public IP. list(string) [] no
private_ip_address Private IP to assign if static IP is enabled. string "" no
public_ip_name Name of the public IP address. string n/a yes
public_ip_prefix_id Public IP Prefix ID to associate with the Load Balancer. string "" no
region Azure region where resources will be deployed (e.g., weu). string "weu" no
resource_group_location Location of the resource group. Changing this recreates the group. string "West Europe" no
resource_group_name Name of the resource group. Changing this recreates the group. string n/a yes
subnet_id Subnet ID for an internal Load Balancer. string "" no
use_public_ip Whether to assign a public IP to the Load Balancer. bool true no
use_static_ip Whether to use a static private IP. bool false no

Outputs

Name Description
lb_backend_address_pool_details Details of the Load Balancer Backend Address Pools
lb_backend_address_pool_ids The IDs of the Load Balancer Backend Address Pools
load_balancer_frontend_ip_configuration_ids The IDs of the Load Balancer frontend IP configurations
load_balancer_id The ID of the Load Balancer
load_balancer_outbound_rule_ids The IDs of the Load Balancer Outbound Rules
load_balancer_outbound_rules Detailed information about the Load Balancer Outbound Rules
load_balancer_probe_details Details of the Load Balancer probes
load_balancer_probe_ids The IDs of the Load Balancer probes
load_balancer_rules A list of Load Balancer rules with their details
public_ip_address The IP address of the Public IP
public_ip_id The ID of the Public IP
public_ip_prefix_id The ID of the Public IP Prefix, if used