/
gameServerCluster.go
429 lines (369 loc) · 16.7 KB
/
gameServerCluster.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
// 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 gameservices
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 game server cluster resource.
//
// To get more information about GameServerCluster, see:
//
// * [API documentation](https://cloud.google.com/game-servers/docs/reference/rest/v1beta/projects.locations.realms.gameServerClusters)
// * How-to Guides
// - [Official Documentation](https://cloud.google.com/game-servers/docs)
//
// ## Example Usage
//
// ## Import
//
// # GameServerCluster can be imported using any of these accepted formats
//
// ```sh
//
// $ pulumi import gcp:gameservices/gameServerCluster:GameServerCluster default projects/{{project}}/locations/{{location}}/realms/{{realm_id}}/gameServerClusters/{{cluster_id}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:gameservices/gameServerCluster:GameServerCluster default {{project}}/{{location}}/{{realm_id}}/{{cluster_id}}
//
// ```
//
// ```sh
//
// $ pulumi import gcp:gameservices/gameServerCluster:GameServerCluster default {{location}}/{{realm_id}}/{{cluster_id}}
//
// ```
type GameServerCluster struct {
pulumi.CustomResourceState
// Required. The resource name of the game server cluster
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
ConnectionInfo GameServerClusterConnectionInfoOutput `pulumi:"connectionInfo"`
// Human readable description of the cluster.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The labels associated with this game server cluster. Each label is a
// key-value pair.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// Location of the Cluster.
Location pulumi.StringPtrOutput `pulumi:"location"`
// The resource id of the game server cluster, eg:
// `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
// For example,
// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
Name pulumi.StringOutput `pulumi:"name"`
// 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"`
// The realm id of the game server realm.
RealmId pulumi.StringOutput `pulumi:"realmId"`
}
// NewGameServerCluster registers a new resource with the given unique name, arguments, and options.
func NewGameServerCluster(ctx *pulumi.Context,
name string, args *GameServerClusterArgs, opts ...pulumi.ResourceOption) (*GameServerCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterId == nil {
return nil, errors.New("invalid value for required argument 'ClusterId'")
}
if args.ConnectionInfo == nil {
return nil, errors.New("invalid value for required argument 'ConnectionInfo'")
}
if args.RealmId == nil {
return nil, errors.New("invalid value for required argument 'RealmId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GameServerCluster
err := ctx.RegisterResource("gcp:gameservices/gameServerCluster:GameServerCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGameServerCluster gets an existing GameServerCluster 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 GetGameServerCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GameServerClusterState, opts ...pulumi.ResourceOption) (*GameServerCluster, error) {
var resource GameServerCluster
err := ctx.ReadResource("gcp:gameservices/gameServerCluster:GameServerCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GameServerCluster resources.
type gameServerClusterState struct {
// Required. The resource name of the game server cluster
ClusterId *string `pulumi:"clusterId"`
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
ConnectionInfo *GameServerClusterConnectionInfo `pulumi:"connectionInfo"`
// Human readable description of the cluster.
Description *string `pulumi:"description"`
// The labels associated with this game server cluster. Each label is a
// key-value pair.
Labels map[string]string `pulumi:"labels"`
// Location of the Cluster.
Location *string `pulumi:"location"`
// The resource id of the game server cluster, eg:
// `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
// For example,
// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The realm id of the game server realm.
RealmId *string `pulumi:"realmId"`
}
type GameServerClusterState struct {
// Required. The resource name of the game server cluster
ClusterId pulumi.StringPtrInput
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
ConnectionInfo GameServerClusterConnectionInfoPtrInput
// Human readable description of the cluster.
Description pulumi.StringPtrInput
// The labels associated with this game server cluster. Each label is a
// key-value pair.
Labels pulumi.StringMapInput
// Location of the Cluster.
Location pulumi.StringPtrInput
// The resource id of the game server cluster, eg:
// `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
// For example,
// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
Name 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
// The realm id of the game server realm.
RealmId pulumi.StringPtrInput
}
func (GameServerClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*gameServerClusterState)(nil)).Elem()
}
type gameServerClusterArgs struct {
// Required. The resource name of the game server cluster
ClusterId string `pulumi:"clusterId"`
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
ConnectionInfo GameServerClusterConnectionInfo `pulumi:"connectionInfo"`
// Human readable description of the cluster.
Description *string `pulumi:"description"`
// The labels associated with this game server cluster. Each label is a
// key-value pair.
Labels map[string]string `pulumi:"labels"`
// Location of the Cluster.
Location *string `pulumi:"location"`
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
Project *string `pulumi:"project"`
// The realm id of the game server realm.
RealmId string `pulumi:"realmId"`
}
// The set of arguments for constructing a GameServerCluster resource.
type GameServerClusterArgs struct {
// Required. The resource name of the game server cluster
ClusterId pulumi.StringInput
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
ConnectionInfo GameServerClusterConnectionInfoInput
// Human readable description of the cluster.
Description pulumi.StringPtrInput
// The labels associated with this game server cluster. Each label is a
// key-value pair.
Labels pulumi.StringMapInput
// Location of the Cluster.
Location 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
// The realm id of the game server realm.
RealmId pulumi.StringInput
}
func (GameServerClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*gameServerClusterArgs)(nil)).Elem()
}
type GameServerClusterInput interface {
pulumi.Input
ToGameServerClusterOutput() GameServerClusterOutput
ToGameServerClusterOutputWithContext(ctx context.Context) GameServerClusterOutput
}
func (*GameServerCluster) ElementType() reflect.Type {
return reflect.TypeOf((**GameServerCluster)(nil)).Elem()
}
func (i *GameServerCluster) ToGameServerClusterOutput() GameServerClusterOutput {
return i.ToGameServerClusterOutputWithContext(context.Background())
}
func (i *GameServerCluster) ToGameServerClusterOutputWithContext(ctx context.Context) GameServerClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(GameServerClusterOutput)
}
func (i *GameServerCluster) ToOutput(ctx context.Context) pulumix.Output[*GameServerCluster] {
return pulumix.Output[*GameServerCluster]{
OutputState: i.ToGameServerClusterOutputWithContext(ctx).OutputState,
}
}
// GameServerClusterArrayInput is an input type that accepts GameServerClusterArray and GameServerClusterArrayOutput values.
// You can construct a concrete instance of `GameServerClusterArrayInput` via:
//
// GameServerClusterArray{ GameServerClusterArgs{...} }
type GameServerClusterArrayInput interface {
pulumi.Input
ToGameServerClusterArrayOutput() GameServerClusterArrayOutput
ToGameServerClusterArrayOutputWithContext(context.Context) GameServerClusterArrayOutput
}
type GameServerClusterArray []GameServerClusterInput
func (GameServerClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GameServerCluster)(nil)).Elem()
}
func (i GameServerClusterArray) ToGameServerClusterArrayOutput() GameServerClusterArrayOutput {
return i.ToGameServerClusterArrayOutputWithContext(context.Background())
}
func (i GameServerClusterArray) ToGameServerClusterArrayOutputWithContext(ctx context.Context) GameServerClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GameServerClusterArrayOutput)
}
func (i GameServerClusterArray) ToOutput(ctx context.Context) pulumix.Output[[]*GameServerCluster] {
return pulumix.Output[[]*GameServerCluster]{
OutputState: i.ToGameServerClusterArrayOutputWithContext(ctx).OutputState,
}
}
// GameServerClusterMapInput is an input type that accepts GameServerClusterMap and GameServerClusterMapOutput values.
// You can construct a concrete instance of `GameServerClusterMapInput` via:
//
// GameServerClusterMap{ "key": GameServerClusterArgs{...} }
type GameServerClusterMapInput interface {
pulumi.Input
ToGameServerClusterMapOutput() GameServerClusterMapOutput
ToGameServerClusterMapOutputWithContext(context.Context) GameServerClusterMapOutput
}
type GameServerClusterMap map[string]GameServerClusterInput
func (GameServerClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GameServerCluster)(nil)).Elem()
}
func (i GameServerClusterMap) ToGameServerClusterMapOutput() GameServerClusterMapOutput {
return i.ToGameServerClusterMapOutputWithContext(context.Background())
}
func (i GameServerClusterMap) ToGameServerClusterMapOutputWithContext(ctx context.Context) GameServerClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GameServerClusterMapOutput)
}
func (i GameServerClusterMap) ToOutput(ctx context.Context) pulumix.Output[map[string]*GameServerCluster] {
return pulumix.Output[map[string]*GameServerCluster]{
OutputState: i.ToGameServerClusterMapOutputWithContext(ctx).OutputState,
}
}
type GameServerClusterOutput struct{ *pulumi.OutputState }
func (GameServerClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GameServerCluster)(nil)).Elem()
}
func (o GameServerClusterOutput) ToGameServerClusterOutput() GameServerClusterOutput {
return o
}
func (o GameServerClusterOutput) ToGameServerClusterOutputWithContext(ctx context.Context) GameServerClusterOutput {
return o
}
func (o GameServerClusterOutput) ToOutput(ctx context.Context) pulumix.Output[*GameServerCluster] {
return pulumix.Output[*GameServerCluster]{
OutputState: o.OutputState,
}
}
// Required. The resource name of the game server cluster
func (o GameServerClusterOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// Game server cluster connection information. This information is used to
// manage game server clusters.
// Structure is documented below.
func (o GameServerClusterOutput) ConnectionInfo() GameServerClusterConnectionInfoOutput {
return o.ApplyT(func(v *GameServerCluster) GameServerClusterConnectionInfoOutput { return v.ConnectionInfo }).(GameServerClusterConnectionInfoOutput)
}
// Human readable description of the cluster.
func (o GameServerClusterOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The labels associated with this game server cluster. Each label is a
// key-value pair.
func (o GameServerClusterOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// Location of the Cluster.
func (o GameServerClusterOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringPtrOutput { return v.Location }).(pulumi.StringPtrOutput)
}
// The resource id of the game server cluster, eg:
// `projects/{project_id}/locations/{location}/realms/{realm_id}/gameServerClusters/{cluster_id}`.
// For example,
// `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`.
func (o GameServerClusterOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the project in which the resource belongs.
// If it is not provided, the provider project is used.
func (o GameServerClusterOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The realm id of the game server realm.
func (o GameServerClusterOutput) RealmId() pulumi.StringOutput {
return o.ApplyT(func(v *GameServerCluster) pulumi.StringOutput { return v.RealmId }).(pulumi.StringOutput)
}
type GameServerClusterArrayOutput struct{ *pulumi.OutputState }
func (GameServerClusterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GameServerCluster)(nil)).Elem()
}
func (o GameServerClusterArrayOutput) ToGameServerClusterArrayOutput() GameServerClusterArrayOutput {
return o
}
func (o GameServerClusterArrayOutput) ToGameServerClusterArrayOutputWithContext(ctx context.Context) GameServerClusterArrayOutput {
return o
}
func (o GameServerClusterArrayOutput) ToOutput(ctx context.Context) pulumix.Output[[]*GameServerCluster] {
return pulumix.Output[[]*GameServerCluster]{
OutputState: o.OutputState,
}
}
func (o GameServerClusterArrayOutput) Index(i pulumi.IntInput) GameServerClusterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GameServerCluster {
return vs[0].([]*GameServerCluster)[vs[1].(int)]
}).(GameServerClusterOutput)
}
type GameServerClusterMapOutput struct{ *pulumi.OutputState }
func (GameServerClusterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GameServerCluster)(nil)).Elem()
}
func (o GameServerClusterMapOutput) ToGameServerClusterMapOutput() GameServerClusterMapOutput {
return o
}
func (o GameServerClusterMapOutput) ToGameServerClusterMapOutputWithContext(ctx context.Context) GameServerClusterMapOutput {
return o
}
func (o GameServerClusterMapOutput) ToOutput(ctx context.Context) pulumix.Output[map[string]*GameServerCluster] {
return pulumix.Output[map[string]*GameServerCluster]{
OutputState: o.OutputState,
}
}
func (o GameServerClusterMapOutput) MapIndex(k pulumi.StringInput) GameServerClusterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GameServerCluster {
return vs[0].(map[string]*GameServerCluster)[vs[1].(string)]
}).(GameServerClusterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GameServerClusterInput)(nil)).Elem(), &GameServerCluster{})
pulumi.RegisterInputType(reflect.TypeOf((*GameServerClusterArrayInput)(nil)).Elem(), GameServerClusterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GameServerClusterMapInput)(nil)).Elem(), GameServerClusterMap{})
pulumi.RegisterOutputType(GameServerClusterOutput{})
pulumi.RegisterOutputType(GameServerClusterArrayOutput{})
pulumi.RegisterOutputType(GameServerClusterMapOutput{})
}