-
Notifications
You must be signed in to change notification settings - Fork 151
/
accessPoint.go
347 lines (286 loc) · 11.6 KB
/
accessPoint.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
// *** 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 efs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an Elastic File System (EFS) access point.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/efs"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := efs.NewAccessPoint(ctx, "test", &efs.AccessPointArgs{
// FileSystemId: pulumi.Any(aws_efs_file_system.Foo.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// The EFS access points can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import aws:efs/accessPoint:AccessPoint test fsap-52a643fb
// ```
type AccessPoint struct {
pulumi.CustomResourceState
// ARN of the access point.
Arn pulumi.StringOutput `pulumi:"arn"`
// ARN of the file system.
FileSystemArn pulumi.StringOutput `pulumi:"fileSystemArn"`
// ID of the file system for which the access point is intended.
FileSystemId pulumi.StringOutput `pulumi:"fileSystemId"`
OwnerId pulumi.StringOutput `pulumi:"ownerId"`
// Operating system user and group applied to all file system requests made using the access point. Detailed below.
PosixUser AccessPointPosixUserPtrOutput `pulumi:"posixUser"`
// Directory on the Amazon EFS file system that the access point provides access to. Detailed below.
RootDirectory AccessPointRootDirectoryOutput `pulumi:"rootDirectory"`
Tags pulumi.StringMapOutput `pulumi:"tags"`
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewAccessPoint registers a new resource with the given unique name, arguments, and options.
func NewAccessPoint(ctx *pulumi.Context,
name string, args *AccessPointArgs, opts ...pulumi.ResourceOption) (*AccessPoint, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FileSystemId == nil {
return nil, errors.New("invalid value for required argument 'FileSystemId'")
}
var resource AccessPoint
err := ctx.RegisterResource("aws:efs/accessPoint:AccessPoint", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAccessPoint gets an existing AccessPoint 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 GetAccessPoint(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AccessPointState, opts ...pulumi.ResourceOption) (*AccessPoint, error) {
var resource AccessPoint
err := ctx.ReadResource("aws:efs/accessPoint:AccessPoint", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AccessPoint resources.
type accessPointState struct {
// ARN of the access point.
Arn *string `pulumi:"arn"`
// ARN of the file system.
FileSystemArn *string `pulumi:"fileSystemArn"`
// ID of the file system for which the access point is intended.
FileSystemId *string `pulumi:"fileSystemId"`
OwnerId *string `pulumi:"ownerId"`
// Operating system user and group applied to all file system requests made using the access point. Detailed below.
PosixUser *AccessPointPosixUser `pulumi:"posixUser"`
// Directory on the Amazon EFS file system that the access point provides access to. Detailed below.
RootDirectory *AccessPointRootDirectory `pulumi:"rootDirectory"`
Tags map[string]string `pulumi:"tags"`
TagsAll map[string]string `pulumi:"tagsAll"`
}
type AccessPointState struct {
// ARN of the access point.
Arn pulumi.StringPtrInput
// ARN of the file system.
FileSystemArn pulumi.StringPtrInput
// ID of the file system for which the access point is intended.
FileSystemId pulumi.StringPtrInput
OwnerId pulumi.StringPtrInput
// Operating system user and group applied to all file system requests made using the access point. Detailed below.
PosixUser AccessPointPosixUserPtrInput
// Directory on the Amazon EFS file system that the access point provides access to. Detailed below.
RootDirectory AccessPointRootDirectoryPtrInput
Tags pulumi.StringMapInput
TagsAll pulumi.StringMapInput
}
func (AccessPointState) ElementType() reflect.Type {
return reflect.TypeOf((*accessPointState)(nil)).Elem()
}
type accessPointArgs struct {
// ID of the file system for which the access point is intended.
FileSystemId string `pulumi:"fileSystemId"`
// Operating system user and group applied to all file system requests made using the access point. Detailed below.
PosixUser *AccessPointPosixUser `pulumi:"posixUser"`
// Directory on the Amazon EFS file system that the access point provides access to. Detailed below.
RootDirectory *AccessPointRootDirectory `pulumi:"rootDirectory"`
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a AccessPoint resource.
type AccessPointArgs struct {
// ID of the file system for which the access point is intended.
FileSystemId pulumi.StringInput
// Operating system user and group applied to all file system requests made using the access point. Detailed below.
PosixUser AccessPointPosixUserPtrInput
// Directory on the Amazon EFS file system that the access point provides access to. Detailed below.
RootDirectory AccessPointRootDirectoryPtrInput
Tags pulumi.StringMapInput
}
func (AccessPointArgs) ElementType() reflect.Type {
return reflect.TypeOf((*accessPointArgs)(nil)).Elem()
}
type AccessPointInput interface {
pulumi.Input
ToAccessPointOutput() AccessPointOutput
ToAccessPointOutputWithContext(ctx context.Context) AccessPointOutput
}
func (*AccessPoint) ElementType() reflect.Type {
return reflect.TypeOf((*AccessPoint)(nil))
}
func (i *AccessPoint) ToAccessPointOutput() AccessPointOutput {
return i.ToAccessPointOutputWithContext(context.Background())
}
func (i *AccessPoint) ToAccessPointOutputWithContext(ctx context.Context) AccessPointOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessPointOutput)
}
func (i *AccessPoint) ToAccessPointPtrOutput() AccessPointPtrOutput {
return i.ToAccessPointPtrOutputWithContext(context.Background())
}
func (i *AccessPoint) ToAccessPointPtrOutputWithContext(ctx context.Context) AccessPointPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessPointPtrOutput)
}
type AccessPointPtrInput interface {
pulumi.Input
ToAccessPointPtrOutput() AccessPointPtrOutput
ToAccessPointPtrOutputWithContext(ctx context.Context) AccessPointPtrOutput
}
type accessPointPtrType AccessPointArgs
func (*accessPointPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccessPoint)(nil))
}
func (i *accessPointPtrType) ToAccessPointPtrOutput() AccessPointPtrOutput {
return i.ToAccessPointPtrOutputWithContext(context.Background())
}
func (i *accessPointPtrType) ToAccessPointPtrOutputWithContext(ctx context.Context) AccessPointPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessPointPtrOutput)
}
// AccessPointArrayInput is an input type that accepts AccessPointArray and AccessPointArrayOutput values.
// You can construct a concrete instance of `AccessPointArrayInput` via:
//
// AccessPointArray{ AccessPointArgs{...} }
type AccessPointArrayInput interface {
pulumi.Input
ToAccessPointArrayOutput() AccessPointArrayOutput
ToAccessPointArrayOutputWithContext(context.Context) AccessPointArrayOutput
}
type AccessPointArray []AccessPointInput
func (AccessPointArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AccessPoint)(nil)).Elem()
}
func (i AccessPointArray) ToAccessPointArrayOutput() AccessPointArrayOutput {
return i.ToAccessPointArrayOutputWithContext(context.Background())
}
func (i AccessPointArray) ToAccessPointArrayOutputWithContext(ctx context.Context) AccessPointArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessPointArrayOutput)
}
// AccessPointMapInput is an input type that accepts AccessPointMap and AccessPointMapOutput values.
// You can construct a concrete instance of `AccessPointMapInput` via:
//
// AccessPointMap{ "key": AccessPointArgs{...} }
type AccessPointMapInput interface {
pulumi.Input
ToAccessPointMapOutput() AccessPointMapOutput
ToAccessPointMapOutputWithContext(context.Context) AccessPointMapOutput
}
type AccessPointMap map[string]AccessPointInput
func (AccessPointMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AccessPoint)(nil)).Elem()
}
func (i AccessPointMap) ToAccessPointMapOutput() AccessPointMapOutput {
return i.ToAccessPointMapOutputWithContext(context.Background())
}
func (i AccessPointMap) ToAccessPointMapOutputWithContext(ctx context.Context) AccessPointMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessPointMapOutput)
}
type AccessPointOutput struct{ *pulumi.OutputState }
func (AccessPointOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccessPoint)(nil))
}
func (o AccessPointOutput) ToAccessPointOutput() AccessPointOutput {
return o
}
func (o AccessPointOutput) ToAccessPointOutputWithContext(ctx context.Context) AccessPointOutput {
return o
}
func (o AccessPointOutput) ToAccessPointPtrOutput() AccessPointPtrOutput {
return o.ToAccessPointPtrOutputWithContext(context.Background())
}
func (o AccessPointOutput) ToAccessPointPtrOutputWithContext(ctx context.Context) AccessPointPtrOutput {
return o.ApplyTWithContext(ctx, func(_ context.Context, v AccessPoint) *AccessPoint {
return &v
}).(AccessPointPtrOutput)
}
type AccessPointPtrOutput struct{ *pulumi.OutputState }
func (AccessPointPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccessPoint)(nil))
}
func (o AccessPointPtrOutput) ToAccessPointPtrOutput() AccessPointPtrOutput {
return o
}
func (o AccessPointPtrOutput) ToAccessPointPtrOutputWithContext(ctx context.Context) AccessPointPtrOutput {
return o
}
func (o AccessPointPtrOutput) Elem() AccessPointOutput {
return o.ApplyT(func(v *AccessPoint) AccessPoint {
if v != nil {
return *v
}
var ret AccessPoint
return ret
}).(AccessPointOutput)
}
type AccessPointArrayOutput struct{ *pulumi.OutputState }
func (AccessPointArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]AccessPoint)(nil))
}
func (o AccessPointArrayOutput) ToAccessPointArrayOutput() AccessPointArrayOutput {
return o
}
func (o AccessPointArrayOutput) ToAccessPointArrayOutputWithContext(ctx context.Context) AccessPointArrayOutput {
return o
}
func (o AccessPointArrayOutput) Index(i pulumi.IntInput) AccessPointOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) AccessPoint {
return vs[0].([]AccessPoint)[vs[1].(int)]
}).(AccessPointOutput)
}
type AccessPointMapOutput struct{ *pulumi.OutputState }
func (AccessPointMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]AccessPoint)(nil))
}
func (o AccessPointMapOutput) ToAccessPointMapOutput() AccessPointMapOutput {
return o
}
func (o AccessPointMapOutput) ToAccessPointMapOutputWithContext(ctx context.Context) AccessPointMapOutput {
return o
}
func (o AccessPointMapOutput) MapIndex(k pulumi.StringInput) AccessPointOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) AccessPoint {
return vs[0].(map[string]AccessPoint)[vs[1].(string)]
}).(AccessPointOutput)
}
func init() {
pulumi.RegisterOutputType(AccessPointOutput{})
pulumi.RegisterOutputType(AccessPointPtrOutput{})
pulumi.RegisterOutputType(AccessPointArrayOutput{})
pulumi.RegisterOutputType(AccessPointMapOutput{})
}