/
sharedDirectoryAccepter.go
309 lines (258 loc) · 13.3 KB
/
sharedDirectoryAccepter.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package directoryservice
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Accepts a shared directory in a consumer account.
//
// > **NOTE:** Destroying this resource removes the shared directory from the consumer account only.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/directoryservice"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleSharedDirectory, err := directoryservice.NewSharedDirectory(ctx, "exampleSharedDirectory", &directoryservice.SharedDirectoryArgs{
// DirectoryId: pulumi.Any(aws_directory_service_directory.Example.Id),
// Notes: pulumi.String("example"),
// Target: &directoryservice.SharedDirectoryTargetArgs{
// Id: pulumi.Any(data.Aws_caller_identity.Receiver.Account_id),
// },
// })
// if err != nil {
// return err
// }
// _, err = directoryservice.NewSharedDirectoryAccepter(ctx, "exampleSharedDirectoryAccepter", &directoryservice.SharedDirectoryAccepterArgs{
// SharedDirectoryId: exampleSharedDirectory.SharedDirectoryId,
// }, pulumi.Provider("awsalternate"))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Directory Service Shared Directories can be imported using the shared directory ID, e.g.,
//
// ```sh
//
// $ pulumi import aws:directoryservice/sharedDirectoryAccepter:SharedDirectoryAccepter example d-9267633ece
//
// ```
type SharedDirectoryAccepter struct {
pulumi.CustomResourceState
// Method used when sharing a directory (i.e., `ORGANIZATIONS` or `HANDSHAKE`).
Method pulumi.StringOutput `pulumi:"method"`
// Message sent by the directory owner to the directory consumer to help the directory consumer administrator determine whether to approve or reject the share invitation.
Notes pulumi.StringOutput `pulumi:"notes"`
// Account identifier of the directory owner.
OwnerAccountId pulumi.StringOutput `pulumi:"ownerAccountId"`
// Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.
OwnerDirectoryId pulumi.StringOutput `pulumi:"ownerDirectoryId"`
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
SharedDirectoryId pulumi.StringOutput `pulumi:"sharedDirectoryId"`
}
// NewSharedDirectoryAccepter registers a new resource with the given unique name, arguments, and options.
func NewSharedDirectoryAccepter(ctx *pulumi.Context,
name string, args *SharedDirectoryAccepterArgs, opts ...pulumi.ResourceOption) (*SharedDirectoryAccepter, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.SharedDirectoryId == nil {
return nil, errors.New("invalid value for required argument 'SharedDirectoryId'")
}
var resource SharedDirectoryAccepter
err := ctx.RegisterResource("aws:directoryservice/sharedDirectoryAccepter:SharedDirectoryAccepter", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSharedDirectoryAccepter gets an existing SharedDirectoryAccepter resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetSharedDirectoryAccepter(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SharedDirectoryAccepterState, opts ...pulumi.ResourceOption) (*SharedDirectoryAccepter, error) {
var resource SharedDirectoryAccepter
err := ctx.ReadResource("aws:directoryservice/sharedDirectoryAccepter:SharedDirectoryAccepter", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SharedDirectoryAccepter resources.
type sharedDirectoryAccepterState struct {
// Method used when sharing a directory (i.e., `ORGANIZATIONS` or `HANDSHAKE`).
Method *string `pulumi:"method"`
// Message sent by the directory owner to the directory consumer to help the directory consumer administrator determine whether to approve or reject the share invitation.
Notes *string `pulumi:"notes"`
// Account identifier of the directory owner.
OwnerAccountId *string `pulumi:"ownerAccountId"`
// Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.
OwnerDirectoryId *string `pulumi:"ownerDirectoryId"`
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
SharedDirectoryId *string `pulumi:"sharedDirectoryId"`
}
type SharedDirectoryAccepterState struct {
// Method used when sharing a directory (i.e., `ORGANIZATIONS` or `HANDSHAKE`).
Method pulumi.StringPtrInput
// Message sent by the directory owner to the directory consumer to help the directory consumer administrator determine whether to approve or reject the share invitation.
Notes pulumi.StringPtrInput
// Account identifier of the directory owner.
OwnerAccountId pulumi.StringPtrInput
// Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.
OwnerDirectoryId pulumi.StringPtrInput
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
SharedDirectoryId pulumi.StringPtrInput
}
func (SharedDirectoryAccepterState) ElementType() reflect.Type {
return reflect.TypeOf((*sharedDirectoryAccepterState)(nil)).Elem()
}
type sharedDirectoryAccepterArgs struct {
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
SharedDirectoryId string `pulumi:"sharedDirectoryId"`
}
// The set of arguments for constructing a SharedDirectoryAccepter resource.
type SharedDirectoryAccepterArgs struct {
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
SharedDirectoryId pulumi.StringInput
}
func (SharedDirectoryAccepterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*sharedDirectoryAccepterArgs)(nil)).Elem()
}
type SharedDirectoryAccepterInput interface {
pulumi.Input
ToSharedDirectoryAccepterOutput() SharedDirectoryAccepterOutput
ToSharedDirectoryAccepterOutputWithContext(ctx context.Context) SharedDirectoryAccepterOutput
}
func (*SharedDirectoryAccepter) ElementType() reflect.Type {
return reflect.TypeOf((**SharedDirectoryAccepter)(nil)).Elem()
}
func (i *SharedDirectoryAccepter) ToSharedDirectoryAccepterOutput() SharedDirectoryAccepterOutput {
return i.ToSharedDirectoryAccepterOutputWithContext(context.Background())
}
func (i *SharedDirectoryAccepter) ToSharedDirectoryAccepterOutputWithContext(ctx context.Context) SharedDirectoryAccepterOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedDirectoryAccepterOutput)
}
// SharedDirectoryAccepterArrayInput is an input type that accepts SharedDirectoryAccepterArray and SharedDirectoryAccepterArrayOutput values.
// You can construct a concrete instance of `SharedDirectoryAccepterArrayInput` via:
//
// SharedDirectoryAccepterArray{ SharedDirectoryAccepterArgs{...} }
type SharedDirectoryAccepterArrayInput interface {
pulumi.Input
ToSharedDirectoryAccepterArrayOutput() SharedDirectoryAccepterArrayOutput
ToSharedDirectoryAccepterArrayOutputWithContext(context.Context) SharedDirectoryAccepterArrayOutput
}
type SharedDirectoryAccepterArray []SharedDirectoryAccepterInput
func (SharedDirectoryAccepterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SharedDirectoryAccepter)(nil)).Elem()
}
func (i SharedDirectoryAccepterArray) ToSharedDirectoryAccepterArrayOutput() SharedDirectoryAccepterArrayOutput {
return i.ToSharedDirectoryAccepterArrayOutputWithContext(context.Background())
}
func (i SharedDirectoryAccepterArray) ToSharedDirectoryAccepterArrayOutputWithContext(ctx context.Context) SharedDirectoryAccepterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedDirectoryAccepterArrayOutput)
}
// SharedDirectoryAccepterMapInput is an input type that accepts SharedDirectoryAccepterMap and SharedDirectoryAccepterMapOutput values.
// You can construct a concrete instance of `SharedDirectoryAccepterMapInput` via:
//
// SharedDirectoryAccepterMap{ "key": SharedDirectoryAccepterArgs{...} }
type SharedDirectoryAccepterMapInput interface {
pulumi.Input
ToSharedDirectoryAccepterMapOutput() SharedDirectoryAccepterMapOutput
ToSharedDirectoryAccepterMapOutputWithContext(context.Context) SharedDirectoryAccepterMapOutput
}
type SharedDirectoryAccepterMap map[string]SharedDirectoryAccepterInput
func (SharedDirectoryAccepterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SharedDirectoryAccepter)(nil)).Elem()
}
func (i SharedDirectoryAccepterMap) ToSharedDirectoryAccepterMapOutput() SharedDirectoryAccepterMapOutput {
return i.ToSharedDirectoryAccepterMapOutputWithContext(context.Background())
}
func (i SharedDirectoryAccepterMap) ToSharedDirectoryAccepterMapOutputWithContext(ctx context.Context) SharedDirectoryAccepterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(SharedDirectoryAccepterMapOutput)
}
type SharedDirectoryAccepterOutput struct{ *pulumi.OutputState }
func (SharedDirectoryAccepterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SharedDirectoryAccepter)(nil)).Elem()
}
func (o SharedDirectoryAccepterOutput) ToSharedDirectoryAccepterOutput() SharedDirectoryAccepterOutput {
return o
}
func (o SharedDirectoryAccepterOutput) ToSharedDirectoryAccepterOutputWithContext(ctx context.Context) SharedDirectoryAccepterOutput {
return o
}
// Method used when sharing a directory (i.e., `ORGANIZATIONS` or `HANDSHAKE`).
func (o SharedDirectoryAccepterOutput) Method() pulumi.StringOutput {
return o.ApplyT(func(v *SharedDirectoryAccepter) pulumi.StringOutput { return v.Method }).(pulumi.StringOutput)
}
// Message sent by the directory owner to the directory consumer to help the directory consumer administrator determine whether to approve or reject the share invitation.
func (o SharedDirectoryAccepterOutput) Notes() pulumi.StringOutput {
return o.ApplyT(func(v *SharedDirectoryAccepter) pulumi.StringOutput { return v.Notes }).(pulumi.StringOutput)
}
// Account identifier of the directory owner.
func (o SharedDirectoryAccepterOutput) OwnerAccountId() pulumi.StringOutput {
return o.ApplyT(func(v *SharedDirectoryAccepter) pulumi.StringOutput { return v.OwnerAccountId }).(pulumi.StringOutput)
}
// Identifier of the Managed Microsoft AD directory from the perspective of the directory owner.
func (o SharedDirectoryAccepterOutput) OwnerDirectoryId() pulumi.StringOutput {
return o.ApplyT(func(v *SharedDirectoryAccepter) pulumi.StringOutput { return v.OwnerDirectoryId }).(pulumi.StringOutput)
}
// Identifier of the directory that is stored in the directory consumer account that corresponds to the shared directory in the owner account.
func (o SharedDirectoryAccepterOutput) SharedDirectoryId() pulumi.StringOutput {
return o.ApplyT(func(v *SharedDirectoryAccepter) pulumi.StringOutput { return v.SharedDirectoryId }).(pulumi.StringOutput)
}
type SharedDirectoryAccepterArrayOutput struct{ *pulumi.OutputState }
func (SharedDirectoryAccepterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*SharedDirectoryAccepter)(nil)).Elem()
}
func (o SharedDirectoryAccepterArrayOutput) ToSharedDirectoryAccepterArrayOutput() SharedDirectoryAccepterArrayOutput {
return o
}
func (o SharedDirectoryAccepterArrayOutput) ToSharedDirectoryAccepterArrayOutputWithContext(ctx context.Context) SharedDirectoryAccepterArrayOutput {
return o
}
func (o SharedDirectoryAccepterArrayOutput) Index(i pulumi.IntInput) SharedDirectoryAccepterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SharedDirectoryAccepter {
return vs[0].([]*SharedDirectoryAccepter)[vs[1].(int)]
}).(SharedDirectoryAccepterOutput)
}
type SharedDirectoryAccepterMapOutput struct{ *pulumi.OutputState }
func (SharedDirectoryAccepterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*SharedDirectoryAccepter)(nil)).Elem()
}
func (o SharedDirectoryAccepterMapOutput) ToSharedDirectoryAccepterMapOutput() SharedDirectoryAccepterMapOutput {
return o
}
func (o SharedDirectoryAccepterMapOutput) ToSharedDirectoryAccepterMapOutputWithContext(ctx context.Context) SharedDirectoryAccepterMapOutput {
return o
}
func (o SharedDirectoryAccepterMapOutput) MapIndex(k pulumi.StringInput) SharedDirectoryAccepterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SharedDirectoryAccepter {
return vs[0].(map[string]*SharedDirectoryAccepter)[vs[1].(string)]
}).(SharedDirectoryAccepterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*SharedDirectoryAccepterInput)(nil)).Elem(), &SharedDirectoryAccepter{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedDirectoryAccepterArrayInput)(nil)).Elem(), SharedDirectoryAccepterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*SharedDirectoryAccepterMapInput)(nil)).Elem(), SharedDirectoryAccepterMap{})
pulumi.RegisterOutputType(SharedDirectoryAccepterOutput{})
pulumi.RegisterOutputType(SharedDirectoryAccepterArrayOutput{})
pulumi.RegisterOutputType(SharedDirectoryAccepterMapOutput{})
}