Skip to main content

load_balancers

Overview

Nameload_balancers
TypeResource
Iddigitalocean.load_balancers.load_balancers

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference a load balancer.
namestringA human-readable name for a load balancer instance.
ipstringAn attribute containing the public-facing IP address of the load balancer.
enable_proxy_protocolbooleanA boolean value indicating whether PROXY Protocol is in use.
redirect_http_to_httpsbooleanA boolean value indicating whether HTTP requests to the load balancer on port 80 will be redirected to HTTPS on port 443.
enable_backend_keepalivebooleanA boolean value indicating whether HTTP keepalive connections are maintained to target Droplets.
regionobjectThe region where the load balancer instance is located. When setting a region, the value should be the slug identifier for the region. When you query a load balancer, an entire region object will be returned.
project_idstringThe ID of the project that the load balancer is associated with. If no ID is provided at creation, the load balancer associates with the user's default project. If an invalid project ID is provided, the load balancer will not be created.
health_checkobjectAn object specifying health check settings for the load balancer.
vpc_uuidstringA string specifying the UUID of the VPC to which the load balancer is assigned.
sizestringThis field has been replaced by the size_unit field for all regions except in AMS2, NYC2, and SFO1. Each available load balancer size now equates to the load balancer having a set number of nodes.
lb-small = 1 node
lb-medium = 3 nodes
* lb-large = 6 nodes

You can resize load balancers after creation up to once per hour. You cannot resize a load balancer within the first hour of its creation.
sticky_sessionsobjectAn object specifying sticky sessions settings for the load balancer.
algorithmstringThis field has been deprecated. You can no longer specify an algorithm for load balancers.
size_unitintegerHow many nodes the load balancer contains. Each additional node increases the load balancer's ability to manage more connections. Load balancers can be scaled up or down, and you can change the number of nodes after creation up to once per hour. This field is currently not available in the AMS2, NYC2, or SFO1 regions. Use the size field to scale load balancers that reside in these regions.
http_idle_timeout_secondsintegerAn integer value which configures the idle timeout for HTTP requests to the target droplets.
disable_lets_encrypt_dns_recordsbooleanA boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer.
droplet_idsarrayAn array containing the IDs of the Droplets assigned to the load balancer.
tagstringThe name of a Droplet tag corresponding to Droplets assigned to the load balancer.
firewallobjectAn object specifying allow and deny rules to control traffic to the load balancer.
statusstringA status string indicating the current state of the load balancer. This can be new, active, or errored.
forwarding_rulesarrayAn array of objects specifying the forwarding rules for a load balancer.
created_atstringA time value given in ISO8601 combined date and time format that represents when the load balancer was created.

Methods

NameAccessible byRequired ParamsDescription
loadBalancers_getSELECTlb_idTo show information about a load balancer instance, send a GET request to
/v2/load_balancers/$LOAD_BALANCER_ID.
loadBalancers_listSELECTTo list all of the load balancer instances on your account, send a GET request
to /v2/load_balancers.
loadBalancers_createINSERTTo create a new load balancer instance, send a POST request to
/v2/load_balancers.

You can specify the Droplets that will sit behind the load balancer using one
of two methods:

Set droplet_ids to a list of specific Droplet IDs.
Set tag to the name of a tag. All Droplets with this tag applied will be
assigned to the load balancer. Additional Droplets will be automatically
assigned as they are tagged.

These methods are mutually exclusive.
loadBalancers_deleteDELETElb_idTo delete a load balancer instance, disassociating any Droplets assigned to it
and removing it from your account, send a DELETE request to
/v2/load_balancers/$LOAD_BALANCER_ID.

A successful request will receive a 204 status code with no body in response.
This indicates that the request was processed successfully.
_loadBalancers_getEXEClb_idTo show information about a load balancer instance, send a GET request to
/v2/load_balancers/$LOAD_BALANCER_ID.
_loadBalancers_listEXECTo list all of the load balancer instances on your account, send a GET request
to /v2/load_balancers.
loadBalancers_updateEXEClb_idTo update a load balancer's settings, send a PUT request to
/v2/load_balancers/$LOAD_BALANCER_ID. The request should contain a full
representation of the load balancer including existing attributes. It may
contain one of the droplets_ids or tag attributes as they are mutually
exclusive. Note that any attribute that is not provided will be reset to its
default value.