github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lb/getTrustStore.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  // > **Note:** `awsAlbTrustStore` is known as `lb.TrustStore`. The functionality is identical.
    15  //
    16  // Provides information about a Load Balancer Trust Store.
    17  //
    18  // This data source can prove useful when a module accepts an LB Trust Store as an
    19  // input variable and needs to know its attributes. It can also be used to get the ARN of
    20  // an LB Trust Store for use in other resources, given LB Trust Store name.
    21  //
    22  // ## Example Usage
    23  //
    24  // <!--Start PulumiCodeChooser -->
    25  // ```go
    26  // package main
    27  //
    28  // import (
    29  //
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lb"
    31  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    32  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    33  //
    34  // )
    35  //
    36  //	func main() {
    37  //		pulumi.Run(func(ctx *pulumi.Context) error {
    38  //			cfg := config.New(ctx, "")
    39  //			lbTsArn := ""
    40  //			if param := cfg.Get("lbTsArn"); param != "" {
    41  //				lbTsArn = param
    42  //			}
    43  //			lbTsName := ""
    44  //			if param := cfg.Get("lbTsName"); param != "" {
    45  //				lbTsName = param
    46  //			}
    47  //			_, err := lb.LookupTrustStore(ctx, &lb.LookupTrustStoreArgs{
    48  //				Arn:  pulumi.StringRef(lbTsArn),
    49  //				Name: pulumi.StringRef(lbTsName),
    50  //			}, nil)
    51  //			if err != nil {
    52  //				return err
    53  //			}
    54  //			return nil
    55  //		})
    56  //	}
    57  //
    58  // ```
    59  // <!--End PulumiCodeChooser -->
    60  func LookupTrustStore(ctx *pulumi.Context, args *LookupTrustStoreArgs, opts ...pulumi.InvokeOption) (*LookupTrustStoreResult, error) {
    61  	opts = internal.PkgInvokeDefaultOpts(opts)
    62  	var rv LookupTrustStoreResult
    63  	err := ctx.Invoke("aws:lb/getTrustStore:getTrustStore", args, &rv, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &rv, nil
    68  }
    69  
    70  // A collection of arguments for invoking getTrustStore.
    71  type LookupTrustStoreArgs struct {
    72  	// Full ARN of the trust store.
    73  	Arn *string `pulumi:"arn"`
    74  	// Unique name of the trust store.
    75  	//
    76  	// > **NOTE:** When both `arn` and `name` are specified, `arn` takes precedence.
    77  	Name *string `pulumi:"name"`
    78  }
    79  
    80  // A collection of values returned by getTrustStore.
    81  type LookupTrustStoreResult struct {
    82  	Arn string `pulumi:"arn"`
    83  	// The provider-assigned unique ID for this managed resource.
    84  	Id   string `pulumi:"id"`
    85  	Name string `pulumi:"name"`
    86  }
    87  
    88  func LookupTrustStoreOutput(ctx *pulumi.Context, args LookupTrustStoreOutputArgs, opts ...pulumi.InvokeOption) LookupTrustStoreResultOutput {
    89  	return pulumi.ToOutputWithContext(context.Background(), args).
    90  		ApplyT(func(v interface{}) (LookupTrustStoreResult, error) {
    91  			args := v.(LookupTrustStoreArgs)
    92  			r, err := LookupTrustStore(ctx, &args, opts...)
    93  			var s LookupTrustStoreResult
    94  			if r != nil {
    95  				s = *r
    96  			}
    97  			return s, err
    98  		}).(LookupTrustStoreResultOutput)
    99  }
   100  
   101  // A collection of arguments for invoking getTrustStore.
   102  type LookupTrustStoreOutputArgs struct {
   103  	// Full ARN of the trust store.
   104  	Arn pulumi.StringPtrInput `pulumi:"arn"`
   105  	// Unique name of the trust store.
   106  	//
   107  	// > **NOTE:** When both `arn` and `name` are specified, `arn` takes precedence.
   108  	Name pulumi.StringPtrInput `pulumi:"name"`
   109  }
   110  
   111  func (LookupTrustStoreOutputArgs) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*LookupTrustStoreArgs)(nil)).Elem()
   113  }
   114  
   115  // A collection of values returned by getTrustStore.
   116  type LookupTrustStoreResultOutput struct{ *pulumi.OutputState }
   117  
   118  func (LookupTrustStoreResultOutput) ElementType() reflect.Type {
   119  	return reflect.TypeOf((*LookupTrustStoreResult)(nil)).Elem()
   120  }
   121  
   122  func (o LookupTrustStoreResultOutput) ToLookupTrustStoreResultOutput() LookupTrustStoreResultOutput {
   123  	return o
   124  }
   125  
   126  func (o LookupTrustStoreResultOutput) ToLookupTrustStoreResultOutputWithContext(ctx context.Context) LookupTrustStoreResultOutput {
   127  	return o
   128  }
   129  
   130  func (o LookupTrustStoreResultOutput) Arn() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupTrustStoreResult) string { return v.Arn }).(pulumi.StringOutput)
   132  }
   133  
   134  // The provider-assigned unique ID for this managed resource.
   135  func (o LookupTrustStoreResultOutput) Id() pulumi.StringOutput {
   136  	return o.ApplyT(func(v LookupTrustStoreResult) string { return v.Id }).(pulumi.StringOutput)
   137  }
   138  
   139  func (o LookupTrustStoreResultOutput) Name() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupTrustStoreResult) string { return v.Name }).(pulumi.StringOutput)
   141  }
   142  
   143  func init() {
   144  	pulumi.RegisterOutputType(LookupTrustStoreResultOutput{})
   145  }