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

vultr.getLoadBalancer

Explore with Pulumi AI

Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

Get information about a Vultr load balancer.

Example Usage

Get the information for a load balancer by label:

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

const myLb = vultr.getLoadBalancer({
    filters: [{
        name: "label",
        values: ["my-lb-label"],
    }],
});
Copy
import pulumi
import pulumi_vultr as vultr

my_lb = vultr.get_load_balancer(filters=[{
    "name": "label",
    "values": ["my-lb-label"],
}])
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.LookupLoadBalancer(ctx, &vultr.LookupLoadBalancerArgs{
			Filters: []vultr.GetLoadBalancerFilter{
				{
					Name: "label",
					Values: []string{
						"my-lb-label",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = Pulumi.Vultr;

return await Deployment.RunAsync(() => 
{
    var myLb = Vultr.GetLoadBalancer.Invoke(new()
    {
        Filters = new[]
        {
            new Vultr.Inputs.GetLoadBalancerFilterInputArgs
            {
                Name = "label",
                Values = new[]
                {
                    "my-lb-label",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.VultrFunctions;
import com.pulumi.vultr.inputs.GetLoadBalancerArgs;
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) {
        final var myLb = VultrFunctions.getLoadBalancer(GetLoadBalancerArgs.builder()
            .filters(GetLoadBalancerFilterArgs.builder()
                .name("label")
                .values("my-lb-label")
                .build())
            .build());

    }
}
Copy
variables:
  myLb:
    fn::invoke:
      Function: vultr:getLoadBalancer
      Arguments:
        filters:
          - name: label
            values:
              - my-lb-label
Copy

Using getLoadBalancer

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getLoadBalancer(args: GetLoadBalancerArgs, opts?: InvokeOptions): Promise<GetLoadBalancerResult>
function getLoadBalancerOutput(args: GetLoadBalancerOutputArgs, opts?: InvokeOptions): Output<GetLoadBalancerResult>
Copy
def get_load_balancer(filters: Optional[Sequence[GetLoadBalancerFilter]] = None,
                      proxy_protocol: Optional[bool] = None,
                      opts: Optional[InvokeOptions] = None) -> GetLoadBalancerResult
def get_load_balancer_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetLoadBalancerFilterArgs]]]] = None,
                      proxy_protocol: Optional[pulumi.Input[bool]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetLoadBalancerResult]
Copy
func LookupLoadBalancer(ctx *Context, args *LookupLoadBalancerArgs, opts ...InvokeOption) (*LookupLoadBalancerResult, error)
func LookupLoadBalancerOutput(ctx *Context, args *LookupLoadBalancerOutputArgs, opts ...InvokeOption) LookupLoadBalancerResultOutput
Copy

> Note: This function is named LookupLoadBalancer in the Go SDK.

public static class GetLoadBalancer 
{
    public static Task<GetLoadBalancerResult> InvokeAsync(GetLoadBalancerArgs args, InvokeOptions? opts = null)
    public static Output<GetLoadBalancerResult> Invoke(GetLoadBalancerInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetLoadBalancerResult> getLoadBalancer(GetLoadBalancerArgs args, InvokeOptions options)
public static Output<GetLoadBalancerResult> getLoadBalancer(GetLoadBalancerArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vultr:index/getLoadBalancer:getLoadBalancer
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Filters Changes to this property will trigger replacement. List<ediri.Vultr.Inputs.GetLoadBalancerFilter>
Query parameters for finding load balancers.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
Filters Changes to this property will trigger replacement. []GetLoadBalancerFilter
Query parameters for finding load balancers.
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
filters Changes to this property will trigger replacement. List<GetLoadBalancerFilter>
Query parameters for finding load balancers.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
filters Changes to this property will trigger replacement. GetLoadBalancerFilter[]
Query parameters for finding load balancers.
proxyProtocol boolean
Boolean value that indicates if Proxy Protocol is enabled.
filters Changes to this property will trigger replacement. Sequence[GetLoadBalancerFilter]
Query parameters for finding load balancers.
proxy_protocol bool
Boolean value that indicates if Proxy Protocol is enabled.
filters Changes to this property will trigger replacement. List<Property Map>
Query parameters for finding load balancers.
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.

getLoadBalancer Result

The following output properties are available:

AttachedInstances List<string>
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer.
CookieName string
Name for your given sticky session.
DateCreated string
FirewallRules List<ImmutableDictionary<string, string>>
ForwardingRules List<ImmutableDictionary<string, string>>
Defines the 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 Dictionary<string, string>
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
Label string
The load balancers label.
Region string
The region your load balancer is deployed in.
Ssl Dictionary<string, string>
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Status string
Current status for the load balancer
Filters List<ediri.Vultr.Outputs.GetLoadBalancerFilter>
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
AttachedInstances []string
Array of instances that are currently attached to the load balancer.
BalancingAlgorithm string
The balancing algorithm for your load balancer.
CookieName string
Name for your given sticky session.
DateCreated string
FirewallRules []map[string]string
ForwardingRules []map[string]string
Defines the 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 map[string]string
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
Label string
The load balancers label.
Region string
The region your load balancer is deployed in.
Ssl map[string]string
SslRedirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
Status string
Current status for the load balancer
Filters []GetLoadBalancerFilter
ProxyProtocol bool
Boolean value that indicates if Proxy Protocol is enabled.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer.
cookieName String
Name for your given sticky session.
dateCreated String
firewallRules List<Map<String,String>>
forwardingRules List<Map<String,String>>
Defines the 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 Map<String,String>
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
label String
The load balancers label.
region String
The region your load balancer is deployed in.
ssl Map<String,String>
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status String
Current status for the load balancer
filters List<GetLoadBalancerFilter>
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.
attachedInstances string[]
Array of instances that are currently attached to the load balancer.
balancingAlgorithm string
The balancing algorithm for your load balancer.
cookieName string
Name for your given sticky session.
dateCreated string
firewallRules {[key: string]: string}[]
forwardingRules {[key: string]: string}[]
Defines the 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 {[key: string]: string}
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
label string
The load balancers label.
region string
The region your load balancer is deployed in.
ssl {[key: string]: string}
sslRedirect boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status string
Current status for the load balancer
filters GetLoadBalancerFilter[]
proxyProtocol boolean
Boolean value that indicates if Proxy Protocol is enabled.
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.
cookie_name str
Name for your given sticky session.
date_created str
firewall_rules Sequence[Mapping[str, str]]
forwarding_rules Sequence[Mapping[str, str]]
Defines the 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 Mapping[str, str]
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
label str
The load balancers label.
region str
The region your load balancer is deployed in.
ssl Mapping[str, str]
ssl_redirect bool
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status str
Current status for the load balancer
filters Sequence[GetLoadBalancerFilter]
proxy_protocol bool
Boolean value that indicates if Proxy Protocol is enabled.
attachedInstances List<String>
Array of instances that are currently attached to the load balancer.
balancingAlgorithm String
The balancing algorithm for your load balancer.
cookieName String
Name for your given sticky session.
dateCreated String
firewallRules List<Map<String>>
forwardingRules List<Map<String>>
Defines the 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 Map<String>
Defines the way load balancers should check for health. The configuration of a health_check is listed below.
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.
label String
The load balancers label.
region String
The region your load balancer is deployed in.
ssl Map<String>
sslRedirect Boolean
Boolean value that indicates if HTTP calls will be redirected to HTTPS.
status String
Current status for the load balancer
filters List<Property Map>
proxyProtocol Boolean
Boolean value that indicates if Proxy Protocol is enabled.

Supporting Types

GetLoadBalancerFilter

Name This property is required. string
Attribute name to filter with.
Values This property is required. List<string>
One or more values filter with.
Name This property is required. string
Attribute name to filter with.
Values This property is required. []string
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.
name This property is required. string
Attribute name to filter with.
values This property is required. string[]
One or more values filter with.
name This property is required. str
Attribute name to filter with.
values This property is required. Sequence[str]
One or more values filter with.
name This property is required. String
Attribute name to filter with.
values This property is required. List<String>
One or more values filter with.

Package Details

Repository
vultr dirien/pulumi-vultr
License
Apache-2.0
Notes
This Pulumi package is based on the vultr Terraform Provider.
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien