LoadBalancer

class LoadBalancer : KotlinCustomResource

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

Properties

Link copied to clipboard
val algorithm: Output<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.

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

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

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

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

Link copied to clipboard

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

Link copied to clipboard

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

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val ip: Output<String>

The ip of the Load Balancer

Link copied to clipboard
val loadBalancerUrn: Output<String>

The uniform resource name for the Load Balancer

Link copied to clipboard
val name: Output<String>

The Load Balancer name

Link copied to clipboard
val projectId: Output<String>

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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<String>

The region to start in

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

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>

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
val status: Output<String>
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 urn: Output<String>
Link copied to clipboard
val vpcUuid: Output<String>

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