generated from pulumi/pulumi-tf-provider-boilerplate
/
storage.go
510 lines (447 loc) · 24.6 KB
/
storage.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
498
499
500
501
502
503
504
505
506
507
508
509
510
// 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 cbs
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a CBS.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Cbs"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Cbs.NewStorage(ctx, "storage", &Cbs.StorageArgs{
// AvailabilityZone: pulumi.String("ap-guangzhou-3"),
// Encrypt: pulumi.Bool(false),
// ProjectId: pulumi.Int(0),
// StorageName: pulumi.String("mystorage"),
// StorageSize: pulumi.Int(100),
// StorageType: pulumi.String("CLOUD_SSD"),
// Tags: pulumi.AnyMap{
// "test": pulumi.Any("tf"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// CBS storage can be imported using the id, e.g.
//
// ```sh
// $ pulumi import tencentcloud:Cbs/storage:Storage storage disk-41s6jwy4
// ```
type Storage struct {
pulumi.CustomResourceState
// Indicates whether the CBS is mounted the CVM.
Attached pulumi.BoolOutput `pulumi:"attached"`
// The available zone that the CBS instance locates at.
AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"`
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
ChargeType pulumi.StringPtrOutput `pulumi:"chargeType"`
// The quota of backup points of cloud disk.
DiskBackupQuota pulumi.IntOutput `pulumi:"diskBackupQuota"`
// Indicates whether CBS is encrypted.
Encrypt pulumi.BoolPtrOutput `pulumi:"encrypt"`
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
ForceDelete pulumi.BoolPtrOutput `pulumi:"forceDelete"`
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
Period pulumi.IntPtrOutput `pulumi:"period"`
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
PrepaidPeriod pulumi.IntOutput `pulumi:"prepaidPeriod"`
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
PrepaidRenewFlag pulumi.StringOutput `pulumi:"prepaidRenewFlag"`
// ID of the project to which the instance belongs.
ProjectId pulumi.IntPtrOutput `pulumi:"projectId"`
// ID of the snapshot. If specified, created the CBS by this snapshot.
SnapshotId pulumi.StringOutput `pulumi:"snapshotId"`
// Name of CBS. The maximum length can not exceed 60 bytes.
StorageName pulumi.StringOutput `pulumi:"storageName"`
// Volume of CBS, and unit is GB.
StorageSize pulumi.IntOutput `pulumi:"storageSize"`
// Status of CBS. Valid values: UNATTACHED, ATTACHING, ATTACHED, DETACHING, EXPANDING, ROLLBACKING, TORECYCLE and DUMPING.
StorageStatus pulumi.StringOutput `pulumi:"storageStatus"`
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
StorageType pulumi.StringOutput `pulumi:"storageType"`
// The available tags within this CBS.
Tags pulumi.MapOutput `pulumi:"tags"`
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
ThroughputPerformance pulumi.IntPtrOutput `pulumi:"throughputPerformance"`
}
// NewStorage registers a new resource with the given unique name, arguments, and options.
func NewStorage(ctx *pulumi.Context,
name string, args *StorageArgs, opts ...pulumi.ResourceOption) (*Storage, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AvailabilityZone == nil {
return nil, errors.New("invalid value for required argument 'AvailabilityZone'")
}
if args.StorageName == nil {
return nil, errors.New("invalid value for required argument 'StorageName'")
}
if args.StorageSize == nil {
return nil, errors.New("invalid value for required argument 'StorageSize'")
}
if args.StorageType == nil {
return nil, errors.New("invalid value for required argument 'StorageType'")
}
opts = pkgResourceDefaultOpts(opts)
var resource Storage
err := ctx.RegisterResource("tencentcloud:Cbs/storage:Storage", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetStorage gets an existing Storage 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 GetStorage(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *StorageState, opts ...pulumi.ResourceOption) (*Storage, error) {
var resource Storage
err := ctx.ReadResource("tencentcloud:Cbs/storage:Storage", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Storage resources.
type storageState struct {
// Indicates whether the CBS is mounted the CVM.
Attached *bool `pulumi:"attached"`
// The available zone that the CBS instance locates at.
AvailabilityZone *string `pulumi:"availabilityZone"`
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
ChargeType *string `pulumi:"chargeType"`
// The quota of backup points of cloud disk.
DiskBackupQuota *int `pulumi:"diskBackupQuota"`
// Indicates whether CBS is encrypted.
Encrypt *bool `pulumi:"encrypt"`
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
ForceDelete *bool `pulumi:"forceDelete"`
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
Period *int `pulumi:"period"`
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
PrepaidPeriod *int `pulumi:"prepaidPeriod"`
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
PrepaidRenewFlag *string `pulumi:"prepaidRenewFlag"`
// ID of the project to which the instance belongs.
ProjectId *int `pulumi:"projectId"`
// ID of the snapshot. If specified, created the CBS by this snapshot.
SnapshotId *string `pulumi:"snapshotId"`
// Name of CBS. The maximum length can not exceed 60 bytes.
StorageName *string `pulumi:"storageName"`
// Volume of CBS, and unit is GB.
StorageSize *int `pulumi:"storageSize"`
// Status of CBS. Valid values: UNATTACHED, ATTACHING, ATTACHED, DETACHING, EXPANDING, ROLLBACKING, TORECYCLE and DUMPING.
StorageStatus *string `pulumi:"storageStatus"`
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
StorageType *string `pulumi:"storageType"`
// The available tags within this CBS.
Tags map[string]interface{} `pulumi:"tags"`
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
ThroughputPerformance *int `pulumi:"throughputPerformance"`
}
type StorageState struct {
// Indicates whether the CBS is mounted the CVM.
Attached pulumi.BoolPtrInput
// The available zone that the CBS instance locates at.
AvailabilityZone pulumi.StringPtrInput
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
ChargeType pulumi.StringPtrInput
// The quota of backup points of cloud disk.
DiskBackupQuota pulumi.IntPtrInput
// Indicates whether CBS is encrypted.
Encrypt pulumi.BoolPtrInput
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
ForceDelete pulumi.BoolPtrInput
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
Period pulumi.IntPtrInput
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
PrepaidPeriod pulumi.IntPtrInput
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
PrepaidRenewFlag pulumi.StringPtrInput
// ID of the project to which the instance belongs.
ProjectId pulumi.IntPtrInput
// ID of the snapshot. If specified, created the CBS by this snapshot.
SnapshotId pulumi.StringPtrInput
// Name of CBS. The maximum length can not exceed 60 bytes.
StorageName pulumi.StringPtrInput
// Volume of CBS, and unit is GB.
StorageSize pulumi.IntPtrInput
// Status of CBS. Valid values: UNATTACHED, ATTACHING, ATTACHED, DETACHING, EXPANDING, ROLLBACKING, TORECYCLE and DUMPING.
StorageStatus pulumi.StringPtrInput
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
StorageType pulumi.StringPtrInput
// The available tags within this CBS.
Tags pulumi.MapInput
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
ThroughputPerformance pulumi.IntPtrInput
}
func (StorageState) ElementType() reflect.Type {
return reflect.TypeOf((*storageState)(nil)).Elem()
}
type storageArgs struct {
// The available zone that the CBS instance locates at.
AvailabilityZone string `pulumi:"availabilityZone"`
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
ChargeType *string `pulumi:"chargeType"`
// The quota of backup points of cloud disk.
DiskBackupQuota *int `pulumi:"diskBackupQuota"`
// Indicates whether CBS is encrypted.
Encrypt *bool `pulumi:"encrypt"`
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
ForceDelete *bool `pulumi:"forceDelete"`
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
Period *int `pulumi:"period"`
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
PrepaidPeriod *int `pulumi:"prepaidPeriod"`
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
PrepaidRenewFlag *string `pulumi:"prepaidRenewFlag"`
// ID of the project to which the instance belongs.
ProjectId *int `pulumi:"projectId"`
// ID of the snapshot. If specified, created the CBS by this snapshot.
SnapshotId *string `pulumi:"snapshotId"`
// Name of CBS. The maximum length can not exceed 60 bytes.
StorageName string `pulumi:"storageName"`
// Volume of CBS, and unit is GB.
StorageSize int `pulumi:"storageSize"`
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
StorageType string `pulumi:"storageType"`
// The available tags within this CBS.
Tags map[string]interface{} `pulumi:"tags"`
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
ThroughputPerformance *int `pulumi:"throughputPerformance"`
}
// The set of arguments for constructing a Storage resource.
type StorageArgs struct {
// The available zone that the CBS instance locates at.
AvailabilityZone pulumi.StringInput
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
ChargeType pulumi.StringPtrInput
// The quota of backup points of cloud disk.
DiskBackupQuota pulumi.IntPtrInput
// Indicates whether CBS is encrypted.
Encrypt pulumi.BoolPtrInput
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
ForceDelete pulumi.BoolPtrInput
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
Period pulumi.IntPtrInput
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
PrepaidPeriod pulumi.IntPtrInput
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
PrepaidRenewFlag pulumi.StringPtrInput
// ID of the project to which the instance belongs.
ProjectId pulumi.IntPtrInput
// ID of the snapshot. If specified, created the CBS by this snapshot.
SnapshotId pulumi.StringPtrInput
// Name of CBS. The maximum length can not exceed 60 bytes.
StorageName pulumi.StringInput
// Volume of CBS, and unit is GB.
StorageSize pulumi.IntInput
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
StorageType pulumi.StringInput
// The available tags within this CBS.
Tags pulumi.MapInput
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
ThroughputPerformance pulumi.IntPtrInput
}
func (StorageArgs) ElementType() reflect.Type {
return reflect.TypeOf((*storageArgs)(nil)).Elem()
}
type StorageInput interface {
pulumi.Input
ToStorageOutput() StorageOutput
ToStorageOutputWithContext(ctx context.Context) StorageOutput
}
func (*Storage) ElementType() reflect.Type {
return reflect.TypeOf((**Storage)(nil)).Elem()
}
func (i *Storage) ToStorageOutput() StorageOutput {
return i.ToStorageOutputWithContext(context.Background())
}
func (i *Storage) ToStorageOutputWithContext(ctx context.Context) StorageOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageOutput)
}
// StorageArrayInput is an input type that accepts StorageArray and StorageArrayOutput values.
// You can construct a concrete instance of `StorageArrayInput` via:
//
// StorageArray{ StorageArgs{...} }
type StorageArrayInput interface {
pulumi.Input
ToStorageArrayOutput() StorageArrayOutput
ToStorageArrayOutputWithContext(context.Context) StorageArrayOutput
}
type StorageArray []StorageInput
func (StorageArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Storage)(nil)).Elem()
}
func (i StorageArray) ToStorageArrayOutput() StorageArrayOutput {
return i.ToStorageArrayOutputWithContext(context.Background())
}
func (i StorageArray) ToStorageArrayOutputWithContext(ctx context.Context) StorageArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageArrayOutput)
}
// StorageMapInput is an input type that accepts StorageMap and StorageMapOutput values.
// You can construct a concrete instance of `StorageMapInput` via:
//
// StorageMap{ "key": StorageArgs{...} }
type StorageMapInput interface {
pulumi.Input
ToStorageMapOutput() StorageMapOutput
ToStorageMapOutputWithContext(context.Context) StorageMapOutput
}
type StorageMap map[string]StorageInput
func (StorageMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Storage)(nil)).Elem()
}
func (i StorageMap) ToStorageMapOutput() StorageMapOutput {
return i.ToStorageMapOutputWithContext(context.Background())
}
func (i StorageMap) ToStorageMapOutputWithContext(ctx context.Context) StorageMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(StorageMapOutput)
}
type StorageOutput struct{ *pulumi.OutputState }
func (StorageOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Storage)(nil)).Elem()
}
func (o StorageOutput) ToStorageOutput() StorageOutput {
return o
}
func (o StorageOutput) ToStorageOutputWithContext(ctx context.Context) StorageOutput {
return o
}
// Indicates whether the CBS is mounted the CVM.
func (o StorageOutput) Attached() pulumi.BoolOutput {
return o.ApplyT(func(v *Storage) pulumi.BoolOutput { return v.Attached }).(pulumi.BoolOutput)
}
// The available zone that the CBS instance locates at.
func (o StorageOutput) AvailabilityZone() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput)
}
// The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
func (o StorageOutput) ChargeType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.StringPtrOutput { return v.ChargeType }).(pulumi.StringPtrOutput)
}
// The quota of backup points of cloud disk.
func (o StorageOutput) DiskBackupQuota() pulumi.IntOutput {
return o.ApplyT(func(v *Storage) pulumi.IntOutput { return v.DiskBackupQuota }).(pulumi.IntOutput)
}
// Indicates whether CBS is encrypted.
func (o StorageOutput) Encrypt() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.BoolPtrOutput { return v.Encrypt }).(pulumi.BoolPtrOutput)
}
// Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.
func (o StorageOutput) ForceDelete() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.BoolPtrOutput { return v.ForceDelete }).(pulumi.BoolPtrOutput)
}
// It has been deprecated from version 1.33.0. Set `prepaidPeriod` instead. The purchased usage period of CBS. Valid values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36].
//
// Deprecated: It has been deprecated from version 1.33.0. Set `prepaid_period` instead.
func (o StorageOutput) Period() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.IntPtrOutput { return v.Period }).(pulumi.IntPtrOutput)
}
// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when chargeType is set to `PREPAID`. Valid values are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36.
func (o StorageOutput) PrepaidPeriod() pulumi.IntOutput {
return o.ApplyT(func(v *Storage) pulumi.IntOutput { return v.PrepaidPeriod }).(pulumi.IntOutput)
}
// Auto Renewal flag. Value range: `NOTIFY_AND_AUTO_RENEW`: Notify expiry and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: Neither notify expiry nor renew automatically. Default value range: `NOTIFY_AND_MANUAL_RENEW`: Notify expiry but do not renew automatically. NOTE: it only works when chargeType is set to `PREPAID`.
func (o StorageOutput) PrepaidRenewFlag() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.PrepaidRenewFlag }).(pulumi.StringOutput)
}
// ID of the project to which the instance belongs.
func (o StorageOutput) ProjectId() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.IntPtrOutput { return v.ProjectId }).(pulumi.IntPtrOutput)
}
// ID of the snapshot. If specified, created the CBS by this snapshot.
func (o StorageOutput) SnapshotId() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.SnapshotId }).(pulumi.StringOutput)
}
// Name of CBS. The maximum length can not exceed 60 bytes.
func (o StorageOutput) StorageName() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.StorageName }).(pulumi.StringOutput)
}
// Volume of CBS, and unit is GB.
func (o StorageOutput) StorageSize() pulumi.IntOutput {
return o.ApplyT(func(v *Storage) pulumi.IntOutput { return v.StorageSize }).(pulumi.IntOutput)
}
// Status of CBS. Valid values: UNATTACHED, ATTACHING, ATTACHED, DETACHING, EXPANDING, ROLLBACKING, TORECYCLE and DUMPING.
func (o StorageOutput) StorageStatus() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.StorageStatus }).(pulumi.StringOutput)
}
// Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
func (o StorageOutput) StorageType() pulumi.StringOutput {
return o.ApplyT(func(v *Storage) pulumi.StringOutput { return v.StorageType }).(pulumi.StringOutput)
}
// The available tags within this CBS.
func (o StorageOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *Storage) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
// Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.
func (o StorageOutput) ThroughputPerformance() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Storage) pulumi.IntPtrOutput { return v.ThroughputPerformance }).(pulumi.IntPtrOutput)
}
type StorageArrayOutput struct{ *pulumi.OutputState }
func (StorageArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Storage)(nil)).Elem()
}
func (o StorageArrayOutput) ToStorageArrayOutput() StorageArrayOutput {
return o
}
func (o StorageArrayOutput) ToStorageArrayOutputWithContext(ctx context.Context) StorageArrayOutput {
return o
}
func (o StorageArrayOutput) Index(i pulumi.IntInput) StorageOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Storage {
return vs[0].([]*Storage)[vs[1].(int)]
}).(StorageOutput)
}
type StorageMapOutput struct{ *pulumi.OutputState }
func (StorageMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Storage)(nil)).Elem()
}
func (o StorageMapOutput) ToStorageMapOutput() StorageMapOutput {
return o
}
func (o StorageMapOutput) ToStorageMapOutputWithContext(ctx context.Context) StorageMapOutput {
return o
}
func (o StorageMapOutput) MapIndex(k pulumi.StringInput) StorageOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Storage {
return vs[0].(map[string]*Storage)[vs[1].(string)]
}).(StorageOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*StorageInput)(nil)).Elem(), &Storage{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageArrayInput)(nil)).Elem(), StorageArray{})
pulumi.RegisterInputType(reflect.TypeOf((*StorageMapInput)(nil)).Elem(), StorageMap{})
pulumi.RegisterOutputType(StorageOutput{})
pulumi.RegisterOutputType(StorageArrayOutput{})
pulumi.RegisterOutputType(StorageMapOutput{})
}