1. Packages
  2. Vultr
  3. API Docs
  4. getLoadBalancer
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.getLoadBalancer

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 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"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_lb = vultr.get_load_balancer(filters=[vultr.GetLoadBalancerFilterArgs(
        name="label",
        values=["my-lb-label"],
    )])
    
    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
    	})
    }
    
    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",
                    },
                },
            },
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      myLb:
        fn::invoke:
          Function: vultr:getLoadBalancer
          Arguments:
            filters:
              - name: label
                values:
                  - my-lb-label
    

    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>
    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]
    func LookupLoadBalancer(ctx *Context, args *LookupLoadBalancerArgs, opts ...InvokeOption) (*LookupLoadBalancerResult, error)
    func LookupLoadBalancerOutput(ctx *Context, args *LookupLoadBalancerOutputArgs, opts ...InvokeOption) LookupLoadBalancerResultOutput

    > 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)
    }
    public static CompletableFuture<GetLoadBalancerResult> getLoadBalancer(GetLoadBalancerArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vultr:index/getLoadBalancer:getLoadBalancer
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetLoadBalancerFilter>
    Query parameters for finding load balancers.
    ProxyProtocol bool
    Boolean value that indicates if Proxy Protocol is enabled.
    Filters []GetLoadBalancerFilter
    Query parameters for finding load balancers.
    ProxyProtocol bool
    Boolean value that indicates if Proxy Protocol is enabled.
    filters List<GetLoadBalancerFilter>
    Query parameters for finding load balancers.
    proxyProtocol Boolean
    Boolean value that indicates if Proxy Protocol is enabled.
    filters GetLoadBalancerFilter[]
    Query parameters for finding load balancers.
    proxyProtocol boolean
    Boolean value that indicates if Proxy Protocol is enabled.
    filters Sequence[GetLoadBalancerFilter]
    Query parameters for finding load balancers.
    proxy_protocol bool
    Boolean value that indicates if Proxy Protocol is enabled.
    filters 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, object>>
    ForwardingRules List<ImmutableDictionary<string, object>>
    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, object>
    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, object>
    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]interface{}
    ForwardingRules []map[string]interface{}
    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]interface{}
    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]interface{}
    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,Object>>
    forwardingRules List<Map<String,Object>>
    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,Object>
    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,Object>
    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]: any}[]
    forwardingRules {[key: string]: any}[]
    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]: any}
    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]: any}
    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, Any]]
    forwarding_rules Sequence[Mapping[str, Any]]
    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, Any]
    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, Any]
    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<Any>>
    forwardingRules List<Map<Any>>
    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<Any>
    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<Any>
    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 string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values 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 logo
    Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien