Skip to main content

load_balancers

Creates, updates, deletes, gets or lists a load_balancers resource.

Overview

Nameload_balancers
TypeResource
Iddigitalocean.load_balancers.load_balancers

Fields

NameDatatypeDescription
column_anon``

Methods

NameAccessible byRequired ParamsDescription
load_balancers_getSELECTlb_idTo show information about a load balancer instance, send a GET request to /v2/load_balancers/$LOAD_BALANCER_ID.
load_balancers_listSELECTTo list all of the load balancer instances on your account, send a GET request to /v2/load_balancers.
load_balancers_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.
load_balancers_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.
load_balancers_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.

SELECT examples

To list all of the load balancer instances on your account, send a GET request to /v2/load_balancers.

SELECT
column_anon
FROM digitalocean.load_balancers.load_balancers
;

INSERT example

Use the following StackQL query and manifest file to create a new load_balancers resource.

/*+ create */
INSERT INTO digitalocean.load_balancers.load_balancers (
data__droplet_ids,
data__region,
data__name,
data__project_id,
data__size_unit,
data__size,
data__algorithm,
data__forwarding_rules,
data__health_check,
data__sticky_sessions,
data__redirect_http_to_https,
data__enable_proxy_protocol,
data__enable_backend_keepalive,
data__http_idle_timeout_seconds,
data__vpc_uuid,
data__disable_lets_encrypt_dns_records,
data__firewall,
data__network
)
SELECT
'{{ droplet_ids }}',
'{{ region }}',
'{{ name }}',
'{{ project_id }}',
'{{ size_unit }}',
'{{ size }}',
'{{ algorithm }}',
'{{ forwarding_rules }}',
'{{ health_check }}',
'{{ sticky_sessions }}',
'{{ redirect_http_to_https }}',
'{{ enable_proxy_protocol }}',
'{{ enable_backend_keepalive }}',
'{{ http_idle_timeout_seconds }}',
'{{ vpc_uuid }}',
'{{ disable_lets_encrypt_dns_records }}',
'{{ firewall }}',
'{{ network }}'
;

DELETE example

Deletes the specified load_balancers resource.

/*+ delete */
DELETE FROM digitalocean.load_balancers.load_balancers
WHERE lb_id = '{{ lb_id }}';