Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 4.02 KB

loadbalancer.html.md

File metadata and controls

106 lines (77 loc) · 4.02 KB
layout page_title sidebar_current description
gridscale
gridscale: loadbalancer
docs-gridscale-resource-loadbalancer
Manage a loadbalancer in gridscale.

gridscale_loadbalancer

Provides a loadbalancer resource. This can be used to create, modify, and delete load balancers.

Example Usage

resource "gridscale_loadbalancer" "foo" {
  name   = "test-lb"
  algorithm = "leastconn"
  redirect_http_to_https = false
  listen_ipv4_uuid = gridscale_ipv4.lb.id
  listen_ipv6_uuid = gridscale_ipv6.lb.id
  labels = []
  backend_server {
    weight = 100
    host   = gridscale_ipv4.server.ip
  }
  forwarding_rule {
    listen_port =  80
    mode        =  "http"
    target_port =  80
  }
  timeouts {
      create="10m"
  }
}

Argument Reference

The following arguments are supported:

  • name - (Required) The human-readable name of the object. It supports the full UTF-8 character set, with a maximum of 64 characters.

  • redirect_http_to_https - (Required) Whether the load balancer is forced to redirect requests from HTTP to HTTPS.

  • listen_ipv4_uuid - (Required) The UUID of the IPv4 address the load balancer will listen to for incoming requests.

  • listen_ipv6_uuid - (Required) The UUID of the IPv6 address the load balancer will listen to for incoming requests.

  • algorithm - (Required) The algorithm used to process requests. Accepted values: roundrobin/leastconn.

  • backend_server - (Required) The servers that the load balancer can communicate with.

    • host - (Required) A valid domain or an IP address of a server.

    • weight - (Optional) The backend host weight. Default: 100.

    • proxy_protocol - (Optional) The proxy protocol version. The proxy protocol is disabled by default and the valid version is either v1 or v2.

  • forwarding_rule - (Required) The forwarding rules of the load balancer.

    • letsencrypt_ssl - (Optional) A valid domain name that points to the loadbalancer's IP address.

    • certificate_uuid - (Optional) The UUID of a custom certificate.

    • listen_port - (Required) Specifies the entry port of the load balancer.

    • target_port - (Required) Specifies the exit port that the load balancer uses to forward the traffic to the backend server.

    • mode - (Required) Supports HTTP and TCP mode. Valid values: http, tcp.

  • labels - (Optional) List of labels in the format [ "label1", "label2" ].

Timeouts

Timeouts configuration options (in seconds): More info: terraform.io/docs/configuration/resources.html#operation-timeouts

  • create - (Default value is "5m" - 5 minutes) Used for creating a resource.
  • update - (Default value is "5m" - 5 minutes) Used for updating a resource.
  • delete - (Default value is "5m" - 5 minutes) Used for deleting a resource.

Attributes

This resource exports the following attributes:

  • id - The UUID of the load balancer.
  • location_uuid - The location this load balancer is placed. The location of a resource is determined by it's project.
  • name - The human-readable name of the load balancer.
  • algorithm - The algorithm used to process requests.
  • status - The status of the load balancer.
  • redirect_http_to_https - Whether the Load balancer is forced to redirect requests from HTTP to HTTPS.
  • listen_ipv4_uuid - The UUID of the IPv4 address the load balancer will listen to for incoming requests.
  • listen_ipv6_uuid - The UUID of the IPv6 address the load balancer will listen to for incoming requests.
  • backend_server - See Argument Reference above.
    • host - See Argument Reference above.
    • weight - See Argument Reference above.
    • proxy_protocol - See Argument Reference above.
  • forwarding_rule - See Argument Reference above.
    • letsencrypt_ssl - See Argument Reference above.
    • certificate_uuid - See Argument Reference above.
    • listen_port - See Argument Reference above.
    • target_port - See Argument Reference above.
    • mode - See Argument Reference above.
  • labels - The list of labels.