/
regionCommitment.go
692 lines (629 loc) · 30.1 KB
/
regionCommitment.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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
// 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 compute
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents a regional Commitment resource.
//
// Creating a commitment resource means that you are purchasing a committed
// use contract with an explicit start and end time. You can create commitments
// based on vCPUs and memory usage and receive discounted rates.
//
// To get more information about RegionCommitment, see:
//
// * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionCommitments)
// * How-to Guides
// - [Committed use discounts for Compute Engine](https://cloud.google.com/compute/docs/instances/committed-use-discounts-overview)
//
// ## Example Usage
//
// ### Compute Region Commitment Basic
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.NewRegionCommitment(ctx, "foobar", &compute.RegionCommitmentArgs{
// Name: pulumi.String("my-region-commitment"),
// Plan: pulumi.String("THIRTY_SIX_MONTH"),
// Resources: compute.RegionCommitmentResourceArray{
// &compute.RegionCommitmentResourceArgs{
// Type: pulumi.String("VCPU"),
// Amount: pulumi.String("4"),
// },
// &compute.RegionCommitmentResourceArgs{
// Type: pulumi.String("MEMORY"),
// Amount: pulumi.String("9"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Compute Region Commitment Full
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := compute.NewRegionCommitment(ctx, "foobar", &compute.RegionCommitmentArgs{
// Name: pulumi.String("my-full-commitment"),
// Description: pulumi.String("some description"),
// Plan: pulumi.String("THIRTY_SIX_MONTH"),
// Type: pulumi.String("MEMORY_OPTIMIZED"),
// Category: pulumi.String("MACHINE"),
// AutoRenew: pulumi.Bool(true),
// Resources: compute.RegionCommitmentResourceArray{
// &compute.RegionCommitmentResourceArgs{
// Type: pulumi.String("VCPU"),
// Amount: pulumi.String("4"),
// },
// &compute.RegionCommitmentResourceArgs{
// Type: pulumi.String("MEMORY"),
// Amount: pulumi.String("9"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// RegionCommitment can be imported using any of these accepted formats:
//
// * `projects/{{project}}/regions/{{region}}/commitments/{{name}}`
//
// * `{{project}}/{{region}}/{{name}}`
//
// * `{{region}}/{{name}}`
//
// * `{{name}}`
//
// When using the `pulumi import` command, RegionCommitment can be imported using one of the formats above. For example:
//
// ```sh
// $ pulumi import gcp:compute/regionCommitment:RegionCommitment default projects/{{project}}/regions/{{region}}/commitments/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{project}}/{{region}}/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{region}}/{{name}}
// ```
//
// ```sh
// $ pulumi import gcp:compute/regionCommitment:RegionCommitment default {{name}}
// ```
type RegionCommitment struct {
pulumi.CustomResourceState
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
AutoRenew pulumi.BoolOutput `pulumi:"autoRenew"`
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
Category pulumi.StringOutput `pulumi:"category"`
// Unique identifier for the resource.
CommitmentId pulumi.IntOutput `pulumi:"commitmentId"`
// Creation timestamp in RFC3339 text format.
CreationTimestamp pulumi.StringOutput `pulumi:"creationTimestamp"`
// An optional description of this resource.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Commitment end time in RFC3339 text format.
EndTimestamp pulumi.StringOutput `pulumi:"endTimestamp"`
// The license specification required as part of a license commitment.
// Structure is documented below.
LicenseResource RegionCommitmentLicenseResourcePtrOutput `pulumi:"licenseResource"`
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
Name pulumi.StringOutput `pulumi:"name"`
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
Plan pulumi.StringOutput `pulumi:"plan"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringOutput `pulumi:"project"`
// URL of the region where this commitment may be used.
Region pulumi.StringOutput `pulumi:"region"`
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
Resources RegionCommitmentResourceArrayOutput `pulumi:"resources"`
// The URI of the created resource.
SelfLink pulumi.StringOutput `pulumi:"selfLink"`
// Commitment start time in RFC3339 text format.
StartTimestamp pulumi.StringOutput `pulumi:"startTimestamp"`
// Status of the commitment with regards to eventual expiration
// (each commitment has an end date defined).
Status pulumi.StringOutput `pulumi:"status"`
// A human-readable explanation of the status.
StatusMessage pulumi.StringOutput `pulumi:"statusMessage"`
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
Type pulumi.StringOutput `pulumi:"type"`
}
// NewRegionCommitment registers a new resource with the given unique name, arguments, and options.
func NewRegionCommitment(ctx *pulumi.Context,
name string, args *RegionCommitmentArgs, opts ...pulumi.ResourceOption) (*RegionCommitment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Plan == nil {
return nil, errors.New("invalid value for required argument 'Plan'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource RegionCommitment
err := ctx.RegisterResource("gcp:compute/regionCommitment:RegionCommitment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRegionCommitment gets an existing RegionCommitment 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 GetRegionCommitment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RegionCommitmentState, opts ...pulumi.ResourceOption) (*RegionCommitment, error) {
var resource RegionCommitment
err := ctx.ReadResource("gcp:compute/regionCommitment:RegionCommitment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RegionCommitment resources.
type regionCommitmentState struct {
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
AutoRenew *bool `pulumi:"autoRenew"`
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
Category *string `pulumi:"category"`
// Unique identifier for the resource.
CommitmentId *int `pulumi:"commitmentId"`
// Creation timestamp in RFC3339 text format.
CreationTimestamp *string `pulumi:"creationTimestamp"`
// An optional description of this resource.
Description *string `pulumi:"description"`
// Commitment end time in RFC3339 text format.
EndTimestamp *string `pulumi:"endTimestamp"`
// The license specification required as part of a license commitment.
// Structure is documented below.
LicenseResource *RegionCommitmentLicenseResource `pulumi:"licenseResource"`
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
Name *string `pulumi:"name"`
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
Plan *string `pulumi:"plan"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// URL of the region where this commitment may be used.
Region *string `pulumi:"region"`
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
Resources []RegionCommitmentResource `pulumi:"resources"`
// The URI of the created resource.
SelfLink *string `pulumi:"selfLink"`
// Commitment start time in RFC3339 text format.
StartTimestamp *string `pulumi:"startTimestamp"`
// Status of the commitment with regards to eventual expiration
// (each commitment has an end date defined).
Status *string `pulumi:"status"`
// A human-readable explanation of the status.
StatusMessage *string `pulumi:"statusMessage"`
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
Type *string `pulumi:"type"`
}
type RegionCommitmentState struct {
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
AutoRenew pulumi.BoolPtrInput
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
Category pulumi.StringPtrInput
// Unique identifier for the resource.
CommitmentId pulumi.IntPtrInput
// Creation timestamp in RFC3339 text format.
CreationTimestamp pulumi.StringPtrInput
// An optional description of this resource.
Description pulumi.StringPtrInput
// Commitment end time in RFC3339 text format.
EndTimestamp pulumi.StringPtrInput
// The license specification required as part of a license commitment.
// Structure is documented below.
LicenseResource RegionCommitmentLicenseResourcePtrInput
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
Name pulumi.StringPtrInput
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
Plan pulumi.StringPtrInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// URL of the region where this commitment may be used.
Region pulumi.StringPtrInput
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
Resources RegionCommitmentResourceArrayInput
// The URI of the created resource.
SelfLink pulumi.StringPtrInput
// Commitment start time in RFC3339 text format.
StartTimestamp pulumi.StringPtrInput
// Status of the commitment with regards to eventual expiration
// (each commitment has an end date defined).
Status pulumi.StringPtrInput
// A human-readable explanation of the status.
StatusMessage pulumi.StringPtrInput
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
Type pulumi.StringPtrInput
}
func (RegionCommitmentState) ElementType() reflect.Type {
return reflect.TypeOf((*regionCommitmentState)(nil)).Elem()
}
type regionCommitmentArgs struct {
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
AutoRenew *bool `pulumi:"autoRenew"`
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
Category *string `pulumi:"category"`
// An optional description of this resource.
Description *string `pulumi:"description"`
// The license specification required as part of a license commitment.
// Structure is documented below.
LicenseResource *RegionCommitmentLicenseResource `pulumi:"licenseResource"`
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
Name *string `pulumi:"name"`
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
Plan string `pulumi:"plan"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// URL of the region where this commitment may be used.
Region *string `pulumi:"region"`
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
Resources []RegionCommitmentResource `pulumi:"resources"`
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a RegionCommitment resource.
type RegionCommitmentArgs struct {
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
AutoRenew pulumi.BoolPtrInput
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
Category pulumi.StringPtrInput
// An optional description of this resource.
Description pulumi.StringPtrInput
// The license specification required as part of a license commitment.
// Structure is documented below.
LicenseResource RegionCommitmentLicenseResourcePtrInput
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
Name pulumi.StringPtrInput
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
Plan pulumi.StringInput
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project pulumi.StringPtrInput
// URL of the region where this commitment may be used.
Region pulumi.StringPtrInput
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
Resources RegionCommitmentResourceArrayInput
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
Type pulumi.StringPtrInput
}
func (RegionCommitmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*regionCommitmentArgs)(nil)).Elem()
}
type RegionCommitmentInput interface {
pulumi.Input
ToRegionCommitmentOutput() RegionCommitmentOutput
ToRegionCommitmentOutputWithContext(ctx context.Context) RegionCommitmentOutput
}
func (*RegionCommitment) ElementType() reflect.Type {
return reflect.TypeOf((**RegionCommitment)(nil)).Elem()
}
func (i *RegionCommitment) ToRegionCommitmentOutput() RegionCommitmentOutput {
return i.ToRegionCommitmentOutputWithContext(context.Background())
}
func (i *RegionCommitment) ToRegionCommitmentOutputWithContext(ctx context.Context) RegionCommitmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionCommitmentOutput)
}
// RegionCommitmentArrayInput is an input type that accepts RegionCommitmentArray and RegionCommitmentArrayOutput values.
// You can construct a concrete instance of `RegionCommitmentArrayInput` via:
//
// RegionCommitmentArray{ RegionCommitmentArgs{...} }
type RegionCommitmentArrayInput interface {
pulumi.Input
ToRegionCommitmentArrayOutput() RegionCommitmentArrayOutput
ToRegionCommitmentArrayOutputWithContext(context.Context) RegionCommitmentArrayOutput
}
type RegionCommitmentArray []RegionCommitmentInput
func (RegionCommitmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RegionCommitment)(nil)).Elem()
}
func (i RegionCommitmentArray) ToRegionCommitmentArrayOutput() RegionCommitmentArrayOutput {
return i.ToRegionCommitmentArrayOutputWithContext(context.Background())
}
func (i RegionCommitmentArray) ToRegionCommitmentArrayOutputWithContext(ctx context.Context) RegionCommitmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionCommitmentArrayOutput)
}
// RegionCommitmentMapInput is an input type that accepts RegionCommitmentMap and RegionCommitmentMapOutput values.
// You can construct a concrete instance of `RegionCommitmentMapInput` via:
//
// RegionCommitmentMap{ "key": RegionCommitmentArgs{...} }
type RegionCommitmentMapInput interface {
pulumi.Input
ToRegionCommitmentMapOutput() RegionCommitmentMapOutput
ToRegionCommitmentMapOutputWithContext(context.Context) RegionCommitmentMapOutput
}
type RegionCommitmentMap map[string]RegionCommitmentInput
func (RegionCommitmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RegionCommitment)(nil)).Elem()
}
func (i RegionCommitmentMap) ToRegionCommitmentMapOutput() RegionCommitmentMapOutput {
return i.ToRegionCommitmentMapOutputWithContext(context.Background())
}
func (i RegionCommitmentMap) ToRegionCommitmentMapOutputWithContext(ctx context.Context) RegionCommitmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegionCommitmentMapOutput)
}
type RegionCommitmentOutput struct{ *pulumi.OutputState }
func (RegionCommitmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RegionCommitment)(nil)).Elem()
}
func (o RegionCommitmentOutput) ToRegionCommitmentOutput() RegionCommitmentOutput {
return o
}
func (o RegionCommitmentOutput) ToRegionCommitmentOutputWithContext(ctx context.Context) RegionCommitmentOutput {
return o
}
// Specifies whether to enable automatic renewal for the commitment.
// The default value is false if not specified.
// If the field is set to true, the commitment will be automatically renewed for either
// one or three years according to the terms of the existing commitment.
func (o RegionCommitmentOutput) AutoRenew() pulumi.BoolOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.BoolOutput { return v.AutoRenew }).(pulumi.BoolOutput)
}
// The category of the commitment. Category MACHINE specifies commitments composed of
// machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE
// specifies commitments composed of software licenses, listed in licenseResources.
// Note that only MACHINE commitments should have a Type specified.
// Possible values are: `LICENSE`, `MACHINE`.
func (o RegionCommitmentOutput) Category() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Category }).(pulumi.StringOutput)
}
// Unique identifier for the resource.
func (o RegionCommitmentOutput) CommitmentId() pulumi.IntOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.IntOutput { return v.CommitmentId }).(pulumi.IntOutput)
}
// Creation timestamp in RFC3339 text format.
func (o RegionCommitmentOutput) CreationTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.CreationTimestamp }).(pulumi.StringOutput)
}
// An optional description of this resource.
func (o RegionCommitmentOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Commitment end time in RFC3339 text format.
func (o RegionCommitmentOutput) EndTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.EndTimestamp }).(pulumi.StringOutput)
}
// The license specification required as part of a license commitment.
// Structure is documented below.
func (o RegionCommitmentOutput) LicenseResource() RegionCommitmentLicenseResourcePtrOutput {
return o.ApplyT(func(v *RegionCommitment) RegionCommitmentLicenseResourcePtrOutput { return v.LicenseResource }).(RegionCommitmentLicenseResourcePtrOutput)
}
// Name of the resource. The name must be 1-63 characters long and match
// the regular expression `a-z?` which means the
// first character must be a lowercase letter, and all following
// characters must be a dash, lowercase letter, or digit, except the last
// character, which cannot be a dash.
func (o RegionCommitmentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The plan for this commitment, which determines duration and discount rate.
// The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years).
// Possible values are: `TWELVE_MONTH`, `THIRTY_SIX_MONTH`.
//
// ***
func (o RegionCommitmentOutput) Plan() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Plan }).(pulumi.StringOutput)
}
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
func (o RegionCommitmentOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// URL of the region where this commitment may be used.
func (o RegionCommitmentOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// A list of commitment amounts for particular resources.
// Note that VCPU and MEMORY resource commitments must occur together.
// Structure is documented below.
func (o RegionCommitmentOutput) Resources() RegionCommitmentResourceArrayOutput {
return o.ApplyT(func(v *RegionCommitment) RegionCommitmentResourceArrayOutput { return v.Resources }).(RegionCommitmentResourceArrayOutput)
}
// The URI of the created resource.
func (o RegionCommitmentOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.SelfLink }).(pulumi.StringOutput)
}
// Commitment start time in RFC3339 text format.
func (o RegionCommitmentOutput) StartTimestamp() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.StartTimestamp }).(pulumi.StringOutput)
}
// Status of the commitment with regards to eventual expiration
// (each commitment has an end date defined).
func (o RegionCommitmentOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// A human-readable explanation of the status.
func (o RegionCommitmentOutput) StatusMessage() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.StatusMessage }).(pulumi.StringOutput)
}
// The type of commitment, which affects the discount rate and the eligible resources.
// The type could be one of the following value: `MEMORY_OPTIMIZED`, `ACCELERATOR_OPTIMIZED`,
// `GENERAL_PURPOSE_N1`, `GENERAL_PURPOSE_N2`, `GENERAL_PURPOSE_N2D`, `GENERAL_PURPOSE_E2`,
// `GENERAL_PURPOSE_T2D`, `GENERAL_PURPOSE_C3`, `COMPUTE_OPTIMIZED_C2`, `COMPUTE_OPTIMIZED_C2D` and
// `GRAPHICS_OPTIMIZED_G2`
func (o RegionCommitmentOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *RegionCommitment) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type RegionCommitmentArrayOutput struct{ *pulumi.OutputState }
func (RegionCommitmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RegionCommitment)(nil)).Elem()
}
func (o RegionCommitmentArrayOutput) ToRegionCommitmentArrayOutput() RegionCommitmentArrayOutput {
return o
}
func (o RegionCommitmentArrayOutput) ToRegionCommitmentArrayOutputWithContext(ctx context.Context) RegionCommitmentArrayOutput {
return o
}
func (o RegionCommitmentArrayOutput) Index(i pulumi.IntInput) RegionCommitmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RegionCommitment {
return vs[0].([]*RegionCommitment)[vs[1].(int)]
}).(RegionCommitmentOutput)
}
type RegionCommitmentMapOutput struct{ *pulumi.OutputState }
func (RegionCommitmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RegionCommitment)(nil)).Elem()
}
func (o RegionCommitmentMapOutput) ToRegionCommitmentMapOutput() RegionCommitmentMapOutput {
return o
}
func (o RegionCommitmentMapOutput) ToRegionCommitmentMapOutputWithContext(ctx context.Context) RegionCommitmentMapOutput {
return o
}
func (o RegionCommitmentMapOutput) MapIndex(k pulumi.StringInput) RegionCommitmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RegionCommitment {
return vs[0].(map[string]*RegionCommitment)[vs[1].(string)]
}).(RegionCommitmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RegionCommitmentInput)(nil)).Elem(), &RegionCommitment{})
pulumi.RegisterInputType(reflect.TypeOf((*RegionCommitmentArrayInput)(nil)).Elem(), RegionCommitmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RegionCommitmentMapInput)(nil)).Elem(), RegionCommitmentMap{})
pulumi.RegisterOutputType(RegionCommitmentOutput{})
pulumi.RegisterOutputType(RegionCommitmentArrayOutput{})
pulumi.RegisterOutputType(RegionCommitmentMapOutput{})
}