-
Notifications
You must be signed in to change notification settings - Fork 151
/
getResourceShare.go
186 lines (164 loc) · 6.43 KB
/
getResourceShare.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ram
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `ram.ResourceShare` Retrieve information about a RAM Resource Share.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ram"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
// Name: "example",
// ResourceOwner: "SELF",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ## Search by filters
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ram"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ram.LookupResourceShare(ctx, &ram.LookupResourceShareArgs{
// Filters: []ram.GetResourceShareFilter{
// ram.GetResourceShareFilter{
// Name: "NameOfTag",
// Values: []string{
// "exampleNameTagValue",
// },
// },
// },
// Name: "MyResourceName",
// ResourceOwner: "SELF",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupResourceShare(ctx *pulumi.Context, args *LookupResourceShareArgs, opts ...pulumi.InvokeOption) (*LookupResourceShareResult, error) {
var rv LookupResourceShareResult
err := ctx.Invoke("aws:ram/getResourceShare:getResourceShare", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getResourceShare.
type LookupResourceShareArgs struct {
// A filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
Filters []GetResourceShareFilter `pulumi:"filters"`
// The name of the tag key to filter on.
Name string `pulumi:"name"`
// The owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS
ResourceOwner string `pulumi:"resourceOwner"`
// The Tags attached to the RAM share
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getResourceShare.
type LookupResourceShareResult struct {
// The Amazon Resource Name (ARN) of the resource share.
Arn string `pulumi:"arn"`
Filters []GetResourceShareFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// The ID of the AWS account that owns the resource share.
OwningAccountId string `pulumi:"owningAccountId"`
ResourceOwner string `pulumi:"resourceOwner"`
// The Status of the RAM share.
Status string `pulumi:"status"`
// The Tags attached to the RAM share
Tags map[string]string `pulumi:"tags"`
}
func LookupResourceShareOutput(ctx *pulumi.Context, args LookupResourceShareOutputArgs, opts ...pulumi.InvokeOption) LookupResourceShareResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupResourceShareResult, error) {
args := v.(LookupResourceShareArgs)
r, err := LookupResourceShare(ctx, &args, opts...)
return *r, err
}).(LookupResourceShareResultOutput)
}
// A collection of arguments for invoking getResourceShare.
type LookupResourceShareOutputArgs struct {
// A filter used to scope the list e.g., by tags. See [related docs] (https://docs.aws.amazon.com/ram/latest/APIReference/API_TagFilter.html).
Filters GetResourceShareFilterArrayInput `pulumi:"filters"`
// The name of the tag key to filter on.
Name pulumi.StringInput `pulumi:"name"`
// The owner of the resource share. Valid values are SELF or OTHER-ACCOUNTS
ResourceOwner pulumi.StringInput `pulumi:"resourceOwner"`
// The Tags attached to the RAM share
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupResourceShareOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupResourceShareArgs)(nil)).Elem()
}
// A collection of values returned by getResourceShare.
type LookupResourceShareResultOutput struct{ *pulumi.OutputState }
func (LookupResourceShareResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupResourceShareResult)(nil)).Elem()
}
func (o LookupResourceShareResultOutput) ToLookupResourceShareResultOutput() LookupResourceShareResultOutput {
return o
}
func (o LookupResourceShareResultOutput) ToLookupResourceShareResultOutputWithContext(ctx context.Context) LookupResourceShareResultOutput {
return o
}
// The Amazon Resource Name (ARN) of the resource share.
func (o LookupResourceShareResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.Arn }).(pulumi.StringOutput)
}
func (o LookupResourceShareResultOutput) Filters() GetResourceShareFilterArrayOutput {
return o.ApplyT(func(v LookupResourceShareResult) []GetResourceShareFilter { return v.Filters }).(GetResourceShareFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupResourceShareResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupResourceShareResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.Name }).(pulumi.StringOutput)
}
// The ID of the AWS account that owns the resource share.
func (o LookupResourceShareResultOutput) OwningAccountId() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.OwningAccountId }).(pulumi.StringOutput)
}
func (o LookupResourceShareResultOutput) ResourceOwner() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.ResourceOwner }).(pulumi.StringOutput)
}
// The Status of the RAM share.
func (o LookupResourceShareResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupResourceShareResult) string { return v.Status }).(pulumi.StringOutput)
}
// The Tags attached to the RAM share
func (o LookupResourceShareResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupResourceShareResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupResourceShareResultOutput{})
}