github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ram/getResourceShare.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 ram
     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  // `ram.ResourceShare` Retrieve information about a RAM Resource Share.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ram"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
    32  //				Name:          pulumi.StringRef("example"),
    33  //				ResourceOwner: "SELF",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Search by filters
    46  //
    47  // <!--Start PulumiCodeChooser -->
    48  // ```go
    49  // package main
    50  //
    51  // import (
    52  //
    53  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ram"
    54  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    55  //
    56  // )
    57  //
    58  //	func main() {
    59  //		pulumi.Run(func(ctx *pulumi.Context) error {
    60  //			_, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
    61  //				ResourceOwner: "SELF",
    62  //				Filters: []ram.GetResourceShareFilter{
    63  //					{
    64  //						Name: "NameOfTag",
    65  //						Values: []string{
    66  //							"exampleNameTagValue",
    67  //						},
    68  //					},
    69  //				},
    70  //			}, nil)
    71  //			if err != nil {
    72  //				return err
    73  //			}
    74  //			return nil
    75  //		})
    76  //	}
    77  //
    78  // ```
    79  // <!--End PulumiCodeChooser -->
    80  func LookupResourceShare(ctx *pulumi.Context, args *LookupResourceShareArgs, opts ...pulumi.InvokeOption) (*LookupResourceShareResult, error) {
    81  	opts = internal.PkgInvokeDefaultOpts(opts)
    82  	var rv LookupResourceShareResult
    83  	err := ctx.Invoke("aws:ram/getResourceShare:getResourceShare", args, &rv, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &rv, nil
    88  }
    89  
    90  // A collection of arguments for invoking getResourceShare.
    91  type LookupResourceShareArgs struct {
    92  	// Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
    93  	Filters []GetResourceShareFilter `pulumi:"filters"`
    94  	// Name of the tag key to filter on.
    95  	Name *string `pulumi:"name"`
    96  	// Owner of the resource share. Valid values are `SELF` or `OTHER-ACCOUNTS`.
    97  	ResourceOwner string `pulumi:"resourceOwner"`
    98  	// Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are `PENDING`, `ACTIVE`, `FAILED`, `DELETING`, and `DELETED`.
    99  	ResourceShareStatus *string `pulumi:"resourceShareStatus"`
   100  	// Tags attached to the resource share.
   101  	Tags map[string]string `pulumi:"tags"`
   102  }
   103  
   104  // A collection of values returned by getResourceShare.
   105  type LookupResourceShareResult struct {
   106  	// ARN of the resource share.
   107  	Arn     string                   `pulumi:"arn"`
   108  	Filters []GetResourceShareFilter `pulumi:"filters"`
   109  	// The provider-assigned unique ID for this managed resource.
   110  	Id   string `pulumi:"id"`
   111  	Name string `pulumi:"name"`
   112  	// ID of the AWS account that owns the resource share.
   113  	OwningAccountId string `pulumi:"owningAccountId"`
   114  	// A list of resource ARNs associated with the resource share.
   115  	ResourceArns        []string `pulumi:"resourceArns"`
   116  	ResourceOwner       string   `pulumi:"resourceOwner"`
   117  	ResourceShareStatus *string  `pulumi:"resourceShareStatus"`
   118  	// Status of the resource share.
   119  	Status string `pulumi:"status"`
   120  	// Tags attached to the resource share.
   121  	Tags map[string]string `pulumi:"tags"`
   122  }
   123  
   124  func LookupResourceShareOutput(ctx *pulumi.Context, args LookupResourceShareOutputArgs, opts ...pulumi.InvokeOption) LookupResourceShareResultOutput {
   125  	return pulumi.ToOutputWithContext(context.Background(), args).
   126  		ApplyT(func(v interface{}) (LookupResourceShareResult, error) {
   127  			args := v.(LookupResourceShareArgs)
   128  			r, err := LookupResourceShare(ctx, &args, opts...)
   129  			var s LookupResourceShareResult
   130  			if r != nil {
   131  				s = *r
   132  			}
   133  			return s, err
   134  		}).(LookupResourceShareResultOutput)
   135  }
   136  
   137  // A collection of arguments for invoking getResourceShare.
   138  type LookupResourceShareOutputArgs struct {
   139  	// Filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
   140  	Filters GetResourceShareFilterArrayInput `pulumi:"filters"`
   141  	// Name of the tag key to filter on.
   142  	Name pulumi.StringPtrInput `pulumi:"name"`
   143  	// Owner of the resource share. Valid values are `SELF` or `OTHER-ACCOUNTS`.
   144  	ResourceOwner pulumi.StringInput `pulumi:"resourceOwner"`
   145  	// Specifies that you want to retrieve details of only those resource shares that have this status. Valid values are `PENDING`, `ACTIVE`, `FAILED`, `DELETING`, and `DELETED`.
   146  	ResourceShareStatus pulumi.StringPtrInput `pulumi:"resourceShareStatus"`
   147  	// Tags attached to the resource share.
   148  	Tags pulumi.StringMapInput `pulumi:"tags"`
   149  }
   150  
   151  func (LookupResourceShareOutputArgs) ElementType() reflect.Type {
   152  	return reflect.TypeOf((*LookupResourceShareArgs)(nil)).Elem()
   153  }
   154  
   155  // A collection of values returned by getResourceShare.
   156  type LookupResourceShareResultOutput struct{ *pulumi.OutputState }
   157  
   158  func (LookupResourceShareResultOutput) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*LookupResourceShareResult)(nil)).Elem()
   160  }
   161  
   162  func (o LookupResourceShareResultOutput) ToLookupResourceShareResultOutput() LookupResourceShareResultOutput {
   163  	return o
   164  }
   165  
   166  func (o LookupResourceShareResultOutput) ToLookupResourceShareResultOutputWithContext(ctx context.Context) LookupResourceShareResultOutput {
   167  	return o
   168  }
   169  
   170  // ARN of the resource share.
   171  func (o LookupResourceShareResultOutput) Arn() pulumi.StringOutput {
   172  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.Arn }).(pulumi.StringOutput)
   173  }
   174  
   175  func (o LookupResourceShareResultOutput) Filters() GetResourceShareFilterArrayOutput {
   176  	return o.ApplyT(func(v LookupResourceShareResult) []GetResourceShareFilter { return v.Filters }).(GetResourceShareFilterArrayOutput)
   177  }
   178  
   179  // The provider-assigned unique ID for this managed resource.
   180  func (o LookupResourceShareResultOutput) Id() pulumi.StringOutput {
   181  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.Id }).(pulumi.StringOutput)
   182  }
   183  
   184  func (o LookupResourceShareResultOutput) Name() pulumi.StringOutput {
   185  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.Name }).(pulumi.StringOutput)
   186  }
   187  
   188  // ID of the AWS account that owns the resource share.
   189  func (o LookupResourceShareResultOutput) OwningAccountId() pulumi.StringOutput {
   190  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.OwningAccountId }).(pulumi.StringOutput)
   191  }
   192  
   193  // A list of resource ARNs associated with the resource share.
   194  func (o LookupResourceShareResultOutput) ResourceArns() pulumi.StringArrayOutput {
   195  	return o.ApplyT(func(v LookupResourceShareResult) []string { return v.ResourceArns }).(pulumi.StringArrayOutput)
   196  }
   197  
   198  func (o LookupResourceShareResultOutput) ResourceOwner() pulumi.StringOutput {
   199  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.ResourceOwner }).(pulumi.StringOutput)
   200  }
   201  
   202  func (o LookupResourceShareResultOutput) ResourceShareStatus() pulumi.StringPtrOutput {
   203  	return o.ApplyT(func(v LookupResourceShareResult) *string { return v.ResourceShareStatus }).(pulumi.StringPtrOutput)
   204  }
   205  
   206  // Status of the resource share.
   207  func (o LookupResourceShareResultOutput) Status() pulumi.StringOutput {
   208  	return o.ApplyT(func(v LookupResourceShareResult) string { return v.Status }).(pulumi.StringOutput)
   209  }
   210  
   211  // Tags attached to the resource share.
   212  func (o LookupResourceShareResultOutput) Tags() pulumi.StringMapOutput {
   213  	return o.ApplyT(func(v LookupResourceShareResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   214  }
   215  
   216  func init() {
   217  	pulumi.RegisterOutputType(LookupResourceShareResultOutput{})
   218  }