1. Packages
  2. Vultr
  3. API Docs
  4. LoadBalancer
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

vultr.LoadBalancer

Explore with Pulumi AI

Get information about a Vultr load balancer.

Example Usage

Create a new load balancer:

import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";

const lb = new vultr.LoadBalancer("lb", {
    balancingAlgorithm: "roundrobin",
    forwardingRules: [{
        backendPort: 81,
        backendProtocol: "http",
        frontendPort: 82,
        frontendProtocol: "http",
    }],
    healthCheck: {
        checkInterval: 3,
        healthyThreshold: 4,
        path: "/test",
        port: 8080,
        protocol: "http",
        responseTimeout: 1,
        unhealthyThreshold: 2,
    },
    label: "vultr-load-balancer",
    region: "ewr",
});
Copy
import pulumi
import ediri_vultr as vultr

lb = vultr.LoadBalancer("lb",
    balancing_algorithm="roundrobin",
    forwarding_rules=[{
        "backend_port": 81,
        "backend_protocol": "http",
        "frontend_port": 82,
        "frontend_protocol": "http",
    }],
    health_check={
        "check_interval": 3,
        "healthy_threshold": 4,
        "path": "/test",
        "port": 8080,
        "protocol": "http",
        "response_timeout": 1,
        "unhealthy_threshold": 2,
    },
    label="vultr-load-balancer",
    region="ewr")
Copy
package main

import (
	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vultr.NewLoadBalancer(ctx, "lb", &vultr.LoadBalancerArgs{
			BalancingAlgorithm: pulumi.String("roundrobin"),
			ForwardingRules: vultr.LoadBalancerForwardingRuleArray{
				&vultr.LoadBalancerForwardingRuleArgs{
					BackendPort:      pulumi.Int(81),
					BackendProtocol:  pulumi.String("http"),
					FrontendPort:     pulumi.Int(82),
					FrontendProtocol: pulumi.String("http"),
				},
			},
			HealthCheck: &vultr.LoadBalancerHealthCheckArgs{
				CheckInterval:      pulumi.Int(3),
				HealthyThreshold:   pulumi.Int(4),
				Path:               pulumi.String("/test"),
				Port:               pulumi.Int(8080),
				Protocol:           pulumi.String("http"),
				ResponseTimeout:    pulumi.Int(1),
				UnhealthyThreshold: pulumi.Int(2),
			},
			Label:  pulumi.String("vultr-load-balancer"),
			Region: pulumi.String("ewr"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;

return await Deployment.RunAsync(() => 
{
    var lb = new Vultr.LoadBalancer("lb", new()
    {
        BalancingAlgorithm = "roundrobin",
        ForwardingRules = new[]
        {
            new Vultr.Inputs.LoadBalancerForwardingRuleArgs
            {
                BackendPort = 81,
                BackendProtocol = "http",
                FrontendPort = 82,
                FrontendProtocol = "http",
            },
        },
        HealthCheck = new Vultr.Inputs.LoadBalancerHealthCheckArgs
        {
            CheckInterval = 3,
            HealthyThreshold = 4,
            Path = "/test",
            Port = 8080,
            Protocol = "http",
            ResponseTimeout = 1,
            UnhealthyThreshold = 2,
        },
        Label = "vultr-load-balancer",
        Region = "ewr",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.LoadBalancer;
import com.pulumi.vultr.LoadBalancerArgs;
import com.pulumi.vultr.inputs.LoadBalancerForwardingRuleArgs;
import com.pulumi.vultr.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 lb = new LoadBalancer("lb", LoadBalancerArgs.builder()
            .balancingAlgorithm("roundrobin")
            .forwardingRules(LoadBalancerForwardingRuleArgs.builder()
                .backendPort(81)
                .backendProtocol("http")
                .frontendPort(82)
                .frontendProtocol("http")
                .build())
            .healthCheck(LoadBalancerHealthCheckArgs.builder()
                .checkInterval(3)
                .healthyThreshold(4)
                .path("/test")
                .port(8080)
                .protocol("http")
                .responseTimeout(1)
                .unhealthyThreshold(2)
                .build())
            .label("vultr-load-balancer")
            .region("ewr")
            .build());

    }
}
Copy
resources:
  lb:
    type: vultr:LoadBalancer
    properties:
      balancingAlgorithm: roundrobin
      forwardingRules:
        - backendPort: 81
          backendProtocol: http
          frontendPort: 82
          frontendProtocol: http
      healthCheck:
        checkInterval: 3
        healthyThreshold: 4
        path: /test
        port: 8080
        protocol: http
        responseTimeout: 1
        unhealthyThreshold: 2
      label: vultr-load-balancer
      region: ewr
Copy

Create LoadBalancer Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new LoadBalancer(name: string, args: LoadBalancerArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancer(resource_name: str,
                 args: LoadBalancerArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def LoadBalancer(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 forwarding_rules: Optional[Sequence[LoadBalancerForwardingRuleArgs]] = None,
                 region: Optional[str] = None,
                 attached_instances: Optional[Sequence[str]] = None,
                 balancing_algorithm: Optional[str] = None,
                 cookie_name: Optional[str] = None,
                 firewall_rules: Optional[Sequence[LoadBalancerFirewallRuleArgs]] = None,
                 health_check: Optional[LoadBalancerHealthCheckArgs] = None,
                 label: Optional[str] = None,
                 proxy_protocol: Optional[bool] = None,
                 ssl: Optional[LoadBalancerSslArgs] = None,
                 ssl_redirect: Optional[bool] = None,
                 vpc: Optional[str] = None)
func NewLoadBalancer(ctx *Context, name string, args LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)
public LoadBalancer(string name, LoadBalancerArgs args, CustomResourceOptions? opts = null)
public LoadBalancer(String name, LoadBalancerArgs args)
public LoadBalancer(String name, LoadBalancerArgs args, CustomResourceOptions options)
type: vultr:LoadBalancer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LoadBalancerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LoadBalancerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LoadBalancerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var loadBalancerResource = new Vultr.LoadBalancer("loadBalancerResource", new()
{
    ForwardingRules = new[]
    {
        new Vultr.Inputs.LoadBalancerForwardingRuleArgs
        {
            BackendPort = 0,
            BackendProtocol = "string",
            FrontendPort = 0,
            FrontendProtocol = "string",
            RuleId = "string",
        },
    },
    Region = "string",
    AttachedInstances = new[]
    {
        "string",
    },
    BalancingAlgorithm = "string",
    CookieName = "string",
    FirewallRules = new[]
    {
        new Vultr.Inputs.LoadBalancerFirewallRuleArgs
        {
            IpType = "string",
            Port = 0,
            Source = "string",
            Id = "string",
        },
    },
    HealthCheck = new Vultr.Inputs.LoadBalancerHealthCheckArgs
    {
        Port = 0,
        Protocol = "string",
        CheckInterval = 0,
        HealthyThreshold = 0,
        Path = "string",
        ResponseTimeout = 0,
        UnhealthyThreshold = 0,
    },
    Label = "string",
    ProxyProtocol = false,
    Ssl = new Vultr.Inputs.LoadBalancerSslArgs
    {
        Certificate = "string",
        PrivateKey = "string",
        Chain = "string",
    },
    SslRedirect = false,
    Vpc = "string",
});
Copy
example, err := vultr.NewLoadBalancer(ctx, "loadBalancerResource", &vultr.LoadBalancerArgs{
	ForwardingRules: vultr.LoadBalancerForwardingRuleArray{
		&vultr.LoadBalancerForwardingRuleArgs{
			BackendPort:      pulumi.Int(0),
			BackendProtocol:  pulumi.String("string"),
			FrontendPort:     pulumi.Int(0),
			FrontendProtocol: pulumi.String("string"),
			RuleId:           pulumi.String("string"),
		},
	},
	Region: pulumi.String("string"),
	AttachedInstances: pulumi.StringArray{
		pulumi.String("string"),
	},
	BalancingAlgorithm: pulumi.String("string"),
	CookieName:         pulumi.String("string"),
	FirewallRules: vultr.LoadBalancerFirewallRuleArray{
		&vultr.LoadBalancerFirewallRuleArgs{
			IpType: pulumi.String("string"),
			Port:   pulumi.Int(0),
			Source: pulumi.String("string"),
			Id:     pulumi.String("string"),
		},
	},
	HealthCheck: &vultr.LoadBalancerHealthCheckArgs{
		Port:               pulumi.Int(0),
		Protocol:           pulumi.String("string"),
		CheckInterval:      pulumi.Int(0),
		HealthyThreshold:   pulumi.Int(0),
		Path:               pulumi.String("string"),
		ResponseTimeout:    pulumi.Int(0),
		UnhealthyThreshold: pulumi.Int(0),
	},
	Label:         pulumi.String("string"),
	ProxyProtocol: pulumi.Bool(false),
	Ssl: &vultr.LoadBalancerSslArgs{
		Certificate: pulumi.String("string"),
		PrivateKey:  pulumi.String("string"),
		Chain:       pulumi.String("string"),
	},
	SslRedirect: pulumi.Bool(false),
	Vpc:         pulumi.String("string"),
})
Copy
var loadBalancerResource = new LoadBalancer("loadBalancerResource", LoadBalancerArgs.builder()
    .forwardingRules(LoadBalancerForwardingRuleArgs.builder()
        .backendPort(0)
        .backendProtocol("string")
        .frontendPort(0)
        .frontendProtocol("string")
        .ruleId("string")
        .build())
    .region("string")
    .attachedInstances("string")
    .balancingAlgorithm("string")
    .cookieName("string")
    .firewallRules(LoadBalancerFirewallRuleArgs.builder()
        .ipType("string")
        .port(0)
        .source("string")
        .id("string")
        .build())
    .healthCheck(LoadBalancerHealthCheckArgs.builder()
        .port(0)
        .protocol("string")
        .checkInterval(0)
        .healthyThreshold(0)
        .path("string")
        .responseTimeout(0)
        .unhealthyThreshold(0)
        .build())
    .label("string")
    .proxyProtocol(false)
    .ssl(LoadBalancerSslArgs.builder()
        .certificate("string")
        .privateKey("string")
        .chain("string")
        .build())
    .sslRedirect(false)
    .vpc("string")
    .build());
Copy
load_balancer_resource = vultr.LoadBalancer("loadBalancerResource",
    forwarding_rules=[{
        "backend_port": 0,
        "backend_protocol": "string",
        "frontend_port": 0,
        "frontend_protocol": "string",
        "rule_id": "string",
    }],
    region="string",
    attached_instances=["string"],
    balancing_algorithm="string",
    cookie_name="string",
    firewall_rules=[{
        "ip_type": "string",
        "port": 0,
        "source": "string",
        "id": "string",
    }],
    health_check={
        "port": 0,
        "protocol": "string",
        "check_interval": 0,
        "healthy_threshold": 0,
        "path": "string",
        "response_timeout": 0,
        "unhealthy_threshold": 0,
    },
    label="string",
    proxy_protocol=False,
    ssl={
        "certificate": "string",
        "private_key": "string",
        "chain": "string",
    },
    ssl_redirect=False,
    vpc="string")
Copy
const loadBalancerResource = new vultr.LoadBalancer("loadBalancerResource", {
    forwardingRules: [{
        backendPort: 0,
        backendProtocol: "string",
        frontendPort: 0,
        frontendProtocol: "string",
        ruleId: "string",
    }],
    region: "string",
    attachedInstances: ["string"],
    balancingAlgorithm: "string",
    cookieName: "string",
    firewallRules: [{
        ipType: "string",
        port: 0,
        source: "string",
        id: "string",
    }],
    healthCheck: {
        port: 0,
        protocol: "string",
        checkInterval: 0,
        healthyThreshold: 0,
        path: "string",
        responseTimeout: 0,
        unhealthyThreshold: 0,
    },
    label: "string",
    proxyProtocol: false,
    ssl: {
        certificate: "string",
        privateKey: "string",
        chain: "string",
    },
    sslRedirect: false,
    vpc: "string",
});
Copy
type: vultr:LoadBalancer
properties:
    attachedInstances:
        - string
    balancingAlgorithm: string
    cookieName: string
    firewallRules:
        - id: string
          ipType: string
          port: 0
          source: string
    forwardingRules:
        - backendPort: 0
          backendProtocol: string
          frontendPort: 0
          frontendProtocol: string
          ruleId: string
    healthCheck:
        checkInterval: 0
        healthyThreshold: 0
        path: string
        port: 0
        protocol: string
        responseTimeout: 0
        unhealthyThreshold: 0
    label: string
    proxyProtocol: false
    region: string
    ssl:
        certificate: string
        chain: string
        privateKey: string
    sslRedirect: false
    vpc: string
Copy

LoadBalancer Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The LoadBalancer resource accepts the following input properties:

ForwardingRules This property is required. List<ediri.Vultr.Inputs.LoadBalancerForwardingRule>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
Region
This property is required.
Changes to this property will trigger replacement.
string
The region your load balancer is deployed in.
AttachedInstances List<string>
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
CookieName string
Name for your given sticky session.
FirewallRules List<ediri.Vultr.Inputs.LoadBalancerFirewallRule>
Defines the firewall rules for a load balancer.
HealthCheck ediri.Vultr.Inputs.LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
Label string
The load balancer's label.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
Ssl ediri.Vultr.Inputs.LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Vpc string
A VPC ID that the load balancer should be attached to.
ForwardingRules This property is required. []LoadBalancerForwardingRuleArgs
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
Region
This property is required.
Changes to this property will trigger replacement.
string
The region your load balancer is deployed in.
AttachedInstances []string
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
CookieName string
Name for your given sticky session.
FirewallRules []LoadBalancerFirewallRuleArgs
Defines the firewall rules for a load balancer.
HealthCheck LoadBalancerHealthCheckArgs
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
Label string
The load balancer's label.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
Ssl LoadBalancerSslArgs
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Vpc string
A VPC ID that the load balancer should be attached to.
forwardingRules This property is required. List<LoadBalancerForwardingRule>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
region
This property is required.
Changes to this property will trigger replacement.
String
The region your load balancer is deployed in.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName String
Name for your given sticky session.
firewallRules List<LoadBalancerFirewallRule>
Defines the firewall rules for a load balancer.
healthCheck LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
label String
The load balancer's label.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
ssl LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
vpc String
A VPC ID that the load balancer should be attached to.
forwardingRules This property is required. LoadBalancerForwardingRule[]
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
region
This property is required.
Changes to this property will trigger replacement.
string
The region your load balancer is deployed in.
attachedInstances string[]
Array of instances that are currently attached to the load balancer.
balancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName string
Name for your given sticky session.
firewallRules LoadBalancerFirewallRule[]
Defines the firewall rules for a load balancer.
healthCheck LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
label string
The load balancer's label.
proxyProtocol boolean
Boolean value that indicates if Proxy Protocol is enabled.
ssl LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
vpc string
A VPC ID that the load balancer should be attached to.
forwarding_rules This property is required. Sequence[LoadBalancerForwardingRuleArgs]
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
region
This property is required.
Changes to this property will trigger replacement.
str
The region your load balancer is deployed in.
attached_instances Sequence[str]
Array of instances that are currently attached to the load balancer.
balancing_algorithm str
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookie_name str
Name for your given sticky session.
firewall_rules Sequence[LoadBalancerFirewallRuleArgs]
Defines the firewall rules for a load balancer.
health_check LoadBalancerHealthCheckArgs
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
label str
The load balancer's label.
proxy_protocol bool
Boolean value that indicates if Proxy Protocol is enabled.
ssl LoadBalancerSslArgs
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
ssl_redirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
vpc str
A VPC ID that the load balancer should be attached to.
forwardingRules This property is required. List<Property Map>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
region
This property is required.
Changes to this property will trigger replacement.
String
The region your load balancer is deployed in.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName String
Name for your given sticky session.
firewallRules List<Property Map>
Defines the firewall rules for a load balancer.
healthCheck Property Map
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
label String
The load balancer's label.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
ssl Property Map
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
vpc String
A VPC ID that the load balancer should be attached to.

Outputs

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

HasSsl bool
Boolean value that indicates if SSL is enabled.
Id string
The provider-assigned unique ID for this managed resource.
Ipv4 string
IPv4 address for your load balancer.
Ipv6 string
IPv6 address for your load balancer.
Status string
Current status for the load balancer
HasSsl bool
Boolean value that indicates if SSL is enabled.
Id string
The provider-assigned unique ID for this managed resource.
Ipv4 string
IPv4 address for your load balancer.
Ipv6 string
IPv6 address for your load balancer.
Status string
Current status for the load balancer
hasSsl Boolean
Boolean value that indicates if SSL is enabled.
id String
The provider-assigned unique ID for this managed resource.
ipv4 String
IPv4 address for your load balancer.
ipv6 String
IPv6 address for your load balancer.
status String
Current status for the load balancer
hasSsl boolean
Boolean value that indicates if SSL is enabled.
id string
The provider-assigned unique ID for this managed resource.
ipv4 string
IPv4 address for your load balancer.
ipv6 string
IPv6 address for your load balancer.
status string
Current status for the load balancer
has_ssl bool
Boolean value that indicates if SSL is enabled.
id str
The provider-assigned unique ID for this managed resource.
ipv4 str
IPv4 address for your load balancer.
ipv6 str
IPv6 address for your load balancer.
status str
Current status for the load balancer
hasSsl Boolean
Boolean value that indicates if SSL is enabled.
id String
The provider-assigned unique ID for this managed resource.
ipv4 String
IPv4 address for your load balancer.
ipv6 String
IPv6 address for your load balancer.
status String
Current status for the load balancer

Look up 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
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attached_instances: Optional[Sequence[str]] = None,
        balancing_algorithm: Optional[str] = None,
        cookie_name: Optional[str] = None,
        firewall_rules: Optional[Sequence[LoadBalancerFirewallRuleArgs]] = None,
        forwarding_rules: Optional[Sequence[LoadBalancerForwardingRuleArgs]] = None,
        has_ssl: Optional[bool] = None,
        health_check: Optional[LoadBalancerHealthCheckArgs] = None,
        ipv4: Optional[str] = None,
        ipv6: Optional[str] = None,
        label: Optional[str] = None,
        proxy_protocol: Optional[bool] = None,
        region: Optional[str] = None,
        ssl: Optional[LoadBalancerSslArgs] = None,
        ssl_redirect: Optional[bool] = None,
        status: Optional[str] = None,
        vpc: Optional[str] = None) -> LoadBalancer
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)
public static LoadBalancer get(String name, Output<String> id, LoadBalancerState state, CustomResourceOptions options)
resources:  _:    type: vultr:LoadBalancer    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
AttachedInstances List<string>
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
CookieName string
Name for your given sticky session.
FirewallRules List<ediri.Vultr.Inputs.LoadBalancerFirewallRule>
Defines the firewall rules for a load balancer.
ForwardingRules List<ediri.Vultr.Inputs.LoadBalancerForwardingRule>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
HasSsl bool
Boolean value that indicates if SSL is enabled.
HealthCheck ediri.Vultr.Inputs.LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
Ipv4 string
IPv4 address for your load balancer.
Ipv6 string
IPv6 address for your load balancer.
Label string
The load balancer's label.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
Region Changes to this property will trigger replacement. string
The region your load balancer is deployed in.
Ssl ediri.Vultr.Inputs.LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Status string
Current status for the load balancer
Vpc string
A VPC ID that the load balancer should be attached to.
AttachedInstances []string
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
CookieName string
Name for your given sticky session.
FirewallRules []LoadBalancerFirewallRuleArgs
Defines the firewall rules for a load balancer.
ForwardingRules []LoadBalancerForwardingRuleArgs
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
HasSsl bool
Boolean value that indicates if SSL is enabled.
HealthCheck LoadBalancerHealthCheckArgs
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
Ipv4 string
IPv4 address for your load balancer.
Ipv6 string
IPv6 address for your load balancer.
Label string
The load balancer's label.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
Region Changes to this property will trigger replacement. string
The region your load balancer is deployed in.
Ssl LoadBalancerSslArgs
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Status string
Current status for the load balancer
Vpc string
A VPC ID that the load balancer should be attached to.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName String
Name for your given sticky session.
firewallRules List<LoadBalancerFirewallRule>
Defines the firewall rules for a load balancer.
forwardingRules List<LoadBalancerForwardingRule>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
hasSsl Boolean
Boolean value that indicates if SSL is enabled.
healthCheck LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
ipv4 String
IPv4 address for your load balancer.
ipv6 String
IPv6 address for your load balancer.
label String
The load balancer's label.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
region Changes to this property will trigger replacement. String
The region your load balancer is deployed in.
ssl LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status String
Current status for the load balancer
vpc String
A VPC ID that the load balancer should be attached to.
attachedInstances string[]
Array of instances that are currently attached to the load balancer.
balancingAlgorithm string
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName string
Name for your given sticky session.
firewallRules LoadBalancerFirewallRule[]
Defines the firewall rules for a load balancer.
forwardingRules LoadBalancerForwardingRule[]
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
hasSsl boolean
Boolean value that indicates if SSL is enabled.
healthCheck LoadBalancerHealthCheck
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
ipv4 string
IPv4 address for your load balancer.
ipv6 string
IPv6 address for your load balancer.
label string
The load balancer's label.
proxyProtocol boolean
Boolean value that indicates if Proxy Protocol is enabled.
region Changes to this property will trigger replacement. string
The region your load balancer is deployed in.
ssl LoadBalancerSsl
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status string
Current status for the load balancer
vpc string
A VPC ID that the load balancer should be attached to.
attached_instances Sequence[str]
Array of instances that are currently attached to the load balancer.
balancing_algorithm str
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookie_name str
Name for your given sticky session.
firewall_rules Sequence[LoadBalancerFirewallRuleArgs]
Defines the firewall rules for a load balancer.
forwarding_rules Sequence[LoadBalancerForwardingRuleArgs]
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
has_ssl bool
Boolean value that indicates if SSL is enabled.
health_check LoadBalancerHealthCheckArgs
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
ipv4 str
IPv4 address for your load balancer.
ipv6 str
IPv6 address for your load balancer.
label str
The load balancer's label.
proxy_protocol bool
Boolean value that indicates if Proxy Protocol is enabled.
region Changes to this property will trigger replacement. str
The region your load balancer is deployed in.
ssl LoadBalancerSslArgs
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
ssl_redirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status str
Current status for the load balancer
vpc str
A VPC ID that the load balancer should be attached to.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin
cookieName String
Name for your given sticky session.
firewallRules List<Property Map>
Defines the firewall rules for a load balancer.
forwardingRules List<Property Map>
List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below.
hasSsl Boolean
Boolean value that indicates if SSL is enabled.
healthCheck Property Map
A block that defines the way load balancers should check for health. The configuration of a health_check is listed below.
ipv4 String
IPv4 address for your load balancer.
ipv6 String
IPv6 address for your load balancer.
label String
The load balancer's label.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
region Changes to this property will trigger replacement. String
The region your load balancer is deployed in.
ssl Property Map
A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below.
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status String
Current status for the load balancer
vpc String
A VPC ID that the load balancer should be attached to.

Supporting Types

LoadBalancerFirewallRule
, LoadBalancerFirewallRuleArgs

IpType This property is required. string
The type of ip this rule is - may be either v4 or v6.
Port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
Source This property is required. string
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
Id string
The load balancer ID.
IpType This property is required. string
The type of ip this rule is - may be either v4 or v6.
Port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
Source This property is required. string
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
Id string
The load balancer ID.
ipType This property is required. String
The type of ip this rule is - may be either v4 or v6.
port This property is required. Integer
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
source This property is required. String
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
id String
The load balancer ID.
ipType This property is required. string
The type of ip this rule is - may be either v4 or v6.
port This property is required. number
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
source This property is required. string
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
id string
The load balancer ID.
ip_type This property is required. str
The type of ip this rule is - may be either v4 or v6.
port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
source This property is required. str
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
id str
The load balancer ID.
ipType This property is required. String
The type of ip this rule is - may be either v4 or v6.
port This property is required. Number
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
source This property is required. String
IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range.
id String
The load balancer ID.

LoadBalancerForwardingRule
, LoadBalancerForwardingRuleArgs

BackendPort This property is required. int
Port on instance side.
BackendProtocol This property is required. string
Protocol on instance side. Possible values: "http", "https", "tcp".
FrontendPort This property is required. int
Port on load balancer side.
FrontendProtocol This property is required. string
Protocol on load balancer side. Possible values: "http", "https", "tcp".
RuleId string
BackendPort This property is required. int
Port on instance side.
BackendProtocol This property is required. string
Protocol on instance side. Possible values: "http", "https", "tcp".
FrontendPort This property is required. int
Port on load balancer side.
FrontendProtocol This property is required. string
Protocol on load balancer side. Possible values: "http", "https", "tcp".
RuleId string
backendPort This property is required. Integer
Port on instance side.
backendProtocol This property is required. String
Protocol on instance side. Possible values: "http", "https", "tcp".
frontendPort This property is required. Integer
Port on load balancer side.
frontendProtocol This property is required. String
Protocol on load balancer side. Possible values: "http", "https", "tcp".
ruleId String
backendPort This property is required. number
Port on instance side.
backendProtocol This property is required. string
Protocol on instance side. Possible values: "http", "https", "tcp".
frontendPort This property is required. number
Port on load balancer side.
frontendProtocol This property is required. string
Protocol on load balancer side. Possible values: "http", "https", "tcp".
ruleId string
backend_port This property is required. int
Port on instance side.
backend_protocol This property is required. str
Protocol on instance side. Possible values: "http", "https", "tcp".
frontend_port This property is required. int
Port on load balancer side.
frontend_protocol This property is required. str
Protocol on load balancer side. Possible values: "http", "https", "tcp".
rule_id str
backendPort This property is required. Number
Port on instance side.
backendProtocol This property is required. String
Protocol on instance side. Possible values: "http", "https", "tcp".
frontendPort This property is required. Number
Port on load balancer side.
frontendProtocol This property is required. String
Protocol on load balancer side. Possible values: "http", "https", "tcp".
ruleId String

LoadBalancerHealthCheck
, LoadBalancerHealthCheckArgs

Port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
Protocol This property is required. string
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
CheckInterval int
Time in seconds to perform health check. Default value is 15.
HealthyThreshold int
Number of failed attempts encountered before failover. Default value is 5.
Path string
The path on the attached instances that the load balancer should check against. Default value is /
ResponseTimeout int
Time in seconds to wait for a health check response. Default value is 5.
UnhealthyThreshold int
Number of failed attempts encountered before failover. Default value is 5.
Port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
Protocol This property is required. string
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
CheckInterval int
Time in seconds to perform health check. Default value is 15.
HealthyThreshold int
Number of failed attempts encountered before failover. Default value is 5.
Path string
The path on the attached instances that the load balancer should check against. Default value is /
ResponseTimeout int
Time in seconds to wait for a health check response. Default value is 5.
UnhealthyThreshold int
Number of failed attempts encountered before failover. Default value is 5.
port This property is required. Integer
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
protocol This property is required. String
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
checkInterval Integer
Time in seconds to perform health check. Default value is 15.
healthyThreshold Integer
Number of failed attempts encountered before failover. Default value is 5.
path String
The path on the attached instances that the load balancer should check against. Default value is /
responseTimeout Integer
Time in seconds to wait for a health check response. Default value is 5.
unhealthyThreshold Integer
Number of failed attempts encountered before failover. Default value is 5.
port This property is required. number
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
protocol This property is required. string
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
checkInterval number
Time in seconds to perform health check. Default value is 15.
healthyThreshold number
Number of failed attempts encountered before failover. Default value is 5.
path string
The path on the attached instances that the load balancer should check against. Default value is /
responseTimeout number
Time in seconds to wait for a health check response. Default value is 5.
unhealthyThreshold number
Number of failed attempts encountered before failover. Default value is 5.
port This property is required. int
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
protocol This property is required. str
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
check_interval int
Time in seconds to perform health check. Default value is 15.
healthy_threshold int
Number of failed attempts encountered before failover. Default value is 5.
path str
The path on the attached instances that the load balancer should check against. Default value is /
response_timeout int
Time in seconds to wait for a health check response. Default value is 5.
unhealthy_threshold int
Number of failed attempts encountered before failover. Default value is 5.
port This property is required. Number
The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80.
protocol This property is required. String
The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http.
checkInterval Number
Time in seconds to perform health check. Default value is 15.
healthyThreshold Number
Number of failed attempts encountered before failover. Default value is 5.
path String
The path on the attached instances that the load balancer should check against. Default value is /
responseTimeout Number
Time in seconds to wait for a health check response. Default value is 5.
unhealthyThreshold Number
Number of failed attempts encountered before failover. Default value is 5.

LoadBalancerSsl
, LoadBalancerSslArgs

Certificate This property is required. string
The SSL Certificate.
PrivateKey This property is required. string
The SSL certificates private key.
Chain string
The SSL certificate chain.
Certificate This property is required. string
The SSL Certificate.
PrivateKey This property is required. string
The SSL certificates private key.
Chain string
The SSL certificate chain.
certificate This property is required. String
The SSL Certificate.
privateKey This property is required. String
The SSL certificates private key.
chain String
The SSL certificate chain.
certificate This property is required. string
The SSL Certificate.
privateKey This property is required. string
The SSL certificates private key.
chain string
The SSL certificate chain.
certificate This property is required. str
The SSL Certificate.
private_key This property is required. str
The SSL certificates private key.
chain str
The SSL certificate chain.
certificate This property is required. String
The SSL Certificate.
privateKey This property is required. String
The SSL certificates private key.
chain String
The SSL certificate chain.

Import

Load Balancers can be imported using the load balancer ID, e.g.

$ pulumi import vultr:index/loadBalancer:LoadBalancer lb b6a859c5-b299-49dd-8888-b1abbc517d08
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
vultr dirien/pulumi-vultr
License
Apache-2.0
Notes
This Pulumi package is based on the vultr Terraform Provider.