1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getLbRules
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getLbRules

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source provides a list of Load Balancer Rule resources according to their Load Balancer Rule ID.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getLbRules({
        loadBalancerId: "ulb-xxx",
        listenerId: "vserver-xxx",
    });
    export const first = example.then(example => example.lbRules?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_lb_rules(load_balancer_id="ulb-xxx",
        listener_id="vserver-xxx")
    pulumi.export("first", example.lb_rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetLbRules(ctx, &ucloud.GetLbRulesArgs{
    			LoadBalancerId: "ulb-xxx",
    			ListenerId:     "vserver-xxx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.LbRules[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetLbRules.Invoke(new()
        {
            LoadBalancerId = "ulb-xxx",
            ListenerId = "vserver-xxx",
        });
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getLbRulesResult => getLbRulesResult.LbRules[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetLbRulesArgs;
    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 example = UcloudFunctions.getLbRules(GetLbRulesArgs.builder()
                .loadBalancerId("ulb-xxx")
                .listenerId("vserver-xxx")
                .build());
    
            ctx.export("first", example.applyValue(getLbRulesResult -> getLbRulesResult.lbRules()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getLbRules
          arguments:
            loadBalancerId: ulb-xxx
            listenerId: vserver-xxx
    outputs:
      first: ${example.lbRules[0].id}
    

    Using getLbRules

    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 getLbRules(args: GetLbRulesArgs, opts?: InvokeOptions): Promise<GetLbRulesResult>
    function getLbRulesOutput(args: GetLbRulesOutputArgs, opts?: InvokeOptions): Output<GetLbRulesResult>
    def get_lb_rules(id: Optional[str] = None,
                     ids: Optional[Sequence[str]] = None,
                     listener_id: Optional[str] = None,
                     load_balancer_id: Optional[str] = None,
                     output_file: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetLbRulesResult
    def get_lb_rules_output(id: Optional[pulumi.Input[str]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     listener_id: Optional[pulumi.Input[str]] = None,
                     load_balancer_id: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetLbRulesResult]
    func GetLbRules(ctx *Context, args *GetLbRulesArgs, opts ...InvokeOption) (*GetLbRulesResult, error)
    func GetLbRulesOutput(ctx *Context, args *GetLbRulesOutputArgs, opts ...InvokeOption) GetLbRulesResultOutput

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

    public static class GetLbRules 
    {
        public static Task<GetLbRulesResult> InvokeAsync(GetLbRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetLbRulesResult> Invoke(GetLbRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLbRulesResult> getLbRules(GetLbRulesArgs args, InvokeOptions options)
    public static Output<GetLbRulesResult> getLbRules(GetLbRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getLbRules:getLbRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ListenerId string
    The ID of a listener server.


    LoadBalancerId string
    The ID of a load balancer.
    Id string
    The ID of LB Rule.
    Ids List<string>
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ListenerId string
    The ID of a listener server.


    LoadBalancerId string
    The ID of a load balancer.
    Id string
    The ID of LB Rule.
    Ids []string
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    listenerId String
    The ID of a listener server.


    loadBalancerId String
    The ID of a load balancer.
    id String
    The ID of LB Rule.
    ids List<String>
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    outputFile String
    File name where to save data source results (after running pulumi preview).
    listenerId string
    The ID of a listener server.


    loadBalancerId string
    The ID of a load balancer.
    id string
    The ID of LB Rule.
    ids string[]
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    outputFile string
    File name where to save data source results (after running pulumi preview).
    listener_id str
    The ID of a listener server.


    load_balancer_id str
    The ID of a load balancer.
    id str
    The ID of LB Rule.
    ids Sequence[str]
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    output_file str
    File name where to save data source results (after running pulumi preview).
    listenerId String
    The ID of a listener server.


    loadBalancerId String
    The ID of a load balancer.
    id String
    The ID of LB Rule.
    ids List<String>
    A list of LB Rule IDs, all the LB Rules belong to the Load Balancer listener will be retrieved if the ID is [].
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getLbRules Result

    The following output properties are available:

    Id string
    The ID of LB Rule.
    Ids List<string>
    LbRules List<GetLbRulesLbRule>
    It is a nested type which documented below.
    ListenerId string
    LoadBalancerId string
    TotalCount double
    Total number of LB Rules that satisfy the condition.
    OutputFile string
    Id string
    The ID of LB Rule.
    Ids []string
    LbRules []GetLbRulesLbRule
    It is a nested type which documented below.
    ListenerId string
    LoadBalancerId string
    TotalCount float64
    Total number of LB Rules that satisfy the condition.
    OutputFile string
    id String
    The ID of LB Rule.
    ids List<String>
    lbRules List<GetLbRulesLbRule>
    It is a nested type which documented below.
    listenerId String
    loadBalancerId String
    totalCount Double
    Total number of LB Rules that satisfy the condition.
    outputFile String
    id string
    The ID of LB Rule.
    ids string[]
    lbRules GetLbRulesLbRule[]
    It is a nested type which documented below.
    listenerId string
    loadBalancerId string
    totalCount number
    Total number of LB Rules that satisfy the condition.
    outputFile string
    id str
    The ID of LB Rule.
    ids Sequence[str]
    lb_rules Sequence[GetLbRulesLbRule]
    It is a nested type which documented below.
    listener_id str
    load_balancer_id str
    total_count float
    Total number of LB Rules that satisfy the condition.
    output_file str
    id String
    The ID of LB Rule.
    ids List<String>
    lbRules List<Property Map>
    It is a nested type which documented below.
    listenerId String
    loadBalancerId String
    totalCount Number
    Total number of LB Rules that satisfy the condition.
    outputFile String

    Supporting Types

    GetLbRulesLbRule

    Domain string
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    Id string
    The ID of LB Rule.
    Path string
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.
    Domain string
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    Id string
    The ID of LB Rule.
    Path string
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.
    domain String
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    id String
    The ID of LB Rule.
    path String
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.
    domain string
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    id string
    The ID of LB Rule.
    path string
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.
    domain str
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    id str
    The ID of LB Rule.
    path str
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.
    domain String
    (Optional) The domain of content forward matching fields. path and domain cannot coexist.
    id String
    The ID of LB Rule.
    path String
    (Optional) The path of Content forward matching fields. path and domain cannot coexist.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud