generated from pulumi/pulumi-tf-provider-boilerplate
/
dedicatedHost.go
542 lines (481 loc) · 26.2 KB
/
dedicatedHost.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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
// 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 cddc
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a ApsaraDB for MyBase Dedicated Host resource.
//
// For information about ApsaraDB for MyBase Dedicated Host and how to use it, see [What is Dedicated Host](https://www.alibabacloud.com/help/doc-detail/210864.html).
//
// > **NOTE:** Available in v1.147.0+.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/cddc"
// "github.com/pulumi/pulumi-alicloud/sdk/go/alicloud/vpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cddc"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/vpc"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
// NameRegex: pulumi.StringRef("default-NODELETING"),
// }, nil)
// if err != nil {
// return err
// }
// defaultZones, err := cddc.GetZones(ctx, nil, nil)
// if err != nil {
// return err
// }
// defaultHostEcsLevelInfos, err := cddc.GetHostEcsLevelInfos(ctx, &cddc.GetHostEcsLevelInfosArgs{
// DbType: "mysql",
// ZoneId: defaultZones.Ids[0],
// StorageType: "cloud_essd",
// }, nil)
// if err != nil {
// return err
// }
// defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
// VpcId: pulumi.StringRef(defaultNetworks.Ids[0]),
// ZoneId: pulumi.StringRef(defaultZones.Ids[0]),
// }, nil)
// if err != nil {
// return err
// }
// defaultDedicatedHostGroup, err := cddc.NewDedicatedHostGroup(ctx, "defaultDedicatedHostGroup", &cddc.DedicatedHostGroupArgs{
// Engine: pulumi.String("MySQL"),
// VpcId: pulumi.String(defaultNetworks.Ids[0]),
// CpuAllocationRatio: pulumi.Int(101),
// MemAllocationRatio: pulumi.Int(50),
// DiskAllocationRatio: pulumi.Int(200),
// AllocationPolicy: pulumi.String("Evenly"),
// HostReplacePolicy: pulumi.String("Manual"),
// DedicatedHostGroupDesc: pulumi.String("example_value"),
// })
// if err != nil {
// return err
// }
// _, err = cddc.NewDedicatedHost(ctx, "defaultDedicatedHost", &cddc.DedicatedHostArgs{
// HostName: pulumi.String("example_value"),
// DedicatedHostGroupId: defaultDedicatedHostGroup.ID(),
// HostClass: pulumi.String(defaultHostEcsLevelInfos.Infos[0].ResClassCode),
// ZoneId: pulumi.String(defaultZones.Ids[0]),
// VswitchId: pulumi.String(defaultSwitches.Ids[0]),
// PaymentType: pulumi.String("Subscription"),
// Tags: pulumi.AnyMap{
// "Created": pulumi.Any("TF"),
// "For": pulumi.Any("CDDC_DEDICATED"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// ApsaraDB for MyBase Dedicated Host can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:cddc/dedicatedHost:DedicatedHost example <dedicated_host_group_id>:<dedicated_host_id>
//
// ```
type DedicatedHost struct {
pulumi.CustomResourceState
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
AllocationStatus pulumi.StringOutput `pulumi:"allocationStatus"`
// Specifies whether to enable the auto-renewal feature.
AutoRenew pulumi.BoolPtrOutput `pulumi:"autoRenew"`
// The ID of the dedicated cluster.
DedicatedHostGroupId pulumi.StringOutput `pulumi:"dedicatedHostGroupId"`
// The ID of the host.
DedicatedHostId pulumi.StringOutput `pulumi:"dedicatedHostId"`
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
HostClass pulumi.StringOutput `pulumi:"hostClass"`
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
HostName pulumi.StringOutput `pulumi:"hostName"`
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
ImageCategory pulumi.StringPtrOutput `pulumi:"imageCategory"`
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
OsPassword pulumi.StringPtrOutput `pulumi:"osPassword"`
// The payment type of the resource. Valid values: `Subscription`.
PaymentType pulumi.StringOutput `pulumi:"paymentType"`
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
Period pulumi.StringPtrOutput `pulumi:"period"`
// The state of the host. Valid values: `0:` The host is being created. `1`: The host is running. `2`: The host is faulty. `3`: The host is ready for deactivation. `4`: The host is being maintained. `5`: The host is deactivated. `6`: The host is restarting. `7`: The host is locked.
Status pulumi.StringOutput `pulumi:"status"`
// A mapping of tags to assign to the resource.
Tags pulumi.MapOutput `pulumi:"tags"`
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
UsedTime pulumi.IntPtrOutput `pulumi:"usedTime"`
// The ID of the vSwitch to which the host is connected.
VswitchId pulumi.StringOutput `pulumi:"vswitchId"`
// The ID of the zone.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewDedicatedHost registers a new resource with the given unique name, arguments, and options.
func NewDedicatedHost(ctx *pulumi.Context,
name string, args *DedicatedHostArgs, opts ...pulumi.ResourceOption) (*DedicatedHost, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DedicatedHostGroupId == nil {
return nil, errors.New("invalid value for required argument 'DedicatedHostGroupId'")
}
if args.HostClass == nil {
return nil, errors.New("invalid value for required argument 'HostClass'")
}
if args.PaymentType == nil {
return nil, errors.New("invalid value for required argument 'PaymentType'")
}
if args.VswitchId == nil {
return nil, errors.New("invalid value for required argument 'VswitchId'")
}
if args.ZoneId == nil {
return nil, errors.New("invalid value for required argument 'ZoneId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource DedicatedHost
err := ctx.RegisterResource("alicloud:cddc/dedicatedHost:DedicatedHost", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDedicatedHost gets an existing DedicatedHost 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 GetDedicatedHost(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DedicatedHostState, opts ...pulumi.ResourceOption) (*DedicatedHost, error) {
var resource DedicatedHost
err := ctx.ReadResource("alicloud:cddc/dedicatedHost:DedicatedHost", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DedicatedHost resources.
type dedicatedHostState struct {
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
AllocationStatus *string `pulumi:"allocationStatus"`
// Specifies whether to enable the auto-renewal feature.
AutoRenew *bool `pulumi:"autoRenew"`
// The ID of the dedicated cluster.
DedicatedHostGroupId *string `pulumi:"dedicatedHostGroupId"`
// The ID of the host.
DedicatedHostId *string `pulumi:"dedicatedHostId"`
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
HostClass *string `pulumi:"hostClass"`
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
HostName *string `pulumi:"hostName"`
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
ImageCategory *string `pulumi:"imageCategory"`
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
OsPassword *string `pulumi:"osPassword"`
// The payment type of the resource. Valid values: `Subscription`.
PaymentType *string `pulumi:"paymentType"`
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
Period *string `pulumi:"period"`
// The state of the host. Valid values: `0:` The host is being created. `1`: The host is running. `2`: The host is faulty. `3`: The host is ready for deactivation. `4`: The host is being maintained. `5`: The host is deactivated. `6`: The host is restarting. `7`: The host is locked.
Status *string `pulumi:"status"`
// A mapping of tags to assign to the resource.
Tags map[string]interface{} `pulumi:"tags"`
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
UsedTime *int `pulumi:"usedTime"`
// The ID of the vSwitch to which the host is connected.
VswitchId *string `pulumi:"vswitchId"`
// The ID of the zone.
ZoneId *string `pulumi:"zoneId"`
}
type DedicatedHostState struct {
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
AllocationStatus pulumi.StringPtrInput
// Specifies whether to enable the auto-renewal feature.
AutoRenew pulumi.BoolPtrInput
// The ID of the dedicated cluster.
DedicatedHostGroupId pulumi.StringPtrInput
// The ID of the host.
DedicatedHostId pulumi.StringPtrInput
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
HostClass pulumi.StringPtrInput
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
HostName pulumi.StringPtrInput
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
ImageCategory pulumi.StringPtrInput
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
OsPassword pulumi.StringPtrInput
// The payment type of the resource. Valid values: `Subscription`.
PaymentType pulumi.StringPtrInput
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
Period pulumi.StringPtrInput
// The state of the host. Valid values: `0:` The host is being created. `1`: The host is running. `2`: The host is faulty. `3`: The host is ready for deactivation. `4`: The host is being maintained. `5`: The host is deactivated. `6`: The host is restarting. `7`: The host is locked.
Status pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.MapInput
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
UsedTime pulumi.IntPtrInput
// The ID of the vSwitch to which the host is connected.
VswitchId pulumi.StringPtrInput
// The ID of the zone.
ZoneId pulumi.StringPtrInput
}
func (DedicatedHostState) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostState)(nil)).Elem()
}
type dedicatedHostArgs struct {
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
AllocationStatus *string `pulumi:"allocationStatus"`
// Specifies whether to enable the auto-renewal feature.
AutoRenew *bool `pulumi:"autoRenew"`
// The ID of the dedicated cluster.
DedicatedHostGroupId string `pulumi:"dedicatedHostGroupId"`
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
HostClass string `pulumi:"hostClass"`
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
HostName *string `pulumi:"hostName"`
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
ImageCategory *string `pulumi:"imageCategory"`
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
OsPassword *string `pulumi:"osPassword"`
// The payment type of the resource. Valid values: `Subscription`.
PaymentType string `pulumi:"paymentType"`
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
Period *string `pulumi:"period"`
// A mapping of tags to assign to the resource.
Tags map[string]interface{} `pulumi:"tags"`
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
UsedTime *int `pulumi:"usedTime"`
// The ID of the vSwitch to which the host is connected.
VswitchId string `pulumi:"vswitchId"`
// The ID of the zone.
ZoneId string `pulumi:"zoneId"`
}
// The set of arguments for constructing a DedicatedHost resource.
type DedicatedHostArgs struct {
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
AllocationStatus pulumi.StringPtrInput
// Specifies whether to enable the auto-renewal feature.
AutoRenew pulumi.BoolPtrInput
// The ID of the dedicated cluster.
DedicatedHostGroupId pulumi.StringInput
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
HostClass pulumi.StringInput
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
HostName pulumi.StringPtrInput
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
ImageCategory pulumi.StringPtrInput
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
OsPassword pulumi.StringPtrInput
// The payment type of the resource. Valid values: `Subscription`.
PaymentType pulumi.StringInput
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
Period pulumi.StringPtrInput
// A mapping of tags to assign to the resource.
Tags pulumi.MapInput
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
UsedTime pulumi.IntPtrInput
// The ID of the vSwitch to which the host is connected.
VswitchId pulumi.StringInput
// The ID of the zone.
ZoneId pulumi.StringInput
}
func (DedicatedHostArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dedicatedHostArgs)(nil)).Elem()
}
type DedicatedHostInput interface {
pulumi.Input
ToDedicatedHostOutput() DedicatedHostOutput
ToDedicatedHostOutputWithContext(ctx context.Context) DedicatedHostOutput
}
func (*DedicatedHost) ElementType() reflect.Type {
return reflect.TypeOf((**DedicatedHost)(nil)).Elem()
}
func (i *DedicatedHost) ToDedicatedHostOutput() DedicatedHostOutput {
return i.ToDedicatedHostOutputWithContext(context.Background())
}
func (i *DedicatedHost) ToDedicatedHostOutputWithContext(ctx context.Context) DedicatedHostOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostOutput)
}
// DedicatedHostArrayInput is an input type that accepts DedicatedHostArray and DedicatedHostArrayOutput values.
// You can construct a concrete instance of `DedicatedHostArrayInput` via:
//
// DedicatedHostArray{ DedicatedHostArgs{...} }
type DedicatedHostArrayInput interface {
pulumi.Input
ToDedicatedHostArrayOutput() DedicatedHostArrayOutput
ToDedicatedHostArrayOutputWithContext(context.Context) DedicatedHostArrayOutput
}
type DedicatedHostArray []DedicatedHostInput
func (DedicatedHostArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DedicatedHost)(nil)).Elem()
}
func (i DedicatedHostArray) ToDedicatedHostArrayOutput() DedicatedHostArrayOutput {
return i.ToDedicatedHostArrayOutputWithContext(context.Background())
}
func (i DedicatedHostArray) ToDedicatedHostArrayOutputWithContext(ctx context.Context) DedicatedHostArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostArrayOutput)
}
// DedicatedHostMapInput is an input type that accepts DedicatedHostMap and DedicatedHostMapOutput values.
// You can construct a concrete instance of `DedicatedHostMapInput` via:
//
// DedicatedHostMap{ "key": DedicatedHostArgs{...} }
type DedicatedHostMapInput interface {
pulumi.Input
ToDedicatedHostMapOutput() DedicatedHostMapOutput
ToDedicatedHostMapOutputWithContext(context.Context) DedicatedHostMapOutput
}
type DedicatedHostMap map[string]DedicatedHostInput
func (DedicatedHostMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DedicatedHost)(nil)).Elem()
}
func (i DedicatedHostMap) ToDedicatedHostMapOutput() DedicatedHostMapOutput {
return i.ToDedicatedHostMapOutputWithContext(context.Background())
}
func (i DedicatedHostMap) ToDedicatedHostMapOutputWithContext(ctx context.Context) DedicatedHostMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DedicatedHostMapOutput)
}
type DedicatedHostOutput struct{ *pulumi.OutputState }
func (DedicatedHostOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DedicatedHost)(nil)).Elem()
}
func (o DedicatedHostOutput) ToDedicatedHostOutput() DedicatedHostOutput {
return o
}
func (o DedicatedHostOutput) ToDedicatedHostOutputWithContext(ctx context.Context) DedicatedHostOutput {
return o
}
// Specifies whether instances can be created on the host. Valid values: `Allocatable` or `Suspended`. `Allocatable`: Instances can be created on the host. `Suspended`: Instances cannot be created on the host.
func (o DedicatedHostOutput) AllocationStatus() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.AllocationStatus }).(pulumi.StringOutput)
}
// Specifies whether to enable the auto-renewal feature.
func (o DedicatedHostOutput) AutoRenew() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.BoolPtrOutput { return v.AutoRenew }).(pulumi.BoolPtrOutput)
}
// The ID of the dedicated cluster.
func (o DedicatedHostOutput) DedicatedHostGroupId() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.DedicatedHostGroupId }).(pulumi.StringOutput)
}
// The ID of the host.
func (o DedicatedHostOutput) DedicatedHostId() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.DedicatedHostId }).(pulumi.StringOutput)
}
// The instance type of the host. For more information about the supported instance types of hosts, see [Host specification details](https://www.alibabacloud.com/help/doc-detail/206343.htm).
func (o DedicatedHostOutput) HostClass() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.HostClass }).(pulumi.StringOutput)
}
// The name of the host. The name must be `1` to `64` characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.
func (o DedicatedHostOutput) HostName() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.HostName }).(pulumi.StringOutput)
}
// Host Image Category. Valid values: `WindowsWithMssqlEntAlwaysonLicense`, `WindowsWithMssqlStdLicense`, `WindowsWithMssqlEntLicense`, `WindowsWithMssqlWebLicense`, `AliLinux`.
func (o DedicatedHostOutput) ImageCategory() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringPtrOutput { return v.ImageCategory }).(pulumi.StringPtrOutput)
}
// Host password. **NOTE:** The creation of a host password is supported only when the database type is `Tair-PMem`.
func (o DedicatedHostOutput) OsPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringPtrOutput { return v.OsPassword }).(pulumi.StringPtrOutput)
}
// The payment type of the resource. Valid values: `Subscription`.
func (o DedicatedHostOutput) PaymentType() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.PaymentType }).(pulumi.StringOutput)
}
// The unit of the subscription duration. Valid values: `Year`, `Month`, `Week`.
func (o DedicatedHostOutput) Period() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringPtrOutput { return v.Period }).(pulumi.StringPtrOutput)
}
// The state of the host. Valid values: `0:` The host is being created. `1`: The host is running. `2`: The host is faulty. `3`: The host is ready for deactivation. `4`: The host is being maintained. `5`: The host is deactivated. `6`: The host is restarting. `7`: The host is locked.
func (o DedicatedHostOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// A mapping of tags to assign to the resource.
func (o DedicatedHostOutput) Tags() pulumi.MapOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.MapOutput { return v.Tags }).(pulumi.MapOutput)
}
// The subscription duration of the host. Valid values:
// * If the Period parameter is set to `Year`, the value of the UsedTime parameter ranges from `1` to `5`.
// * If the Period parameter is set to `Month`, the value of the UsedTime parameter ranges from `1` to `9`.
// * If the Period parameter is set to `Week`, the value of the UsedTime parameter ranges from `1`, `2` and `3`.
func (o DedicatedHostOutput) UsedTime() pulumi.IntPtrOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.IntPtrOutput { return v.UsedTime }).(pulumi.IntPtrOutput)
}
// The ID of the vSwitch to which the host is connected.
func (o DedicatedHostOutput) VswitchId() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.VswitchId }).(pulumi.StringOutput)
}
// The ID of the zone.
func (o DedicatedHostOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *DedicatedHost) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
}
type DedicatedHostArrayOutput struct{ *pulumi.OutputState }
func (DedicatedHostArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DedicatedHost)(nil)).Elem()
}
func (o DedicatedHostArrayOutput) ToDedicatedHostArrayOutput() DedicatedHostArrayOutput {
return o
}
func (o DedicatedHostArrayOutput) ToDedicatedHostArrayOutputWithContext(ctx context.Context) DedicatedHostArrayOutput {
return o
}
func (o DedicatedHostArrayOutput) Index(i pulumi.IntInput) DedicatedHostOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DedicatedHost {
return vs[0].([]*DedicatedHost)[vs[1].(int)]
}).(DedicatedHostOutput)
}
type DedicatedHostMapOutput struct{ *pulumi.OutputState }
func (DedicatedHostMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DedicatedHost)(nil)).Elem()
}
func (o DedicatedHostMapOutput) ToDedicatedHostMapOutput() DedicatedHostMapOutput {
return o
}
func (o DedicatedHostMapOutput) ToDedicatedHostMapOutputWithContext(ctx context.Context) DedicatedHostMapOutput {
return o
}
func (o DedicatedHostMapOutput) MapIndex(k pulumi.StringInput) DedicatedHostOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DedicatedHost {
return vs[0].(map[string]*DedicatedHost)[vs[1].(string)]
}).(DedicatedHostOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostInput)(nil)).Elem(), &DedicatedHost{})
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostArrayInput)(nil)).Elem(), DedicatedHostArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DedicatedHostMapInput)(nil)).Elem(), DedicatedHostMap{})
pulumi.RegisterOutputType(DedicatedHostOutput{})
pulumi.RegisterOutputType(DedicatedHostArrayOutput{})
pulumi.RegisterOutputType(DedicatedHostMapOutput{})
}