github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/oam/getLink.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 oam
     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  // Data source for managing an AWS CloudWatch Observability Access Manager Link.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/oam"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := oam.LookupLink(ctx, &oam.LookupLinkArgs{
    34  //				LinkIdentifier: "arn:aws:oam:us-west-1:111111111111:link/abcd1234-a123-456a-a12b-a123b456c789",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupLink(ctx *pulumi.Context, args *LookupLinkArgs, opts ...pulumi.InvokeOption) (*LookupLinkResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupLinkResult
    48  	err := ctx.Invoke("aws:oam/getLink:getLink", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getLink.
    56  type LookupLinkArgs struct {
    57  	// ARN of the link.
    58  	LinkIdentifier string            `pulumi:"linkIdentifier"`
    59  	Tags           map[string]string `pulumi:"tags"`
    60  }
    61  
    62  // A collection of values returned by getLink.
    63  type LookupLinkResult struct {
    64  	// ARN of the link.
    65  	Arn string `pulumi:"arn"`
    66  	// The provider-assigned unique ID for this managed resource.
    67  	Id string `pulumi:"id"`
    68  	// Label that is assigned to this link.
    69  	Label string `pulumi:"label"`
    70  	// Human-readable name used to identify this source account when you are viewing data from it in the monitoring account.
    71  	LabelTemplate string `pulumi:"labelTemplate"`
    72  	// ID string that AWS generated as part of the link ARN.
    73  	LinkId         string `pulumi:"linkId"`
    74  	LinkIdentifier string `pulumi:"linkIdentifier"`
    75  	// Types of data that the source account shares with the monitoring account.
    76  	ResourceTypes []string `pulumi:"resourceTypes"`
    77  	// ARN of the sink that is used for this link.
    78  	SinkArn string            `pulumi:"sinkArn"`
    79  	Tags    map[string]string `pulumi:"tags"`
    80  }
    81  
    82  func LookupLinkOutput(ctx *pulumi.Context, args LookupLinkOutputArgs, opts ...pulumi.InvokeOption) LookupLinkResultOutput {
    83  	return pulumi.ToOutputWithContext(context.Background(), args).
    84  		ApplyT(func(v interface{}) (LookupLinkResult, error) {
    85  			args := v.(LookupLinkArgs)
    86  			r, err := LookupLink(ctx, &args, opts...)
    87  			var s LookupLinkResult
    88  			if r != nil {
    89  				s = *r
    90  			}
    91  			return s, err
    92  		}).(LookupLinkResultOutput)
    93  }
    94  
    95  // A collection of arguments for invoking getLink.
    96  type LookupLinkOutputArgs struct {
    97  	// ARN of the link.
    98  	LinkIdentifier pulumi.StringInput    `pulumi:"linkIdentifier"`
    99  	Tags           pulumi.StringMapInput `pulumi:"tags"`
   100  }
   101  
   102  func (LookupLinkOutputArgs) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*LookupLinkArgs)(nil)).Elem()
   104  }
   105  
   106  // A collection of values returned by getLink.
   107  type LookupLinkResultOutput struct{ *pulumi.OutputState }
   108  
   109  func (LookupLinkResultOutput) ElementType() reflect.Type {
   110  	return reflect.TypeOf((*LookupLinkResult)(nil)).Elem()
   111  }
   112  
   113  func (o LookupLinkResultOutput) ToLookupLinkResultOutput() LookupLinkResultOutput {
   114  	return o
   115  }
   116  
   117  func (o LookupLinkResultOutput) ToLookupLinkResultOutputWithContext(ctx context.Context) LookupLinkResultOutput {
   118  	return o
   119  }
   120  
   121  // ARN of the link.
   122  func (o LookupLinkResultOutput) Arn() pulumi.StringOutput {
   123  	return o.ApplyT(func(v LookupLinkResult) string { return v.Arn }).(pulumi.StringOutput)
   124  }
   125  
   126  // The provider-assigned unique ID for this managed resource.
   127  func (o LookupLinkResultOutput) Id() pulumi.StringOutput {
   128  	return o.ApplyT(func(v LookupLinkResult) string { return v.Id }).(pulumi.StringOutput)
   129  }
   130  
   131  // Label that is assigned to this link.
   132  func (o LookupLinkResultOutput) Label() pulumi.StringOutput {
   133  	return o.ApplyT(func(v LookupLinkResult) string { return v.Label }).(pulumi.StringOutput)
   134  }
   135  
   136  // Human-readable name used to identify this source account when you are viewing data from it in the monitoring account.
   137  func (o LookupLinkResultOutput) LabelTemplate() pulumi.StringOutput {
   138  	return o.ApplyT(func(v LookupLinkResult) string { return v.LabelTemplate }).(pulumi.StringOutput)
   139  }
   140  
   141  // ID string that AWS generated as part of the link ARN.
   142  func (o LookupLinkResultOutput) LinkId() pulumi.StringOutput {
   143  	return o.ApplyT(func(v LookupLinkResult) string { return v.LinkId }).(pulumi.StringOutput)
   144  }
   145  
   146  func (o LookupLinkResultOutput) LinkIdentifier() pulumi.StringOutput {
   147  	return o.ApplyT(func(v LookupLinkResult) string { return v.LinkIdentifier }).(pulumi.StringOutput)
   148  }
   149  
   150  // Types of data that the source account shares with the monitoring account.
   151  func (o LookupLinkResultOutput) ResourceTypes() pulumi.StringArrayOutput {
   152  	return o.ApplyT(func(v LookupLinkResult) []string { return v.ResourceTypes }).(pulumi.StringArrayOutput)
   153  }
   154  
   155  // ARN of the sink that is used for this link.
   156  func (o LookupLinkResultOutput) SinkArn() pulumi.StringOutput {
   157  	return o.ApplyT(func(v LookupLinkResult) string { return v.SinkArn }).(pulumi.StringOutput)
   158  }
   159  
   160  func (o LookupLinkResultOutput) Tags() pulumi.StringMapOutput {
   161  	return o.ApplyT(func(v LookupLinkResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   162  }
   163  
   164  func init() {
   165  	pulumi.RegisterOutputType(LookupLinkResultOutput{})
   166  }