generated from pulumi/pulumi-tf-provider-boilerplate
/
storageProfile.go
497 lines (436 loc) · 20.4 KB
/
storageProfile.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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
// 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 storageprofile
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
// ### S
// This is an example of how to create a storage profile resource.
//
// **Vra storage profile:**
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-vra/sdk/go/vra/storageprofile"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-vra/sdk/go/vra/storageprofile"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := storageprofile.NewStorageProfile(ctx, "thisStorageProfile", &storageprofile.StorageProfileArgs{
// Description: pulumi.String("vSphere Storage Profile with standard independent non-persistent disk."),
// RegionId: pulumi.Any(data.Vra_region.This.Id),
// DefaultItem: pulumi.Bool(false),
// DiskProperties: pulumi.AnyMap{
// "independent": pulumi.Any("true"),
// "persistent": pulumi.Any("false"),
// "limitIops": pulumi.Any("2000"),
// "provisioningType": pulumi.Any("eagerZeroedThick"),
// "sharesLevel": pulumi.Any("custom"),
// "shares": pulumi.Any("1500"),
// },
// DiskTargetProperties: pulumi.AnyMap{
// "datastoreId": pulumi.Any(data.Vra_fabric_datastore_vsphere.This.Id),
// "storagePolicyId": pulumi.Any(data.Vra_fabric_storage_policy_vsphere.This.Id),
// },
// Tags: storageprofile.StorageProfileTagArray{
// &storageprofile.StorageProfileTagArgs{
// Key: pulumi.String("foo"),
// Value: pulumi.String("bar"),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = storageprofile.NewStorageProfile(ctx, "thisStorageprofile/storageProfileStorageProfile", &storageprofile.StorageProfileArgs{
// Description: pulumi.String("AWS Storage Profile with instance store device type."),
// RegionId: pulumi.Any(data.Vra_region.This.Id),
// DefaultItem: pulumi.Bool(false),
// DiskProperties: pulumi.AnyMap{
// "deviceType": pulumi.Any("instance-store"),
// },
// Tags: storageprofile.StorageProfileTagArray{
// &storageprofile.StorageProfileTagArgs{
// Key: pulumi.String("foo"),
// Value: pulumi.String("bar"),
// },
// },
// })
// if err != nil {
// return err
// }
// _, err = storageprofile.NewStorageProfile(ctx, "thisVraStorageprofile/storageProfileStorageProfile", &storageprofile.StorageProfileArgs{
// Description: pulumi.String("Azure Storage Profile with managed disks."),
// RegionId: pulumi.Any(data.Vra_region.This.Id),
// DefaultItem: pulumi.Bool(false),
// SupportsEncryption: pulumi.Bool(false),
// DiskProperties: pulumi.AnyMap{
// "azureDataDiskCaching": pulumi.Any("None"),
// "azureManagedDiskType": pulumi.Any("Standard_LRS"),
// "azureOsDiskCaching": pulumi.Any("None"),
// },
// Tags: storageprofile.StorageProfileTagArray{
// &storageprofile.StorageProfileTagArgs{
// Key: pulumi.String("foo"),
// Value: pulumi.String("bar"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// A storage profile resource supports the following arguments:
type StorageProfile struct {
pulumi.CustomResourceState
// Id of the cloud account this storage profile belongs to.
CloudAccountId pulumi.StringOutput `pulumi:"cloudAccountId"`
// Date when the entity was created. The date is in ISO 6801 and UTC.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// Indicates if this storage profile is a default profile.
DefaultItem pulumi.BoolOutput `pulumi:"defaultItem"`
// A human-friendly description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties pulumi.MapOutput `pulumi:"diskProperties"`
// Map of storage placements to know where the disk is provisioned.
DiskTargetProperties pulumi.MapOutput `pulumi:"diskTargetProperties"`
// The id of the region as seen in the cloud provider for which this profile is defined.
ExternalRegionId pulumi.StringOutput `pulumi:"externalRegionId"`
// HATEOAS of the entity
Links StorageProfileLinkArrayOutput `pulumi:"links"`
// A human-friendly name used as an identifier in APIs that support this option.
Name pulumi.StringOutput `pulumi:"name"`
// The id of the organization this entity belongs to.
OrgId pulumi.StringOutput `pulumi:"orgId"`
// Email of the user that owns the entity.
Owner pulumi.StringOutput `pulumi:"owner"`
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
RegionId pulumi.StringOutput `pulumi:"regionId"`
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption pulumi.BoolOutput `pulumi:"supportsEncryption"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags StorageProfileTagArrayOutput `pulumi:"tags"`
// Date when the entity was last updated. The date is ISO 8601 and UTC.
UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
}
// NewStorageProfile registers a new resource with the given unique name, arguments, and options.
func NewStorageProfile(ctx *pulumi.Context,
name string, args *StorageProfileArgs, opts ...pulumi.ResourceOption) (*StorageProfile, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DefaultItem == nil {
return nil, errors.New("invalid value for required argument 'DefaultItem'")
}
if args.RegionId == nil {
return nil, errors.New("invalid value for required argument 'RegionId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource StorageProfile
err := ctx.RegisterResource("vra:storageprofile/storageProfile:StorageProfile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetStorageProfile gets an existing StorageProfile 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 GetStorageProfile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *StorageProfileState, opts ...pulumi.ResourceOption) (*StorageProfile, error) {
var resource StorageProfile
err := ctx.ReadResource("vra:storageprofile/storageProfile:StorageProfile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering StorageProfile resources.
type storageProfileState struct {
// Id of the cloud account this storage profile belongs to.
CloudAccountId *string `pulumi:"cloudAccountId"`
// Date when the entity was created. The date is in ISO 6801 and UTC.
CreatedAt *string `pulumi:"createdAt"`
// Indicates if this storage profile is a default profile.
DefaultItem *bool `pulumi:"defaultItem"`
// A human-friendly description.
Description *string `pulumi:"description"`
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties map[string]interface{} `pulumi:"diskProperties"`
// Map of storage placements to know where the disk is provisioned.
DiskTargetProperties map[string]interface{} `pulumi:"diskTargetProperties"`
// The id of the region as seen in the cloud provider for which this profile is defined.
ExternalRegionId *string `pulumi:"externalRegionId"`
// HATEOAS of the entity
Links []StorageProfileLink `pulumi:"links"`
// A human-friendly name used as an identifier in APIs that support this option.
Name *string `pulumi:"name"`
// The id of the organization this entity belongs to.
OrgId *string `pulumi:"orgId"`
// Email of the user that owns the entity.
Owner *string `pulumi:"owner"`
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
RegionId *string `pulumi:"regionId"`
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption *bool `pulumi:"supportsEncryption"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags []StorageProfileTag `pulumi:"tags"`
// Date when the entity was last updated. The date is ISO 8601 and UTC.
UpdatedAt *string `pulumi:"updatedAt"`
}
type StorageProfileState struct {
// Id of the cloud account this storage profile belongs to.
CloudAccountId pulumi.StringPtrInput
// Date when the entity was created. The date is in ISO 6801 and UTC.
CreatedAt pulumi.StringPtrInput
// Indicates if this storage profile is a default profile.
DefaultItem pulumi.BoolPtrInput
// A human-friendly description.
Description pulumi.StringPtrInput
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties pulumi.MapInput
// Map of storage placements to know where the disk is provisioned.
DiskTargetProperties pulumi.MapInput
// The id of the region as seen in the cloud provider for which this profile is defined.
ExternalRegionId pulumi.StringPtrInput
// HATEOAS of the entity
Links StorageProfileLinkArrayInput
// A human-friendly name used as an identifier in APIs that support this option.
Name pulumi.StringPtrInput
// The id of the organization this entity belongs to.
OrgId pulumi.StringPtrInput
// Email of the user that owns the entity.
Owner pulumi.StringPtrInput
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
RegionId pulumi.StringPtrInput
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption pulumi.BoolPtrInput
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags StorageProfileTagArrayInput
// Date when the entity was last updated. The date is ISO 8601 and UTC.
UpdatedAt pulumi.StringPtrInput
}
func (StorageProfileState) ElementType() reflect.Type {
return reflect.TypeOf((*storageProfileState)(nil)).Elem()
}
type storageProfileArgs struct {
// Indicates if this storage profile is a default profile.
DefaultItem bool `pulumi:"defaultItem"`
// A human-friendly description.
Description *string `pulumi:"description"`
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties map[string]interface{} `pulumi:"diskProperties"`
// Map of storage placements to know where the disk is provisioned.
DiskTargetProperties map[string]interface{} `pulumi:"diskTargetProperties"`
// A human-friendly name used as an identifier in APIs that support this option.
Name *string `pulumi:"name"`
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
RegionId string `pulumi:"regionId"`
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption *bool `pulumi:"supportsEncryption"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags []StorageProfileTag `pulumi:"tags"`
}
// The set of arguments for constructing a StorageProfile resource.
type StorageProfileArgs struct {
// Indicates if this storage profile is a default profile.
DefaultItem pulumi.BoolInput
// A human-friendly description.
Description pulumi.StringPtrInput
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties pulumi.MapInput
// Map of storage placements to know where the disk is provisioned.
DiskTargetProperties pulumi.MapInput
// A human-friendly name used as an identifier in APIs that support this option.
Name pulumi.StringPtrInput
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
RegionId pulumi.StringInput
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption pulumi.BoolPtrInput
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags StorageProfileTagArrayInput
}
func (StorageProfileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*storageProfileArgs)(nil)).Elem()
}
type StorageProfileInput interface {
pulumi.Input
ToStorageProfileOutput() StorageProfileOutput
ToStorageProfileOutputWithContext(ctx context.Context) StorageProfileOutput
}
func (*StorageProfile) ElementType() reflect.Type {
return reflect.TypeOf((**StorageProfile)(nil)).Elem()
}
func (i *StorageProfile) ToStorageProfileOutput() StorageProfileOutput {
return i.ToStorageProfileOutputWithContext(context.Background())
}
func (i *StorageProfile) ToStorageProfileOutputWithContext(ctx context.Context) StorageProfileOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageProfileOutput)
}
// StorageProfileArrayInput is an input type that accepts StorageProfileArray and StorageProfileArrayOutput values.
// You can construct a concrete instance of `StorageProfileArrayInput` via:
//
// StorageProfileArray{ StorageProfileArgs{...} }
type StorageProfileArrayInput interface {
pulumi.Input
ToStorageProfileArrayOutput() StorageProfileArrayOutput
ToStorageProfileArrayOutputWithContext(context.Context) StorageProfileArrayOutput
}
type StorageProfileArray []StorageProfileInput
func (StorageProfileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*StorageProfile)(nil)).Elem()
}
func (i StorageProfileArray) ToStorageProfileArrayOutput() StorageProfileArrayOutput {
return i.ToStorageProfileArrayOutputWithContext(context.Background())
}
func (i StorageProfileArray) ToStorageProfileArrayOutputWithContext(ctx context.Context) StorageProfileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageProfileArrayOutput)
}
// StorageProfileMapInput is an input type that accepts StorageProfileMap and StorageProfileMapOutput values.
// You can construct a concrete instance of `StorageProfileMapInput` via:
//
// StorageProfileMap{ "key": StorageProfileArgs{...} }
type StorageProfileMapInput interface {
pulumi.Input
ToStorageProfileMapOutput() StorageProfileMapOutput
ToStorageProfileMapOutputWithContext(context.Context) StorageProfileMapOutput
}
type StorageProfileMap map[string]StorageProfileInput
func (StorageProfileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*StorageProfile)(nil)).Elem()
}
func (i StorageProfileMap) ToStorageProfileMapOutput() StorageProfileMapOutput {
return i.ToStorageProfileMapOutputWithContext(context.Background())
}
func (i StorageProfileMap) ToStorageProfileMapOutputWithContext(ctx context.Context) StorageProfileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageProfileMapOutput)
}
type StorageProfileOutput struct{ *pulumi.OutputState }
func (StorageProfileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**StorageProfile)(nil)).Elem()
}
func (o StorageProfileOutput) ToStorageProfileOutput() StorageProfileOutput {
return o
}
func (o StorageProfileOutput) ToStorageProfileOutputWithContext(ctx context.Context) StorageProfileOutput {
return o
}
// Id of the cloud account this storage profile belongs to.
func (o StorageProfileOutput) CloudAccountId() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.CloudAccountId }).(pulumi.StringOutput)
}
// Date when the entity was created. The date is in ISO 6801 and UTC.
func (o StorageProfileOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// Indicates if this storage profile is a default profile.
func (o StorageProfileOutput) DefaultItem() pulumi.BoolOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.BoolOutput { return v.DefaultItem }).(pulumi.BoolOutput)
}
// A human-friendly description.
func (o StorageProfileOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Map of storage properties that are to be applied on disk while provisioning.
func (o StorageProfileOutput) DiskProperties() pulumi.MapOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.MapOutput { return v.DiskProperties }).(pulumi.MapOutput)
}
// Map of storage placements to know where the disk is provisioned.
func (o StorageProfileOutput) DiskTargetProperties() pulumi.MapOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.MapOutput { return v.DiskTargetProperties }).(pulumi.MapOutput)
}
// The id of the region as seen in the cloud provider for which this profile is defined.
func (o StorageProfileOutput) ExternalRegionId() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.ExternalRegionId }).(pulumi.StringOutput)
}
// HATEOAS of the entity
func (o StorageProfileOutput) Links() StorageProfileLinkArrayOutput {
return o.ApplyT(func(v *StorageProfile) StorageProfileLinkArrayOutput { return v.Links }).(StorageProfileLinkArrayOutput)
}
// A human-friendly name used as an identifier in APIs that support this option.
func (o StorageProfileOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The id of the organization this entity belongs to.
func (o StorageProfileOutput) OrgId() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.OrgId }).(pulumi.StringOutput)
}
// Email of the user that owns the entity.
func (o StorageProfileOutput) Owner() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.Owner }).(pulumi.StringOutput)
}
// The id of the region for which this profile is defined as in vRealize Automation(vRA).
func (o StorageProfileOutput) RegionId() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.RegionId }).(pulumi.StringOutput)
}
// Indicates whether this storage profile supports encryption or not.
func (o StorageProfileOutput) SupportsEncryption() pulumi.BoolOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.BoolOutput { return v.SupportsEncryption }).(pulumi.BoolOutput)
}
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
func (o StorageProfileOutput) Tags() StorageProfileTagArrayOutput {
return o.ApplyT(func(v *StorageProfile) StorageProfileTagArrayOutput { return v.Tags }).(StorageProfileTagArrayOutput)
}
// Date when the entity was last updated. The date is ISO 8601 and UTC.
func (o StorageProfileOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *StorageProfile) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
}
type StorageProfileArrayOutput struct{ *pulumi.OutputState }
func (StorageProfileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*StorageProfile)(nil)).Elem()
}
func (o StorageProfileArrayOutput) ToStorageProfileArrayOutput() StorageProfileArrayOutput {
return o
}
func (o StorageProfileArrayOutput) ToStorageProfileArrayOutputWithContext(ctx context.Context) StorageProfileArrayOutput {
return o
}
func (o StorageProfileArrayOutput) Index(i pulumi.IntInput) StorageProfileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *StorageProfile {
return vs[0].([]*StorageProfile)[vs[1].(int)]
}).(StorageProfileOutput)
}
type StorageProfileMapOutput struct{ *pulumi.OutputState }
func (StorageProfileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*StorageProfile)(nil)).Elem()
}
func (o StorageProfileMapOutput) ToStorageProfileMapOutput() StorageProfileMapOutput {
return o
}
func (o StorageProfileMapOutput) ToStorageProfileMapOutputWithContext(ctx context.Context) StorageProfileMapOutput {
return o
}
func (o StorageProfileMapOutput) MapIndex(k pulumi.StringInput) StorageProfileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *StorageProfile {
return vs[0].(map[string]*StorageProfile)[vs[1].(string)]
}).(StorageProfileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*StorageProfileInput)(nil)).Elem(), &StorageProfile{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageProfileArrayInput)(nil)).Elem(), StorageProfileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageProfileMapInput)(nil)).Elem(), StorageProfileMap{})
pulumi.RegisterOutputType(StorageProfileOutput{})
pulumi.RegisterOutputType(StorageProfileArrayOutput{})
pulumi.RegisterOutputType(StorageProfileMapOutput{})
}