github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/oam/getLinks.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 Links.
    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.GetLinks(ctx, nil, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func GetLinks(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetLinksResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv GetLinksResult
    46  	err := ctx.Invoke("aws:oam/getLinks:getLinks", nil, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of values returned by getLinks.
    54  type GetLinksResult struct {
    55  	// Set of ARN of the Links.
    56  	Arns []string `pulumi:"arns"`
    57  	// The provider-assigned unique ID for this managed resource.
    58  	Id string `pulumi:"id"`
    59  }
    60  
    61  func GetLinksOutput(ctx *pulumi.Context, opts ...pulumi.InvokeOption) GetLinksResultOutput {
    62  	return pulumi.ToOutput(0).ApplyT(func(int) (GetLinksResult, error) {
    63  		r, err := GetLinks(ctx, opts...)
    64  		var s GetLinksResult
    65  		if r != nil {
    66  			s = *r
    67  		}
    68  		return s, err
    69  	}).(GetLinksResultOutput)
    70  }
    71  
    72  // A collection of values returned by getLinks.
    73  type GetLinksResultOutput struct{ *pulumi.OutputState }
    74  
    75  func (GetLinksResultOutput) ElementType() reflect.Type {
    76  	return reflect.TypeOf((*GetLinksResult)(nil)).Elem()
    77  }
    78  
    79  func (o GetLinksResultOutput) ToGetLinksResultOutput() GetLinksResultOutput {
    80  	return o
    81  }
    82  
    83  func (o GetLinksResultOutput) ToGetLinksResultOutputWithContext(ctx context.Context) GetLinksResultOutput {
    84  	return o
    85  }
    86  
    87  // Set of ARN of the Links.
    88  func (o GetLinksResultOutput) Arns() pulumi.StringArrayOutput {
    89  	return o.ApplyT(func(v GetLinksResult) []string { return v.Arns }).(pulumi.StringArrayOutput)
    90  }
    91  
    92  // The provider-assigned unique ID for this managed resource.
    93  func (o GetLinksResultOutput) Id() pulumi.StringOutput {
    94  	return o.ApplyT(func(v GetLinksResult) string { return v.Id }).(pulumi.StringOutput)
    95  }
    96  
    97  func init() {
    98  	pulumi.RegisterOutputType(GetLinksResultOutput{})
    99  }