/
instance.go
666 lines (596 loc) · 31.1 KB
/
instance.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
// 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 alloydb
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)
// A managed alloydb cluster instance.
//
// To get more information about Instance, see:
//
// * [API documentation](https://cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters.instances/create)
// * How-to Guides
// - [AlloyDB](https://cloud.google.com/alloydb/docs/)
//
// ## Example Usage
// ### Alloydb Instance Basic
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/alloydb"
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/organizations"
// "github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/servicenetworking"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// defaultNetwork, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
// Name: "alloydb-network",
// }, nil)
// if err != nil {
// return err
// }
// defaultCluster, err := alloydb.NewCluster(ctx, "defaultCluster", &alloydb.ClusterArgs{
// ClusterId: pulumi.String("alloydb-cluster"),
// Location: pulumi.String("us-central1"),
// Network: *pulumi.String(defaultNetwork.Id),
// InitialUser: &alloydb.ClusterInitialUserArgs{
// Password: pulumi.String("alloydb-cluster"),
// },
// })
// if err != nil {
// return err
// }
// privateIpAlloc, err := compute.NewGlobalAddress(ctx, "privateIpAlloc", &compute.GlobalAddressArgs{
// AddressType: pulumi.String("INTERNAL"),
// Purpose: pulumi.String("VPC_PEERING"),
// PrefixLength: pulumi.Int(16),
// Network: *pulumi.String(defaultNetwork.Id),
// })
// if err != nil {
// return err
// }
// vpcConnection, err := servicenetworking.NewConnection(ctx, "vpcConnection", &servicenetworking.ConnectionArgs{
// Network: *pulumi.String(defaultNetwork.Id),
// Service: pulumi.String("servicenetworking.googleapis.com"),
// ReservedPeeringRanges: pulumi.StringArray{
// privateIpAlloc.Name,
// },
// })
// if err != nil {
// return err
// }
// _, err = alloydb.NewInstance(ctx, "defaultInstance", &alloydb.InstanceArgs{
// Cluster: defaultCluster.Name,
// InstanceId: pulumi.String("alloydb-instance"),
// InstanceType: pulumi.String("PRIMARY"),
// MachineConfig: &alloydb.InstanceMachineConfigArgs{
// CpuCount: pulumi.Int(2),
// },
// }, pulumi.DependsOn([]pulumi.Resource{
// vpcConnection,
// }))
// if err != nil {
// return err
// }
// _, err = organizations.LookupProject(ctx, nil, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// # Instance can be imported using any of these accepted formats
//
// ```sh
//
// $ pulumi import gcp:alloydb/instance:Instance default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/instances/{{instance_id}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:alloydb/instance:Instance default {{project}}/{{location}}/{{cluster}}/{{instance_id}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:alloydb/instance:Instance default {{location}}/{{cluster}}/{{instance_id}}
//
// ```
type Instance struct {
pulumi.CustomResourceState
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
Annotations pulumi.StringMapOutput `pulumi:"annotations"`
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
AvailabilityType pulumi.StringOutput `pulumi:"availabilityType"`
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
Cluster pulumi.StringOutput `pulumi:"cluster"`
// Time the Instance was created in UTC.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
DatabaseFlags pulumi.StringMapOutput `pulumi:"databaseFlags"`
// User-settable and human-readable display name for the Instance.
DisplayName pulumi.StringPtrOutput `pulumi:"displayName"`
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
GceZone pulumi.StringPtrOutput `pulumi:"gceZone"`
// The ID of the alloydb instance.
//
// ***
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
InstanceType pulumi.StringOutput `pulumi:"instanceType"`
// The IP address for the Instance. This is the connection endpoint for an end-user application.
IpAddress pulumi.StringOutput `pulumi:"ipAddress"`
// User-defined labels for the alloydb instance.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
MachineConfig InstanceMachineConfigOutput `pulumi:"machineConfig"`
// The name of the instance resource.
Name pulumi.StringOutput `pulumi:"name"`
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
ReadPoolConfig InstanceReadPoolConfigPtrOutput `pulumi:"readPoolConfig"`
// Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
Reconciling pulumi.BoolOutput `pulumi:"reconciling"`
// The current state of the alloydb instance.
State pulumi.StringOutput `pulumi:"state"`
// The system-generated UID of the resource.
Uid pulumi.StringOutput `pulumi:"uid"`
// Time the Instance was updated in UTC.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewInstance registers a new resource with the given unique name, arguments, and options.
func NewInstance(ctx *pulumi.Context,
name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Cluster == nil {
return nil, errors.New("invalid value for required argument 'Cluster'")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.InstanceType == nil {
return nil, errors.New("invalid value for required argument 'InstanceType'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Instance
err := ctx.RegisterResource("gcp:alloydb/instance:Instance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetInstance gets an existing Instance 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 GetInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error) {
var resource Instance
err := ctx.ReadResource("gcp:alloydb/instance:Instance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Instance resources.
type instanceState struct {
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
Annotations map[string]string `pulumi:"annotations"`
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
AvailabilityType *string `pulumi:"availabilityType"`
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
Cluster *string `pulumi:"cluster"`
// Time the Instance was created in UTC.
CreateTime *string `pulumi:"createTime"`
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
DatabaseFlags map[string]string `pulumi:"databaseFlags"`
// User-settable and human-readable display name for the Instance.
DisplayName *string `pulumi:"displayName"`
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
GceZone *string `pulumi:"gceZone"`
// The ID of the alloydb instance.
//
// ***
InstanceId *string `pulumi:"instanceId"`
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
InstanceType *string `pulumi:"instanceType"`
// The IP address for the Instance. This is the connection endpoint for an end-user application.
IpAddress *string `pulumi:"ipAddress"`
// User-defined labels for the alloydb instance.
Labels map[string]string `pulumi:"labels"`
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
MachineConfig *InstanceMachineConfig `pulumi:"machineConfig"`
// The name of the instance resource.
Name *string `pulumi:"name"`
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
ReadPoolConfig *InstanceReadPoolConfig `pulumi:"readPoolConfig"`
// Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
Reconciling *bool `pulumi:"reconciling"`
// The current state of the alloydb instance.
State *string `pulumi:"state"`
// The system-generated UID of the resource.
Uid *string `pulumi:"uid"`
// Time the Instance was updated in UTC.
UpdateTime *string `pulumi:"updateTime"`
}
type InstanceState struct {
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
Annotations pulumi.StringMapInput
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
AvailabilityType pulumi.StringPtrInput
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
Cluster pulumi.StringPtrInput
// Time the Instance was created in UTC.
CreateTime pulumi.StringPtrInput
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
DatabaseFlags pulumi.StringMapInput
// User-settable and human-readable display name for the Instance.
DisplayName pulumi.StringPtrInput
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
GceZone pulumi.StringPtrInput
// The ID of the alloydb instance.
//
// ***
InstanceId pulumi.StringPtrInput
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
InstanceType pulumi.StringPtrInput
// The IP address for the Instance. This is the connection endpoint for an end-user application.
IpAddress pulumi.StringPtrInput
// User-defined labels for the alloydb instance.
Labels pulumi.StringMapInput
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
MachineConfig InstanceMachineConfigPtrInput
// The name of the instance resource.
Name pulumi.StringPtrInput
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
ReadPoolConfig InstanceReadPoolConfigPtrInput
// Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
Reconciling pulumi.BoolPtrInput
// The current state of the alloydb instance.
State pulumi.StringPtrInput
// The system-generated UID of the resource.
Uid pulumi.StringPtrInput
// Time the Instance was updated in UTC.
UpdateTime pulumi.StringPtrInput
}
func (InstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*instanceState)(nil)).Elem()
}
type instanceArgs struct {
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
Annotations map[string]string `pulumi:"annotations"`
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
AvailabilityType *string `pulumi:"availabilityType"`
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
Cluster string `pulumi:"cluster"`
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
DatabaseFlags map[string]string `pulumi:"databaseFlags"`
// User-settable and human-readable display name for the Instance.
DisplayName *string `pulumi:"displayName"`
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
GceZone *string `pulumi:"gceZone"`
// The ID of the alloydb instance.
//
// ***
InstanceId string `pulumi:"instanceId"`
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
InstanceType string `pulumi:"instanceType"`
// User-defined labels for the alloydb instance.
Labels map[string]string `pulumi:"labels"`
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
MachineConfig *InstanceMachineConfig `pulumi:"machineConfig"`
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
ReadPoolConfig *InstanceReadPoolConfig `pulumi:"readPoolConfig"`
}
// The set of arguments for constructing a Instance resource.
type InstanceArgs struct {
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
Annotations pulumi.StringMapInput
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
AvailabilityType pulumi.StringPtrInput
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
Cluster pulumi.StringInput
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
DatabaseFlags pulumi.StringMapInput
// User-settable and human-readable display name for the Instance.
DisplayName pulumi.StringPtrInput
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
GceZone pulumi.StringPtrInput
// The ID of the alloydb instance.
//
// ***
InstanceId pulumi.StringInput
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
InstanceType pulumi.StringInput
// User-defined labels for the alloydb instance.
Labels pulumi.StringMapInput
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
MachineConfig InstanceMachineConfigPtrInput
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
ReadPoolConfig InstanceReadPoolConfigPtrInput
}
func (InstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*instanceArgs)(nil)).Elem()
}
type InstanceInput interface {
pulumi.Input
ToInstanceOutput() InstanceOutput
ToInstanceOutputWithContext(ctx context.Context) InstanceOutput
}
func (*Instance) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil)).Elem()
}
func (i *Instance) ToInstanceOutput() InstanceOutput {
return i.ToInstanceOutputWithContext(context.Background())
}
func (i *Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceOutput)
}
func (i *Instance) ToOutput(ctx context.Context) pulumix.Output[*Instance] {
return pulumix.Output[*Instance]{
OutputState: i.ToInstanceOutputWithContext(ctx).OutputState,
}
}
// InstanceArrayInput is an input type that accepts InstanceArray and InstanceArrayOutput values.
// You can construct a concrete instance of `InstanceArrayInput` via:
//
// InstanceArray{ InstanceArgs{...} }
type InstanceArrayInput interface {
pulumi.Input
ToInstanceArrayOutput() InstanceArrayOutput
ToInstanceArrayOutputWithContext(context.Context) InstanceArrayOutput
}
type InstanceArray []InstanceInput
func (InstanceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Instance)(nil)).Elem()
}
func (i InstanceArray) ToInstanceArrayOutput() InstanceArrayOutput {
return i.ToInstanceArrayOutputWithContext(context.Background())
}
func (i InstanceArray) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceArrayOutput)
}
func (i InstanceArray) ToOutput(ctx context.Context) pulumix.Output[[]*Instance] {
return pulumix.Output[[]*Instance]{
OutputState: i.ToInstanceArrayOutputWithContext(ctx).OutputState,
}
}
// InstanceMapInput is an input type that accepts InstanceMap and InstanceMapOutput values.
// You can construct a concrete instance of `InstanceMapInput` via:
//
// InstanceMap{ "key": InstanceArgs{...} }
type InstanceMapInput interface {
pulumi.Input
ToInstanceMapOutput() InstanceMapOutput
ToInstanceMapOutputWithContext(context.Context) InstanceMapOutput
}
type InstanceMap map[string]InstanceInput
func (InstanceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
}
func (i InstanceMap) ToInstanceMapOutput() InstanceMapOutput {
return i.ToInstanceMapOutputWithContext(context.Background())
}
func (i InstanceMap) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(InstanceMapOutput)
}
func (i InstanceMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*Instance] {
return pulumix.Output[map[string]*Instance]{
OutputState: i.ToInstanceMapOutputWithContext(ctx).OutputState,
}
}
type InstanceOutput struct{ *pulumi.OutputState }
func (InstanceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Instance)(nil)).Elem()
}
func (o InstanceOutput) ToInstanceOutput() InstanceOutput {
return o
}
func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput {
return o
}
func (o InstanceOutput) ToOutput(ctx context.Context) pulumix.Output[*Instance] {
return pulumix.Output[*Instance]{
OutputState: o.OutputState,
}
}
// Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.
func (o InstanceOutput) Annotations() pulumi.StringMapOutput {
return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.Annotations }).(pulumi.StringMapOutput)
}
// 'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances.
// Note that primary and read instances can have different availability types.
// Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance.
// Zone is automatically chosen from the list of zones in the region specified.
// Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more
// can have regional availability (nodes are present in 2 or more zones in a region).'
// Possible values are: `AVAILABILITY_TYPE_UNSPECIFIED`, `ZONAL`, `REGIONAL`.
func (o InstanceOutput) AvailabilityType() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.AvailabilityType }).(pulumi.StringOutput)
}
// Identifies the alloydb cluster. Must be in the format
// 'projects/{project}/locations/{location}/clusters/{cluster_id}'
func (o InstanceOutput) Cluster() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Cluster }).(pulumi.StringOutput)
}
// Time the Instance was created in UTC.
func (o InstanceOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.
func (o InstanceOutput) DatabaseFlags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.DatabaseFlags }).(pulumi.StringMapOutput)
}
// User-settable and human-readable display name for the Instance.
func (o InstanceOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.DisplayName }).(pulumi.StringPtrOutput)
}
// The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.
func (o InstanceOutput) GceZone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Instance) pulumi.StringPtrOutput { return v.GceZone }).(pulumi.StringPtrOutput)
}
// The ID of the alloydb instance.
//
// ***
func (o InstanceOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the `dependsOn` meta-data attribute.
// Possible values are: `PRIMARY`, `READ_POOL`.
func (o InstanceOutput) InstanceType() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput)
}
// The IP address for the Instance. This is the connection endpoint for an end-user application.
func (o InstanceOutput) IpAddress() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.IpAddress }).(pulumi.StringOutput)
}
// User-defined labels for the alloydb instance.
func (o InstanceOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// Configurations for the machines that host the underlying database engine.
// Structure is documented below.
func (o InstanceOutput) MachineConfig() InstanceMachineConfigOutput {
return o.ApplyT(func(v *Instance) InstanceMachineConfigOutput { return v.MachineConfig }).(InstanceMachineConfigOutput)
}
// The name of the instance resource.
func (o InstanceOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.
// Structure is documented below.
func (o InstanceOutput) ReadPoolConfig() InstanceReadPoolConfigPtrOutput {
return o.ApplyT(func(v *Instance) InstanceReadPoolConfigPtrOutput { return v.ReadPoolConfig }).(InstanceReadPoolConfigPtrOutput)
}
// Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.
func (o InstanceOutput) Reconciling() pulumi.BoolOutput {
return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.Reconciling }).(pulumi.BoolOutput)
}
// The current state of the alloydb instance.
func (o InstanceOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// The system-generated UID of the resource.
func (o InstanceOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Uid }).(pulumi.StringOutput)
}
// Time the Instance was updated in UTC.
func (o InstanceOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
type InstanceArrayOutput struct{ *pulumi.OutputState }
func (InstanceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Instance)(nil)).Elem()
}
func (o InstanceArrayOutput) ToInstanceArrayOutput() InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput {
return o
}
func (o InstanceArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*Instance] {
return pulumix.Output[[]*Instance]{
OutputState: o.OutputState,
}
}
func (o InstanceArrayOutput) Index(i pulumi.IntInput) InstanceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Instance {
return vs[0].([]*Instance)[vs[1].(int)]
}).(InstanceOutput)
}
type InstanceMapOutput struct{ *pulumi.OutputState }
func (InstanceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Instance)(nil)).Elem()
}
func (o InstanceMapOutput) ToInstanceMapOutput() InstanceMapOutput {
return o
}
func (o InstanceMapOutput) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput {
return o
}
func (o InstanceMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*Instance] {
return pulumix.Output[map[string]*Instance]{
OutputState: o.OutputState,
}
}
func (o InstanceMapOutput) MapIndex(k pulumi.StringInput) InstanceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Instance {
return vs[0].(map[string]*Instance)[vs[1].(string)]
}).(InstanceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*InstanceInput)(nil)).Elem(), &Instance{})
pulumi.RegisterInputType(reflect.TypeOf((*InstanceArrayInput)(nil)).Elem(), InstanceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*InstanceMapInput)(nil)).Elem(), InstanceMap{})
pulumi.RegisterOutputType(InstanceOutput{})
pulumi.RegisterOutputType(InstanceArrayOutput{})
pulumi.RegisterOutputType(InstanceMapOutput{})
}