1. Packages
  2. AWS
  3. API Docs
  4. lb
  5. getLbs
AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi

aws.lb.getLbs

Start a Neo task
Explain and create an aws.lb.getLbs resource
aws logo
AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi

    Use this data source to get a list of Load Balancer ARNs matching the specified criteria. Useful for passing to other resources.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.lb.getLbs({
        tags: {
            "elbv2.k8s.aws/cluster": "my-cluster",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.lb.get_lbs(tags={
        "elbv2.k8s.aws/cluster": "my-cluster",
    })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := lb.GetLbs(ctx, &lb.GetLbsArgs{
    			Tags: map[string]interface{}{
    				"elbv2.k8s.aws/cluster": "my-cluster",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.LB.GetLbs.Invoke(new()
        {
            Tags = 
            {
                { "elbv2.k8s.aws/cluster", "my-cluster" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.lb.LbFunctions;
    import com.pulumi.aws.lb.inputs.GetLbsArgs;
    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 = LbFunctions.getLbs(GetLbsArgs.builder()
                .tags(Map.of("elbv2.k8s.aws/cluster", "my-cluster"))
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:lb:getLbs
          arguments:
            tags:
              elbv2.k8s.aws/cluster: my-cluster
    

    Using getLbs

    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 getLbs(args: GetLbsArgs, opts?: InvokeOptions): Promise<GetLbsResult>
    function getLbsOutput(args: GetLbsOutputArgs, opts?: InvokeOptions): Output<GetLbsResult>
    def get_lbs(region: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetLbsResult
    def get_lbs_output(region: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetLbsResult]
    func GetLbs(ctx *Context, args *GetLbsArgs, opts ...InvokeOption) (*GetLbsResult, error)
    func GetLbsOutput(ctx *Context, args *GetLbsOutputArgs, opts ...InvokeOption) GetLbsResultOutput

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

    public static class GetLbs 
    {
        public static Task<GetLbsResult> InvokeAsync(GetLbsArgs args, InvokeOptions? opts = null)
        public static Output<GetLbsResult> Invoke(GetLbsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
    public static Output<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:lb/getLbs:getLbs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    Map of tags, each pair of which must exactly match a pair on the desired Load Balancers.

    getLbs Result

    The following output properties are available:

    Arns List<string>
    Set of Load Balancer ARNs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Tags Dictionary<string, string>
    Arns []string
    Set of Load Balancer ARNs.
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    Tags map[string]string
    arns List<String>
    Set of Load Balancer ARNs.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    tags Map<String,String>
    arns string[]
    Set of Load Balancer ARNs.
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    tags {[key: string]: string}
    arns Sequence[str]
    Set of Load Balancer ARNs.
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    tags Mapping[str, str]
    arns List<String>
    Set of Load Balancer ARNs.
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    tags Map<String>

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.11.0 published on Wednesday, Nov 5, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate