1. Packages
  2. Exoscale
  3. API Docs
  4. getNlb
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

exoscale.getNlb

Explore with Pulumi AI

exoscale logo
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

    Fetch Exoscale Network Load Balancers (NLB) data.

    Corresponding resource: exoscale_nlb.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as exoscale from "@pulumi/exoscale";
    
    const myNlb = exoscale.getNlb({
        zone: "ch-gva-2",
        name: "my-nlb",
    });
    export const myNlbId = myNlb.then(myNlb => myNlb.id);
    
    import pulumi
    import pulumi_exoscale as exoscale
    
    my_nlb = exoscale.get_nlb(zone="ch-gva-2",
        name="my-nlb")
    pulumi.export("myNlbId", my_nlb.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		myNlb, err := exoscale.LookupNlb(ctx, &exoscale.LookupNlbArgs{
    			Zone: "ch-gva-2",
    			Name: pulumi.StringRef("my-nlb"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("myNlbId", myNlb.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Exoscale = Pulumi.Exoscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myNlb = Exoscale.GetNlb.Invoke(new()
        {
            Zone = "ch-gva-2",
            Name = "my-nlb",
        });
    
        return new Dictionary<string, object?>
        {
            ["myNlbId"] = myNlb.Apply(getNlbResult => getNlbResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.exoscale.ExoscaleFunctions;
    import com.pulumi.exoscale.inputs.GetNlbArgs;
    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 myNlb = ExoscaleFunctions.getNlb(GetNlbArgs.builder()
                .zone("ch-gva-2")
                .name("my-nlb")
                .build());
    
            ctx.export("myNlbId", myNlb.applyValue(getNlbResult -> getNlbResult.id()));
        }
    }
    
    variables:
      myNlb:
        fn::invoke:
          Function: exoscale:getNlb
          Arguments:
            zone: ch-gva-2
            name: my-nlb
    outputs:
      myNlbId: ${myNlb.id}
    

    Please refer to the examples directory for complete configuration examples.

    Using getNlb

    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 getNlb(args: GetNlbArgs, opts?: InvokeOptions): Promise<GetNlbResult>
    function getNlbOutput(args: GetNlbOutputArgs, opts?: InvokeOptions): Output<GetNlbResult>
    def get_nlb(id: Optional[str] = None,
                name: Optional[str] = None,
                zone: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetNlbResult
    def get_nlb_output(id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                zone: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetNlbResult]
    func LookupNlb(ctx *Context, args *LookupNlbArgs, opts ...InvokeOption) (*LookupNlbResult, error)
    func LookupNlbOutput(ctx *Context, args *LookupNlbOutputArgs, opts ...InvokeOption) LookupNlbResultOutput

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

    public static class GetNlb 
    {
        public static Task<GetNlbResult> InvokeAsync(GetNlbArgs args, InvokeOptions? opts = null)
        public static Output<GetNlbResult> Invoke(GetNlbInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNlbResult> getNlb(GetNlbArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: exoscale:index/getNlb:getNlb
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Zone string
    The Exoscale Zone name.
    Id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    Name string
    The NLB name to match (conflicts with id).
    Zone string
    The Exoscale Zone name.
    Id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    Name string
    The NLB name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    id String
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name String
    The NLB name to match (conflicts with id).
    zone string
    The Exoscale Zone name.
    id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name string
    The NLB name to match (conflicts with id).
    zone str
    The Exoscale Zone name.
    id str
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name str
    The NLB name to match (conflicts with id).
    zone String
    The Exoscale Zone name.
    id String
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name String
    The NLB name to match (conflicts with id).

    getNlb Result

    The following output properties are available:

    CreatedAt string
    The NLB creation date.
    Description string
    The Network Load Balancers (NLB) description.
    IpAddress string
    The NLB public IPv4 address.
    State string
    The current NLB state.
    Zone string
    The Exoscale Zone name.
    Id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    Name string
    The NLB name to match (conflicts with id).
    CreatedAt string
    The NLB creation date.
    Description string
    The Network Load Balancers (NLB) description.
    IpAddress string
    The NLB public IPv4 address.
    State string
    The current NLB state.
    Zone string
    The Exoscale Zone name.
    Id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    Name string
    The NLB name to match (conflicts with id).
    createdAt String
    The NLB creation date.
    description String
    The Network Load Balancers (NLB) description.
    ipAddress String
    The NLB public IPv4 address.
    state String
    The current NLB state.
    zone String
    The Exoscale Zone name.
    id String
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name String
    The NLB name to match (conflicts with id).
    createdAt string
    The NLB creation date.
    description string
    The Network Load Balancers (NLB) description.
    ipAddress string
    The NLB public IPv4 address.
    state string
    The current NLB state.
    zone string
    The Exoscale Zone name.
    id string
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name string
    The NLB name to match (conflicts with id).
    created_at str
    The NLB creation date.
    description str
    The Network Load Balancers (NLB) description.
    ip_address str
    The NLB public IPv4 address.
    state str
    The current NLB state.
    zone str
    The Exoscale Zone name.
    id str
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name str
    The NLB name to match (conflicts with id).
    createdAt String
    The NLB creation date.
    description String
    The Network Load Balancers (NLB) description.
    ipAddress String
    The NLB public IPv4 address.
    state String
    The current NLB state.
    zone String
    The Exoscale Zone name.
    id String
    The Network Load Balancers (NLB) ID to match (conflicts with name).
    name String
    The NLB name to match (conflicts with id).

    Package Details

    Repository
    exoscale pulumiverse/pulumi-exoscale
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the exoscale Terraform Provider.
    exoscale logo
    Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse