-
Notifications
You must be signed in to change notification settings - Fork 51
/
dataLakeGen2Path.go
384 lines (331 loc) · 18.4 KB
/
dataLakeGen2Path.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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
// 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 storage
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Data Lake Gen2 Path in a File System within an Azure Storage Account.
//
// > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader).
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
// Name: pulumi.String("example-resources"),
// Location: pulumi.String("West Europe"),
// })
// if err != nil {
// return err
// }
// exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
// Name: pulumi.String("examplestorageacc"),
// ResourceGroupName: example.Name,
// Location: example.Location,
// AccountTier: pulumi.String("Standard"),
// AccountReplicationType: pulumi.String("LRS"),
// AccountKind: pulumi.String("StorageV2"),
// IsHnsEnabled: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "example", &storage.DataLakeGen2FilesystemArgs{
// Name: pulumi.String("example"),
// StorageAccountId: exampleAccount.ID(),
// })
// if err != nil {
// return err
// }
// _, err = storage.NewDataLakeGen2Path(ctx, "example", &storage.DataLakeGen2PathArgs{
// Path: pulumi.String("example"),
// FilesystemName: exampleDataLakeGen2Filesystem.Name,
// StorageAccountId: exampleAccount.ID(),
// Resource: pulumi.String("directory"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Data Lake Gen2 Paths can be imported using the `resource id`, e.g.
//
// ```sh
// $ pulumi import azure:storage/dataLakeGen2Path:DataLakeGen2Path example https://account1.dfs.core.windows.net/fileSystem1/path
// ```
type DataLakeGen2Path struct {
pulumi.CustomResourceState
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
Aces DataLakeGen2PathAceArrayOutput `pulumi:"aces"`
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
FilesystemName pulumi.StringOutput `pulumi:"filesystemName"`
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
Group pulumi.StringOutput `pulumi:"group"`
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
Owner pulumi.StringOutput `pulumi:"owner"`
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
Path pulumi.StringOutput `pulumi:"path"`
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
Resource pulumi.StringOutput `pulumi:"resource"`
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringOutput `pulumi:"storageAccountId"`
}
// NewDataLakeGen2Path registers a new resource with the given unique name, arguments, and options.
func NewDataLakeGen2Path(ctx *pulumi.Context,
name string, args *DataLakeGen2PathArgs, opts ...pulumi.ResourceOption) (*DataLakeGen2Path, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FilesystemName == nil {
return nil, errors.New("invalid value for required argument 'FilesystemName'")
}
if args.Path == nil {
return nil, errors.New("invalid value for required argument 'Path'")
}
if args.Resource == nil {
return nil, errors.New("invalid value for required argument 'Resource'")
}
if args.StorageAccountId == nil {
return nil, errors.New("invalid value for required argument 'StorageAccountId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DataLakeGen2Path
err := ctx.RegisterResource("azure:storage/dataLakeGen2Path:DataLakeGen2Path", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDataLakeGen2Path gets an existing DataLakeGen2Path 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 GetDataLakeGen2Path(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DataLakeGen2PathState, opts ...pulumi.ResourceOption) (*DataLakeGen2Path, error) {
var resource DataLakeGen2Path
err := ctx.ReadResource("azure:storage/dataLakeGen2Path:DataLakeGen2Path", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DataLakeGen2Path resources.
type dataLakeGen2PathState struct {
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
Aces []DataLakeGen2PathAce `pulumi:"aces"`
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
FilesystemName *string `pulumi:"filesystemName"`
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
Group *string `pulumi:"group"`
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
Owner *string `pulumi:"owner"`
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
Path *string `pulumi:"path"`
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
Resource *string `pulumi:"resource"`
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
StorageAccountId *string `pulumi:"storageAccountId"`
}
type DataLakeGen2PathState struct {
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
Aces DataLakeGen2PathAceArrayInput
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
FilesystemName pulumi.StringPtrInput
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
Group pulumi.StringPtrInput
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
Owner pulumi.StringPtrInput
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
Path pulumi.StringPtrInput
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
Resource pulumi.StringPtrInput
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringPtrInput
}
func (DataLakeGen2PathState) ElementType() reflect.Type {
return reflect.TypeOf((*dataLakeGen2PathState)(nil)).Elem()
}
type dataLakeGen2PathArgs struct {
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
Aces []DataLakeGen2PathAce `pulumi:"aces"`
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
FilesystemName string `pulumi:"filesystemName"`
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
Group *string `pulumi:"group"`
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
Owner *string `pulumi:"owner"`
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
Path string `pulumi:"path"`
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
Resource string `pulumi:"resource"`
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
StorageAccountId string `pulumi:"storageAccountId"`
}
// The set of arguments for constructing a DataLakeGen2Path resource.
type DataLakeGen2PathArgs struct {
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
Aces DataLakeGen2PathAceArrayInput
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
FilesystemName pulumi.StringInput
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
Group pulumi.StringPtrInput
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
Owner pulumi.StringPtrInput
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
Path pulumi.StringInput
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
Resource pulumi.StringInput
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
StorageAccountId pulumi.StringInput
}
func (DataLakeGen2PathArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dataLakeGen2PathArgs)(nil)).Elem()
}
type DataLakeGen2PathInput interface {
pulumi.Input
ToDataLakeGen2PathOutput() DataLakeGen2PathOutput
ToDataLakeGen2PathOutputWithContext(ctx context.Context) DataLakeGen2PathOutput
}
func (*DataLakeGen2Path) ElementType() reflect.Type {
return reflect.TypeOf((**DataLakeGen2Path)(nil)).Elem()
}
func (i *DataLakeGen2Path) ToDataLakeGen2PathOutput() DataLakeGen2PathOutput {
return i.ToDataLakeGen2PathOutputWithContext(context.Background())
}
func (i *DataLakeGen2Path) ToDataLakeGen2PathOutputWithContext(ctx context.Context) DataLakeGen2PathOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataLakeGen2PathOutput)
}
// DataLakeGen2PathArrayInput is an input type that accepts DataLakeGen2PathArray and DataLakeGen2PathArrayOutput values.
// You can construct a concrete instance of `DataLakeGen2PathArrayInput` via:
//
// DataLakeGen2PathArray{ DataLakeGen2PathArgs{...} }
type DataLakeGen2PathArrayInput interface {
pulumi.Input
ToDataLakeGen2PathArrayOutput() DataLakeGen2PathArrayOutput
ToDataLakeGen2PathArrayOutputWithContext(context.Context) DataLakeGen2PathArrayOutput
}
type DataLakeGen2PathArray []DataLakeGen2PathInput
func (DataLakeGen2PathArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataLakeGen2Path)(nil)).Elem()
}
func (i DataLakeGen2PathArray) ToDataLakeGen2PathArrayOutput() DataLakeGen2PathArrayOutput {
return i.ToDataLakeGen2PathArrayOutputWithContext(context.Background())
}
func (i DataLakeGen2PathArray) ToDataLakeGen2PathArrayOutputWithContext(ctx context.Context) DataLakeGen2PathArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataLakeGen2PathArrayOutput)
}
// DataLakeGen2PathMapInput is an input type that accepts DataLakeGen2PathMap and DataLakeGen2PathMapOutput values.
// You can construct a concrete instance of `DataLakeGen2PathMapInput` via:
//
// DataLakeGen2PathMap{ "key": DataLakeGen2PathArgs{...} }
type DataLakeGen2PathMapInput interface {
pulumi.Input
ToDataLakeGen2PathMapOutput() DataLakeGen2PathMapOutput
ToDataLakeGen2PathMapOutputWithContext(context.Context) DataLakeGen2PathMapOutput
}
type DataLakeGen2PathMap map[string]DataLakeGen2PathInput
func (DataLakeGen2PathMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataLakeGen2Path)(nil)).Elem()
}
func (i DataLakeGen2PathMap) ToDataLakeGen2PathMapOutput() DataLakeGen2PathMapOutput {
return i.ToDataLakeGen2PathMapOutputWithContext(context.Background())
}
func (i DataLakeGen2PathMap) ToDataLakeGen2PathMapOutputWithContext(ctx context.Context) DataLakeGen2PathMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DataLakeGen2PathMapOutput)
}
type DataLakeGen2PathOutput struct{ *pulumi.OutputState }
func (DataLakeGen2PathOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DataLakeGen2Path)(nil)).Elem()
}
func (o DataLakeGen2PathOutput) ToDataLakeGen2PathOutput() DataLakeGen2PathOutput {
return o
}
func (o DataLakeGen2PathOutput) ToDataLakeGen2PathOutputWithContext(ctx context.Context) DataLakeGen2PathOutput {
return o
}
// One or more `ace` blocks as defined below to specify the entries for the ACL for the path.
func (o DataLakeGen2PathOutput) Aces() DataLakeGen2PathAceArrayOutput {
return o.ApplyT(func(v *DataLakeGen2Path) DataLakeGen2PathAceArrayOutput { return v.Aces }).(DataLakeGen2PathAceArrayOutput)
}
// The name of the Data Lake Gen2 File System which should be created within the Storage Account. Must be unique within the storage account the queue is located. Changing this forces a new resource to be created.
func (o DataLakeGen2PathOutput) FilesystemName() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.FilesystemName }).(pulumi.StringOutput)
}
// Specifies the Object ID of the Azure Active Directory Group to make the owning group. Possible values also include `$superuser`.
func (o DataLakeGen2PathOutput) Group() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.Group }).(pulumi.StringOutput)
}
// Specifies the Object ID of the Azure Active Directory User to make the owning user. Possible values also include `$superuser`.
func (o DataLakeGen2PathOutput) Owner() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.Owner }).(pulumi.StringOutput)
}
// The path which should be created within the Data Lake Gen2 File System in the Storage Account. Changing this forces a new resource to be created.
func (o DataLakeGen2PathOutput) Path() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.Path }).(pulumi.StringOutput)
}
// Specifies the type for path to create. Currently only `directory` is supported. Changing this forces a new resource to be created.
func (o DataLakeGen2PathOutput) Resource() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.Resource }).(pulumi.StringOutput)
}
// Specifies the ID of the Storage Account in which the Data Lake Gen2 File System should exist. Changing this forces a new resource to be created.
func (o DataLakeGen2PathOutput) StorageAccountId() pulumi.StringOutput {
return o.ApplyT(func(v *DataLakeGen2Path) pulumi.StringOutput { return v.StorageAccountId }).(pulumi.StringOutput)
}
type DataLakeGen2PathArrayOutput struct{ *pulumi.OutputState }
func (DataLakeGen2PathArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DataLakeGen2Path)(nil)).Elem()
}
func (o DataLakeGen2PathArrayOutput) ToDataLakeGen2PathArrayOutput() DataLakeGen2PathArrayOutput {
return o
}
func (o DataLakeGen2PathArrayOutput) ToDataLakeGen2PathArrayOutputWithContext(ctx context.Context) DataLakeGen2PathArrayOutput {
return o
}
func (o DataLakeGen2PathArrayOutput) Index(i pulumi.IntInput) DataLakeGen2PathOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DataLakeGen2Path {
return vs[0].([]*DataLakeGen2Path)[vs[1].(int)]
}).(DataLakeGen2PathOutput)
}
type DataLakeGen2PathMapOutput struct{ *pulumi.OutputState }
func (DataLakeGen2PathMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DataLakeGen2Path)(nil)).Elem()
}
func (o DataLakeGen2PathMapOutput) ToDataLakeGen2PathMapOutput() DataLakeGen2PathMapOutput {
return o
}
func (o DataLakeGen2PathMapOutput) ToDataLakeGen2PathMapOutputWithContext(ctx context.Context) DataLakeGen2PathMapOutput {
return o
}
func (o DataLakeGen2PathMapOutput) MapIndex(k pulumi.StringInput) DataLakeGen2PathOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DataLakeGen2Path {
return vs[0].(map[string]*DataLakeGen2Path)[vs[1].(string)]
}).(DataLakeGen2PathOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DataLakeGen2PathInput)(nil)).Elem(), &DataLakeGen2Path{})
pulumi.RegisterInputType(reflect.TypeOf((*DataLakeGen2PathArrayInput)(nil)).Elem(), DataLakeGen2PathArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DataLakeGen2PathMapInput)(nil)).Elem(), DataLakeGen2PathMap{})
pulumi.RegisterOutputType(DataLakeGen2PathOutput{})
pulumi.RegisterOutputType(DataLakeGen2PathArrayOutput{})
pulumi.RegisterOutputType(DataLakeGen2PathMapOutput{})
}