github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lb/getLbs.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package lb
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Use this data source to get a list of Load Balancer ARNs matching the specified criteria. Useful for passing to other
    15  // resources.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := lb.GetLbs(ctx, &lb.GetLbsArgs{
    35  //				Tags: map[string]interface{}{
    36  //					"elbv2.k8s.aws/cluster": "my-cluster",
    37  //				},
    38  //			}, nil)
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  func GetLbs(ctx *pulumi.Context, args *GetLbsArgs, opts ...pulumi.InvokeOption) (*GetLbsResult, error) {
    49  	opts = internal.PkgInvokeDefaultOpts(opts)
    50  	var rv GetLbsResult
    51  	err := ctx.Invoke("aws:lb/getLbs:getLbs", args, &rv, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return &rv, nil
    56  }
    57  
    58  // A collection of arguments for invoking getLbs.
    59  type GetLbsArgs struct {
    60  	// Map of tags, each pair of which must exactly match
    61  	// a pair on the desired Load Balancers.
    62  	Tags map[string]string `pulumi:"tags"`
    63  }
    64  
    65  // A collection of values returned by getLbs.
    66  type GetLbsResult struct {
    67  	// Set of Load Balancer ARNs.
    68  	Arns []string `pulumi:"arns"`
    69  	// The provider-assigned unique ID for this managed resource.
    70  	Id   string            `pulumi:"id"`
    71  	Tags map[string]string `pulumi:"tags"`
    72  }
    73  
    74  func GetLbsOutput(ctx *pulumi.Context, args GetLbsOutputArgs, opts ...pulumi.InvokeOption) GetLbsResultOutput {
    75  	return pulumi.ToOutputWithContext(context.Background(), args).
    76  		ApplyT(func(v interface{}) (GetLbsResult, error) {
    77  			args := v.(GetLbsArgs)
    78  			r, err := GetLbs(ctx, &args, opts...)
    79  			var s GetLbsResult
    80  			if r != nil {
    81  				s = *r
    82  			}
    83  			return s, err
    84  		}).(GetLbsResultOutput)
    85  }
    86  
    87  // A collection of arguments for invoking getLbs.
    88  type GetLbsOutputArgs struct {
    89  	// Map of tags, each pair of which must exactly match
    90  	// a pair on the desired Load Balancers.
    91  	Tags pulumi.StringMapInput `pulumi:"tags"`
    92  }
    93  
    94  func (GetLbsOutputArgs) ElementType() reflect.Type {
    95  	return reflect.TypeOf((*GetLbsArgs)(nil)).Elem()
    96  }
    97  
    98  // A collection of values returned by getLbs.
    99  type GetLbsResultOutput struct{ *pulumi.OutputState }
   100  
   101  func (GetLbsResultOutput) ElementType() reflect.Type {
   102  	return reflect.TypeOf((*GetLbsResult)(nil)).Elem()
   103  }
   104  
   105  func (o GetLbsResultOutput) ToGetLbsResultOutput() GetLbsResultOutput {
   106  	return o
   107  }
   108  
   109  func (o GetLbsResultOutput) ToGetLbsResultOutputWithContext(ctx context.Context) GetLbsResultOutput {
   110  	return o
   111  }
   112  
   113  // Set of Load Balancer ARNs.
   114  func (o GetLbsResultOutput) Arns() pulumi.StringArrayOutput {
   115  	return o.ApplyT(func(v GetLbsResult) []string { return v.Arns }).(pulumi.StringArrayOutput)
   116  }
   117  
   118  // The provider-assigned unique ID for this managed resource.
   119  func (o GetLbsResultOutput) Id() pulumi.StringOutput {
   120  	return o.ApplyT(func(v GetLbsResult) string { return v.Id }).(pulumi.StringOutput)
   121  }
   122  
   123  func (o GetLbsResultOutput) Tags() pulumi.StringMapOutput {
   124  	return o.ApplyT(func(v GetLbsResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   125  }
   126  
   127  func init() {
   128  	pulumi.RegisterOutputType(GetLbsResultOutput{})
   129  }