LoadBalancer

Provides a DigitalOcean Load Balancer resource. This can be used to create, modify, and delete Load Balancers.

Create a LoadBalancer Resource

def LoadBalancer(resource_name, opts=None, algorithm=None, droplet_ids=None, droplet_tag=None, enable_backend_keepalive=None, enable_proxy_protocol=None, forwarding_rules=None, healthcheck=None, name=None, redirect_http_to_https=None, region=None, sticky_sessions=None, vpc_uuid=None, __props__=None);
func NewLoadBalancer(ctx *Context, name string, args LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

LoadBalancer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The LoadBalancer resource accepts the following input properties:

ForwardingRules List<Pulumi.DigitalOcean.Inputs.LoadBalancerForwardingRuleArgs>

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

Region string

The region to start in

Algorithm string

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

DropletIds List<int>

A list of the IDs of each droplet to be attached to the Load Balancer.

DropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

EnableBackendKeepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

EnableProxyProtocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

Healthcheck Pulumi.DigitalOcean.Inputs.LoadBalancerHealthcheckArgs

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

Name string

The Load Balancer name

RedirectHttpToHttps bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

StickySessions Pulumi.DigitalOcean.Inputs.LoadBalancerStickySessionsArgs

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

VpcUuid string

The ID of the VPC where the load balancer will be located.

ForwardingRules []LoadBalancerForwardingRule

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

Region string

The region to start in

Algorithm string

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

DropletIds []int

A list of the IDs of each droplet to be attached to the Load Balancer.

DropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

EnableBackendKeepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

EnableProxyProtocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

Healthcheck LoadBalancerHealthcheck

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

Name string

The Load Balancer name

RedirectHttpToHttps bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

StickySessions LoadBalancerStickySessions

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

VpcUuid string

The ID of the VPC where the load balancer will be located.

forwardingRules LoadBalancerForwardingRule[]

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

region Region

The region to start in

algorithm Algorithm

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

dropletIds number[]

A list of the IDs of each droplet to be attached to the Load Balancer.

dropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

enableBackendKeepalive boolean

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

enableProxyProtocol boolean

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

healthcheck LoadBalancerHealthcheck

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

name string

The Load Balancer name

redirectHttpToHttps boolean

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

stickySessions LoadBalancerStickySessions

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

vpcUuid string

The ID of the VPC where the load balancer will be located.

forwarding_rules List[LoadBalancerForwardingRule]

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

region str

The region to start in

algorithm str

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

droplet_ids List[Integer]

A list of the IDs of each droplet to be attached to the Load Balancer.

droplet_tag str

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

enable_backend_keepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

enable_proxy_protocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

healthcheck Dict[LoadBalancerHealthcheck]

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

name str

The Load Balancer name

redirect_http_to_https bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

sticky_sessions Dict[LoadBalancerStickySessions]

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

vpc_uuid str

The ID of the VPC where the load balancer will be located.

Outputs

All input properties are implicitly available as output properties. Additionally, the LoadBalancer resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Ip string
LoadBalancerUrn string

The uniform resource name for the Load Balancer

Status string
Id string
The provider-assigned unique ID for this managed resource.
Ip string
LoadBalancerUrn string

The uniform resource name for the Load Balancer

Status string
id string
The provider-assigned unique ID for this managed resource.
ip string
loadBalancerUrn string

The uniform resource name for the Load Balancer

status string
id str
The provider-assigned unique ID for this managed resource.
ip str
load_balancer_urn str

The uniform resource name for the Load Balancer

status str

Look up an Existing LoadBalancer Resource

Get an existing LoadBalancer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: LoadBalancerState, opts?: CustomResourceOptions): LoadBalancer
static get(resource_name, id, opts=None, algorithm=None, droplet_ids=None, droplet_tag=None, enable_backend_keepalive=None, enable_proxy_protocol=None, forwarding_rules=None, healthcheck=None, ip=None, load_balancer_urn=None, name=None, redirect_http_to_https=None, region=None, status=None, sticky_sessions=None, vpc_uuid=None, __props__=None);
func GetLoadBalancer(ctx *Context, name string, id IDInput, state *LoadBalancerState, opts ...ResourceOption) (*LoadBalancer, error)
public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Algorithm string

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

DropletIds List<int>

A list of the IDs of each droplet to be attached to the Load Balancer.

DropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

EnableBackendKeepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

EnableProxyProtocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

ForwardingRules List<Pulumi.DigitalOcean.Inputs.LoadBalancerForwardingRuleArgs>

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

Healthcheck Pulumi.DigitalOcean.Inputs.LoadBalancerHealthcheckArgs

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

Ip string
LoadBalancerUrn string

The uniform resource name for the Load Balancer

Name string

The Load Balancer name

RedirectHttpToHttps bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Region string

The region to start in

Status string
StickySessions Pulumi.DigitalOcean.Inputs.LoadBalancerStickySessionsArgs

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

VpcUuid string

The ID of the VPC where the load balancer will be located.

Algorithm string

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

DropletIds []int

A list of the IDs of each droplet to be attached to the Load Balancer.

DropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

EnableBackendKeepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

EnableProxyProtocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

ForwardingRules []LoadBalancerForwardingRule

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

Healthcheck LoadBalancerHealthcheck

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

Ip string
LoadBalancerUrn string

The uniform resource name for the Load Balancer

Name string

The Load Balancer name

RedirectHttpToHttps bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

Region string

The region to start in

Status string
StickySessions LoadBalancerStickySessions

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

VpcUuid string

The ID of the VPC where the load balancer will be located.

algorithm Algorithm

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

dropletIds number[]

A list of the IDs of each droplet to be attached to the Load Balancer.

dropletTag string

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

enableBackendKeepalive boolean

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

enableProxyProtocol boolean

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

forwardingRules LoadBalancerForwardingRule[]

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

healthcheck LoadBalancerHealthcheck

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

ip string
loadBalancerUrn string

The uniform resource name for the Load Balancer

name string

The Load Balancer name

redirectHttpToHttps boolean

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

region Region

The region to start in

status string
stickySessions LoadBalancerStickySessions

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

vpcUuid string

The ID of the VPC where the load balancer will be located.

algorithm str

The load balancing algorithm used to determine which backend Droplet will be selected by a client. It must be either round_robin or least_connections. The default value is round_robin.

droplet_ids List[Integer]

A list of the IDs of each droplet to be attached to the Load Balancer.

droplet_tag str

The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.

enable_backend_keepalive bool

A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is false.

enable_proxy_protocol bool

A boolean value indicating whether PROXY Protocol should be used to pass information from connecting client requests to the backend service. Default value is false.

forwarding_rules List[LoadBalancerForwardingRule]

A list of forwarding_rule to be assigned to the Load Balancer. The forwarding_rule block is documented below.

healthcheck Dict[LoadBalancerHealthcheck]

A healthcheck block to be assigned to the Load Balancer. The healthcheck block is documented below. Only 1 healthcheck is allowed.

ip str
load_balancer_urn str

The uniform resource name for the Load Balancer

name str

The Load Balancer name

redirect_http_to_https bool

A boolean value indicating whether HTTP requests to the Load Balancer on port 80 will be redirected to HTTPS on port 443. Default value is false.

region str

The region to start in

status str
sticky_sessions Dict[LoadBalancerStickySessions]

A sticky_sessions block to be assigned to the Load Balancer. The sticky_sessions block is documented below. Only 1 sticky_sessions block is allowed.

vpc_uuid str

The ID of the VPC where the load balancer will be located.

Supporting Types

LoadBalancerForwardingRule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

EntryPort int

An integer representing the port on which the Load Balancer instance will listen.

EntryProtocol string

The protocol used for traffic to the Load Balancer. The possible values are: http, https, http2 or tcp.

TargetPort int

An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.

TargetProtocol string

The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are: http, https, http2 or tcp.

CertificateId string

The ID of the TLS certificate to be used for SSL termination.

TlsPassthrough bool

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is false.

EntryPort int

An integer representing the port on which the Load Balancer instance will listen.

EntryProtocol string

The protocol used for traffic to the Load Balancer. The possible values are: http, https, http2 or tcp.

TargetPort int

An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.

TargetProtocol string

The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are: http, https, http2 or tcp.

CertificateId string

The ID of the TLS certificate to be used for SSL termination.

TlsPassthrough bool

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is false.

entryPort number

An integer representing the port on which the Load Balancer instance will listen.

entryProtocol string

The protocol used for traffic to the Load Balancer. The possible values are: http, https, http2 or tcp.

targetPort number

An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.

targetProtocol string

The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are: http, https, http2 or tcp.

certificateId string

The ID of the TLS certificate to be used for SSL termination.

tlsPassthrough boolean

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is false.

entryPort float

An integer representing the port on which the Load Balancer instance will listen.

entryProtocol str

The protocol used for traffic to the Load Balancer. The possible values are: http, https, http2 or tcp.

targetPort float

An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.

targetProtocol str

The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are: http, https, http2 or tcp.

certificate_id str

The ID of the TLS certificate to be used for SSL termination.

tlsPassthrough bool

A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is false.

LoadBalancerHealthcheck

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Port int

An integer representing the port on the backend Droplets on which the health check will attempt a connection.

Protocol string

The protocol used for health checks sent to the backend Droplets. The possible values are http or tcp.

CheckIntervalSeconds int

The number of seconds between between two consecutive health checks. If not specified, the default value is 10.

HealthyThreshold int

The number of times a health check must pass for a backend Droplet to be marked “healthy” and be re-added to the pool. If not specified, the default value is 5.

Path string

The path on the backend Droplets to which the Load Balancer instance will send a request.

ResponseTimeoutSeconds int

The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is 5.

UnhealthyThreshold int

The number of times a health check must fail for a backend Droplet to be marked “unhealthy” and be removed from the pool. If not specified, the default value is 3.

Port int

An integer representing the port on the backend Droplets on which the health check will attempt a connection.

Protocol string

The protocol used for health checks sent to the backend Droplets. The possible values are http or tcp.

CheckIntervalSeconds int

The number of seconds between between two consecutive health checks. If not specified, the default value is 10.

HealthyThreshold int

The number of times a health check must pass for a backend Droplet to be marked “healthy” and be re-added to the pool. If not specified, the default value is 5.

Path string

The path on the backend Droplets to which the Load Balancer instance will send a request.

ResponseTimeoutSeconds int

The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is 5.

UnhealthyThreshold int

The number of times a health check must fail for a backend Droplet to be marked “unhealthy” and be removed from the pool. If not specified, the default value is 3.

port number

An integer representing the port on the backend Droplets on which the health check will attempt a connection.

protocol string

The protocol used for health checks sent to the backend Droplets. The possible values are http or tcp.

checkIntervalSeconds number

The number of seconds between between two consecutive health checks. If not specified, the default value is 10.

healthyThreshold number

The number of times a health check must pass for a backend Droplet to be marked “healthy” and be re-added to the pool. If not specified, the default value is 5.

path string

The path on the backend Droplets to which the Load Balancer instance will send a request.

responseTimeoutSeconds number

The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is 5.

unhealthyThreshold number

The number of times a health check must fail for a backend Droplet to be marked “unhealthy” and be removed from the pool. If not specified, the default value is 3.

port float

An integer representing the port on the backend Droplets on which the health check will attempt a connection.

protocol str

The protocol used for health checks sent to the backend Droplets. The possible values are http or tcp.

checkIntervalSeconds float

The number of seconds between between two consecutive health checks. If not specified, the default value is 10.

healthyThreshold float

The number of times a health check must pass for a backend Droplet to be marked “healthy” and be re-added to the pool. If not specified, the default value is 5.

path str

The path on the backend Droplets to which the Load Balancer instance will send a request.

responseTimeoutSeconds float

The number of seconds the Load Balancer instance will wait for a response until marking a health check as failed. If not specified, the default value is 5.

unhealthyThreshold float

The number of times a health check must fail for a backend Droplet to be marked “unhealthy” and be removed from the pool. If not specified, the default value is 3.

LoadBalancerStickySessions

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

CookieName string

The name to be used for the cookie sent to the client. This attribute is required when using cookies for the sticky sessions type.

CookieTtlSeconds int

The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using cookies for the sticky sessions type.

Type string

An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are cookies or none. If not specified, the default value is none.

CookieName string

The name to be used for the cookie sent to the client. This attribute is required when using cookies for the sticky sessions type.

CookieTtlSeconds int

The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using cookies for the sticky sessions type.

Type string

An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are cookies or none. If not specified, the default value is none.

cookieName string

The name to be used for the cookie sent to the client. This attribute is required when using cookies for the sticky sessions type.

cookieTtlSeconds number

The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using cookies for the sticky sessions type.

type string

An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are cookies or none. If not specified, the default value is none.

cookieName str

The name to be used for the cookie sent to the client. This attribute is required when using cookies for the sticky sessions type.

cookieTtlSeconds float

The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using cookies for the sticky sessions type.

type str

An attribute indicating how and if requests from a client will be persistently served by the same backend Droplet. The possible values are cookies or none. If not specified, the default value is none.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.