LoadBalancer
Provides a DigitalOcean Load Balancer resource. This can be used to create, modify, and delete Load Balancers.
Create a LoadBalancer Resource
new LoadBalancer(name: string, args: LoadBalancerArgs, opts?: CustomResourceOptions);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)public LoadBalancer(string name, LoadBalancerArgs args, CustomResourceOptions? opts = null)- 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:
- Forwarding
Rules List<Pulumi.Digital Ocean. Inputs. Load Balancer Forwarding Rule Args> A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock 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_robinorleast_connections. The default value isround_robin.- Droplet
Ids List<int> A list of the IDs of each droplet to be attached to the Load Balancer.
- Droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- Enable
Backend boolKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- Enable
Proxy boolProtocol 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.
Digital Ocean. Inputs. Load Balancer Healthcheck Args A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- Name string
The Load Balancer name
- Redirect
Http boolTo Https 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 Pulumi.Digital Ocean. Inputs. Load Balancer Sticky Sessions Args A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- Vpc
Uuid string The ID of the VPC where the load balancer will be located.
- Forwarding
Rules []LoadBalancer Forwarding Rule A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock 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_robinorleast_connections. The default value isround_robin.- Droplet
Ids []int A list of the IDs of each droplet to be attached to the Load Balancer.
- Droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- Enable
Backend boolKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- Enable
Proxy boolProtocol 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
Load
Balancer Healthcheck A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- Name string
The Load Balancer name
- Redirect
Http boolTo Https 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 LoadBalancer Sticky Sessions A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- Vpc
Uuid string The ID of the VPC where the load balancer will be located.
- forwarding
Rules LoadBalancer Forwarding Rule[] A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock 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_robinorleast_connections. The default value isround_robin.- droplet
Ids number[] A list of the IDs of each droplet to be attached to the Load Balancer.
- droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- enable
Backend booleanKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- enable
Proxy booleanProtocol 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
Load
Balancer Healthcheck A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- name string
The Load Balancer name
- redirect
Http booleanTo Https 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 LoadBalancer Sticky Sessions A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- vpc
Uuid string The ID of the VPC where the load balancer will be located.
- forwarding_
rules List[LoadBalancer Forwarding Rule] A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock 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_robinorleast_connections. The default value isround_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_ boolkeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- enable_
proxy_ boolprotocol 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[Load
Balancer Healthcheck] A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- name str
The Load Balancer name
- redirect_
http_ boolto_ https 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[LoadBalancer Sticky Sessions] A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock 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:
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): LoadBalancerstatic 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_robinorleast_connections. The default value isround_robin.- Droplet
Ids List<int> A list of the IDs of each droplet to be attached to the Load Balancer.
- Droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- Enable
Backend boolKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- Enable
Proxy boolProtocol 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<Pulumi.Digital Ocean. Inputs. Load Balancer Forwarding Rule Args> A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock is documented below.- Healthcheck
Pulumi.
Digital Ocean. Inputs. Load Balancer Healthcheck Args A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- Ip string
- Load
Balancer stringUrn The uniform resource name for the Load Balancer
- Name string
The Load Balancer name
- Redirect
Http boolTo Https 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
- Sticky
Sessions Pulumi.Digital Ocean. Inputs. Load Balancer Sticky Sessions Args A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- Vpc
Uuid 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_robinorleast_connections. The default value isround_robin.- Droplet
Ids []int A list of the IDs of each droplet to be attached to the Load Balancer.
- Droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- Enable
Backend boolKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- Enable
Proxy boolProtocol 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 []LoadBalancer Forwarding Rule A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock is documented below.- Healthcheck
Load
Balancer Healthcheck A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- Ip string
- Load
Balancer stringUrn The uniform resource name for the Load Balancer
- Name string
The Load Balancer name
- Redirect
Http boolTo Https 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
- Sticky
Sessions LoadBalancer Sticky Sessions A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- Vpc
Uuid 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_robinorleast_connections. The default value isround_robin.- droplet
Ids number[] A list of the IDs of each droplet to be attached to the Load Balancer.
- droplet
Tag string The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer.
- enable
Backend booleanKeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- enable
Proxy booleanProtocol 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 LoadBalancer Forwarding Rule[] A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock is documented below.- healthcheck
Load
Balancer Healthcheck A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- ip string
- load
Balancer stringUrn The uniform resource name for the Load Balancer
- name string
The Load Balancer name
- redirect
Http booleanTo Https 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
- sticky
Sessions LoadBalancer Sticky Sessions A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock is documented below. Only 1 sticky_sessions block is allowed.- vpc
Uuid 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_robinorleast_connections. The default value isround_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_ boolkeepalive A boolean value indicating whether HTTP keepalive connections are maintained to target Droplets. Default value is
false.- enable_
proxy_ boolprotocol 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[LoadBalancer Forwarding Rule] A list of
forwarding_ruleto be assigned to the Load Balancer. Theforwarding_ruleblock is documented below.- healthcheck
Dict[Load
Balancer Healthcheck] A
healthcheckblock to be assigned to the Load Balancer. Thehealthcheckblock is documented below. Only 1 healthcheck is allowed.- ip str
- load_
balancer_ strurn The uniform resource name for the Load Balancer
- name str
The Load Balancer name
- redirect_
http_ boolto_ https 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[LoadBalancer Sticky Sessions] A
sticky_sessionsblock to be assigned to the Load Balancer. Thesticky_sessionsblock 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
- Entry
Port int An integer representing the port on which the Load Balancer instance will listen.
- Entry
Protocol string The protocol used for traffic to the Load Balancer. The possible values are:
http,https,http2ortcp.- Target
Port int An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.
- Target
Protocol string The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are:
http,https,http2ortcp.- Certificate
Id string The ID of the TLS certificate to be used for SSL termination.
- Tls
Passthrough bool A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is
false.
- Entry
Port int An integer representing the port on which the Load Balancer instance will listen.
- Entry
Protocol string The protocol used for traffic to the Load Balancer. The possible values are:
http,https,http2ortcp.- Target
Port int An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.
- Target
Protocol string The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are:
http,https,http2ortcp.- Certificate
Id string The ID of the TLS certificate to be used for SSL termination.
- Tls
Passthrough bool A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is
false.
- entry
Port number An integer representing the port on which the Load Balancer instance will listen.
- entry
Protocol string The protocol used for traffic to the Load Balancer. The possible values are:
http,https,http2ortcp.- target
Port number An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.
- target
Protocol string The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are:
http,https,http2ortcp.- certificate
Id string The ID of the TLS certificate to be used for SSL termination.
- tls
Passthrough boolean A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is
false.
- entry
Port float An integer representing the port on which the Load Balancer instance will listen.
- entry
Protocol str The protocol used for traffic to the Load Balancer. The possible values are:
http,https,http2ortcp.- target
Port float An integer representing the port on the backend Droplets to which the Load Balancer will send traffic.
- target
Protocol str The protocol used for traffic from the Load Balancer to the backend Droplets. The possible values are:
http,https,http2ortcp.- certificate_
id str The ID of the TLS certificate to be used for SSL termination.
- tls
Passthrough bool A boolean value indicating whether SSL encrypted traffic will be passed through to the backend Droplets. The default value is
false.
LoadBalancerHealthcheck
- 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
httportcp.- Check
Interval intSeconds The number of seconds between between two consecutive health checks. If not specified, the default value is
10.- Healthy
Threshold 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.
- Response
Timeout intSeconds 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.- Unhealthy
Threshold 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
httportcp.- Check
Interval intSeconds The number of seconds between between two consecutive health checks. If not specified, the default value is
10.- Healthy
Threshold 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.
- Response
Timeout intSeconds 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.- Unhealthy
Threshold 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
httportcp.- check
Interval numberSeconds The number of seconds between between two consecutive health checks. If not specified, the default value is
10.- healthy
Threshold 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.
- response
Timeout numberSeconds 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.- unhealthy
Threshold 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
httportcp.- check
Interval floatSeconds The number of seconds between between two consecutive health checks. If not specified, the default value is
10.- healthy
Threshold 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.
- response
Timeout floatSeconds 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.- unhealthy
Threshold 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
- string
The name to be used for the cookie sent to the client. This attribute is required when using
cookiesfor the sticky sessions type.- int
The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using
cookiesfor 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
cookiesornone. If not specified, the default value isnone.
- string
The name to be used for the cookie sent to the client. This attribute is required when using
cookiesfor the sticky sessions type.- int
The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using
cookiesfor 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
cookiesornone. If not specified, the default value isnone.
- string
The name to be used for the cookie sent to the client. This attribute is required when using
cookiesfor the sticky sessions type.- number
The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using
cookiesfor 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
cookiesornone. If not specified, the default value isnone.
- str
The name to be used for the cookie sent to the client. This attribute is required when using
cookiesfor the sticky sessions type.- float
The number of seconds until the cookie set by the Load Balancer expires. This attribute is required when using
cookiesfor 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
cookiesornone. If not specified, the default value isnone.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.