Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 2.35 KB

File metadata and controls

74 lines (53 loc) · 2.35 KB
layout cloudstack
page_title CloudStack: cloudstack_internal_loadbalancer
sidebar_current docs-cloudstack-resource-internal-loadbalancer
description Creates an internal load balancer rule.

cloudstack_internal_loadbalancer

Creates an internal load balancer rule (createLoadBalancer with scheme = Internal). An internal load balancer distributes traffic to a set of instances within a VPC tier, reached through a private source IP on that tier's network rather than a public IP.

Example Usage

resource "cloudstack_internal_loadbalancer" "app" {
  name          = "app-ilb"
  algorithm     = "roundrobin"
  source_port   = 80
  instance_port = 8080
  network_id    = cloudstack_network.app_tier.id
  member_ids    = cloudstack_instance.app.*.id
  # source_ip is optional — CloudStack auto-assigns one from the tier when omitted.
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the internal load balancer rule.

  • description - (Optional) The description of the internal load balancer rule.

  • algorithm - (Required) The load balancing algorithm. Valid values are source, roundrobin and leastconn.

  • source_port - (Required) The source (front-end) port the rule listens on.

  • instance_port - (Required) The instance (back-end) port traffic is forwarded to.

  • network_id - (Required) The ID of the network (VPC tier) the internal load balancer is created on. Changing this forces a new resource to be created.

  • source_network_id - (Optional) The ID of the network the source IP is taken from. Defaults to network_id. Changing this forces a new resource to be created.

  • source_ip - (Optional) The private source IP the rule listens on. When omitted CloudStack assigns one automatically. Changing this forces a new resource to be created.

  • member_ids - (Optional) A set of instance IDs assigned to (load balanced by) this rule.

Attributes Reference

The following attributes are exported:

  • id - The id of the internal load balancer rule.
  • source_ip - The private source IP the rule listens on (computed when not set).

Import

Internal load balancer rules can be imported; use <INTERNAL LB RULE ID> as the import ID. For example:

terraform import cloudstack_internal_loadbalancer.app 6226ea4d-9cbe-4cc9-b30c-b9532146da5b