LoadBalancerArgs

data class LoadBalancerArgs(val algorithm: Output<Either<String, Algorithm>>? = null, val disableLetsEncryptDnsRecords: Output<Boolean>? = null, val dropletIds: Output<List<Int>>? = null, val dropletTag: Output<String>? = null, val enableBackendKeepalive: Output<Boolean>? = null, val enableProxyProtocol: Output<Boolean>? = null, val firewall: Output<LoadBalancerFirewallArgs>? = null, val forwardingRules: Output<List<LoadBalancerForwardingRuleArgs>>? = null, val healthcheck: Output<LoadBalancerHealthcheckArgs>? = null, val httpIdleTimeoutSeconds: Output<Int>? = null, val name: Output<String>? = null, val projectId: Output<String>? = null, val redirectHttpToHttps: Output<Boolean>? = null, val region: Output<Either<String, Region>>? = null, val size: Output<String>? = null, val sizeUnit: Output<Int>? = null, val stickySessions: Output<LoadBalancerStickySessionsArgs>? = null, val vpcUuid: Output<String>? = null) : ConvertibleToJava<LoadBalancerArgs>

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

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.Droplet;
import com.pulumi.digitalocean.DropletArgs;
import com.pulumi.digitalocean.LoadBalancer;
import com.pulumi.digitalocean.LoadBalancerArgs;
import com.pulumi.digitalocean.inputs.LoadBalancerForwardingRuleArgs;
import com.pulumi.digitalocean.inputs.LoadBalancerHealthcheckArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var web = new Droplet("web", DropletArgs.builder()
.size("s-1vcpu-1gb")
.image("ubuntu-18-04-x64")
.region("nyc3")
.build());
var public_ = new LoadBalancer("public", LoadBalancerArgs.builder()
.region("nyc3")
.forwardingRules(LoadBalancerForwardingRuleArgs.builder()
.entryPort(80)
.entryProtocol("http")
.targetPort(80)
.targetProtocol("http")
.build())
.healthcheck(LoadBalancerHealthcheckArgs.builder()
.port(22)
.protocol("tcp")
.build())
.dropletIds(web.id())
.build());
}
}

Import

Load Balancers can be imported using the id, e.g.

$ pulumi import digitalocean:index/loadBalancer:LoadBalancer myloadbalancer 4de7ac8b-495b-4884-9a69-1050c6793cd6

Constructors

Link copied to clipboard
fun LoadBalancerArgs(algorithm: Output<Either<String, Algorithm>>? = null, disableLetsEncryptDnsRecords: Output<Boolean>? = null, dropletIds: Output<List<Int>>? = null, dropletTag: Output<String>? = null, enableBackendKeepalive: Output<Boolean>? = null, enableProxyProtocol: Output<Boolean>? = null, firewall: Output<LoadBalancerFirewallArgs>? = null, forwardingRules: Output<List<LoadBalancerForwardingRuleArgs>>? = null, healthcheck: Output<LoadBalancerHealthcheckArgs>? = null, httpIdleTimeoutSeconds: Output<Int>? = null, name: Output<String>? = null, projectId: Output<String>? = null, redirectHttpToHttps: Output<Boolean>? = null, region: Output<Either<String, Region>>? = null, size: Output<String>? = null, sizeUnit: Output<Int>? = null, stickySessions: Output<LoadBalancerStickySessionsArgs>? = null, vpcUuid: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): LoadBalancerArgs

Properties

Link copied to clipboard
val algorithm: Output<Either<String, Algorithm>>? = null

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.

Link copied to clipboard

A boolean value indicating whether to disable automatic DNS record creation for Let's Encrypt certificates that are added to the load balancer. Default value is false.

Link copied to clipboard
val dropletIds: Output<List<Int>>? = null

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

Link copied to clipboard
val dropletTag: Output<String>? = null

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

Link copied to clipboard
val enableBackendKeepalive: Output<Boolean>? = null

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

Link copied to clipboard
val enableProxyProtocol: Output<Boolean>? = null

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.

Link copied to clipboard
val firewall: Output<LoadBalancerFirewallArgs>? = null

A block containing rules for allowing/denying traffic to the Load Balancer. The firewall block is documented below. Only 1 firewall is allowed.

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
val httpIdleTimeoutSeconds: Output<Int>? = null

Specifies the idle timeout for HTTPS connections on the load balancer in seconds.

Link copied to clipboard
val name: Output<String>? = null

The Load Balancer name

Link copied to clipboard
val projectId: Output<String>? = null

The 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.

Link copied to clipboard
val redirectHttpToHttps: Output<Boolean>? = null

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.

Link copied to clipboard
val region: Output<Either<String, Region>>? = null

The region to start in

Link copied to clipboard
val size: Output<String>? = null

The size of the Load Balancer. It must be either lb-small, lb-medium, or lb-large. Defaults to lb-small. Only one of size or size_unit may be provided.

Link copied to clipboard
val sizeUnit: Output<Int>? = null

The size of the Load Balancer. It must be in the range (1, 100). Defaults to 1. Only one of size or size_unit may be provided.

Link copied to clipboard

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.

Link copied to clipboard
val vpcUuid: Output<String>? = null

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