-
Notifications
You must be signed in to change notification settings - Fork 2
/
service.go
467 lines (423 loc) · 15.8 KB
/
service.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package aiven
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
type Service struct {
s *pulumi.ResourceState
}
// NewService registers a new resource with the given unique name, arguments, and options.
func NewService(ctx *pulumi.Context,
name string, args *ServiceArgs, opts ...pulumi.ResourceOpt) (*Service, error) {
if args == nil || args.Project == nil {
return nil, errors.New("missing required argument 'Project'")
}
if args == nil || args.ServiceName == nil {
return nil, errors.New("missing required argument 'ServiceName'")
}
if args == nil || args.ServiceType == nil {
return nil, errors.New("missing required argument 'ServiceType'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["cassandra"] = nil
inputs["cassandraUserConfig"] = nil
inputs["cloudName"] = nil
inputs["elasticsearch"] = nil
inputs["elasticsearchUserConfig"] = nil
inputs["grafana"] = nil
inputs["grafanaUserConfig"] = nil
inputs["influxdb"] = nil
inputs["influxdbUserConfig"] = nil
inputs["kafka"] = nil
inputs["kafkaConnect"] = nil
inputs["kafkaConnectUserConfig"] = nil
inputs["kafkaUserConfig"] = nil
inputs["maintenanceWindowDow"] = nil
inputs["maintenanceWindowTime"] = nil
inputs["mysql"] = nil
inputs["mysqlUserConfig"] = nil
inputs["pg"] = nil
inputs["pgUserConfig"] = nil
inputs["plan"] = nil
inputs["project"] = nil
inputs["projectVpcId"] = nil
inputs["redis"] = nil
inputs["redisUserConfig"] = nil
inputs["serviceIntegrations"] = nil
inputs["serviceName"] = nil
inputs["serviceType"] = nil
inputs["terminationProtection"] = nil
} else {
inputs["cassandra"] = args.Cassandra
inputs["cassandraUserConfig"] = args.CassandraUserConfig
inputs["cloudName"] = args.CloudName
inputs["elasticsearch"] = args.Elasticsearch
inputs["elasticsearchUserConfig"] = args.ElasticsearchUserConfig
inputs["grafana"] = args.Grafana
inputs["grafanaUserConfig"] = args.GrafanaUserConfig
inputs["influxdb"] = args.Influxdb
inputs["influxdbUserConfig"] = args.InfluxdbUserConfig
inputs["kafka"] = args.Kafka
inputs["kafkaConnect"] = args.KafkaConnect
inputs["kafkaConnectUserConfig"] = args.KafkaConnectUserConfig
inputs["kafkaUserConfig"] = args.KafkaUserConfig
inputs["maintenanceWindowDow"] = args.MaintenanceWindowDow
inputs["maintenanceWindowTime"] = args.MaintenanceWindowTime
inputs["mysql"] = args.Mysql
inputs["mysqlUserConfig"] = args.MysqlUserConfig
inputs["pg"] = args.Pg
inputs["pgUserConfig"] = args.PgUserConfig
inputs["plan"] = args.Plan
inputs["project"] = args.Project
inputs["projectVpcId"] = args.ProjectVpcId
inputs["redis"] = args.Redis
inputs["redisUserConfig"] = args.RedisUserConfig
inputs["serviceIntegrations"] = args.ServiceIntegrations
inputs["serviceName"] = args.ServiceName
inputs["serviceType"] = args.ServiceType
inputs["terminationProtection"] = args.TerminationProtection
}
inputs["components"] = nil
inputs["serviceHost"] = nil
inputs["servicePassword"] = nil
inputs["servicePort"] = nil
inputs["serviceUri"] = nil
inputs["serviceUsername"] = nil
inputs["state"] = nil
s, err := ctx.RegisterResource("aiven:index/service:Service", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Service{s: s}, nil
}
// GetService gets an existing Service 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 GetService(ctx *pulumi.Context,
name string, id pulumi.ID, state *ServiceState, opts ...pulumi.ResourceOpt) (*Service, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["cassandra"] = state.Cassandra
inputs["cassandraUserConfig"] = state.CassandraUserConfig
inputs["cloudName"] = state.CloudName
inputs["components"] = state.Components
inputs["elasticsearch"] = state.Elasticsearch
inputs["elasticsearchUserConfig"] = state.ElasticsearchUserConfig
inputs["grafana"] = state.Grafana
inputs["grafanaUserConfig"] = state.GrafanaUserConfig
inputs["influxdb"] = state.Influxdb
inputs["influxdbUserConfig"] = state.InfluxdbUserConfig
inputs["kafka"] = state.Kafka
inputs["kafkaConnect"] = state.KafkaConnect
inputs["kafkaConnectUserConfig"] = state.KafkaConnectUserConfig
inputs["kafkaUserConfig"] = state.KafkaUserConfig
inputs["maintenanceWindowDow"] = state.MaintenanceWindowDow
inputs["maintenanceWindowTime"] = state.MaintenanceWindowTime
inputs["mysql"] = state.Mysql
inputs["mysqlUserConfig"] = state.MysqlUserConfig
inputs["pg"] = state.Pg
inputs["pgUserConfig"] = state.PgUserConfig
inputs["plan"] = state.Plan
inputs["project"] = state.Project
inputs["projectVpcId"] = state.ProjectVpcId
inputs["redis"] = state.Redis
inputs["redisUserConfig"] = state.RedisUserConfig
inputs["serviceHost"] = state.ServiceHost
inputs["serviceIntegrations"] = state.ServiceIntegrations
inputs["serviceName"] = state.ServiceName
inputs["servicePassword"] = state.ServicePassword
inputs["servicePort"] = state.ServicePort
inputs["serviceType"] = state.ServiceType
inputs["serviceUri"] = state.ServiceUri
inputs["serviceUsername"] = state.ServiceUsername
inputs["state"] = state.State
inputs["terminationProtection"] = state.TerminationProtection
}
s, err := ctx.ReadResource("aiven:index/service:Service", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Service{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Service) URN() pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Service) ID() pulumi.IDOutput {
return r.s.ID()
}
// Cassandra specific server provided values
func (r *Service) Cassandra() pulumi.Output {
return r.s.State["cassandra"]
}
// Cassandra specific user configurable settings
func (r *Service) CassandraUserConfig() pulumi.Output {
return r.s.State["cassandraUserConfig"]
}
// Cloud the service runs in
func (r *Service) CloudName() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["cloudName"])
}
// Service component information objects
func (r *Service) Components() pulumi.ArrayOutput {
return (pulumi.ArrayOutput)(r.s.State["components"])
}
// Elasticsearch specific server provided values
func (r *Service) Elasticsearch() pulumi.Output {
return r.s.State["elasticsearch"]
}
// Elasticsearch specific user configurable settings
func (r *Service) ElasticsearchUserConfig() pulumi.Output {
return r.s.State["elasticsearchUserConfig"]
}
// Grafana specific server provided values
func (r *Service) Grafana() pulumi.Output {
return r.s.State["grafana"]
}
// Grafana specific user configurable settings
func (r *Service) GrafanaUserConfig() pulumi.Output {
return r.s.State["grafanaUserConfig"]
}
// InfluxDB specific server provided values
func (r *Service) Influxdb() pulumi.Output {
return r.s.State["influxdb"]
}
// InfluxDB specific user configurable settings
func (r *Service) InfluxdbUserConfig() pulumi.Output {
return r.s.State["influxdbUserConfig"]
}
// Kafka specific server provided values
func (r *Service) Kafka() pulumi.Output {
return r.s.State["kafka"]
}
// Kafka Connect specific server provided values
func (r *Service) KafkaConnect() pulumi.Output {
return r.s.State["kafkaConnect"]
}
// Kafka Connect specific user configurable settings
func (r *Service) KafkaConnectUserConfig() pulumi.Output {
return r.s.State["kafkaConnectUserConfig"]
}
// Kafka specific user configurable settings
func (r *Service) KafkaUserConfig() pulumi.Output {
return r.s.State["kafkaUserConfig"]
}
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
func (r *Service) MaintenanceWindowDow() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["maintenanceWindowDow"])
}
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
func (r *Service) MaintenanceWindowTime() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["maintenanceWindowTime"])
}
// MySQL specific server provided values
func (r *Service) Mysql() pulumi.Output {
return r.s.State["mysql"]
}
// MySQL specific user configurable settings
func (r *Service) MysqlUserConfig() pulumi.Output {
return r.s.State["mysqlUserConfig"]
}
// PostgreSQL specific server provided values
func (r *Service) Pg() pulumi.Output {
return r.s.State["pg"]
}
// PostgreSQL specific user configurable settings
func (r *Service) PgUserConfig() pulumi.Output {
return r.s.State["pgUserConfig"]
}
// Subscription plan
func (r *Service) Plan() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["plan"])
}
// Target project
func (r *Service) Project() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["project"])
}
// Identifier of the VPC the service should be in, if any
func (r *Service) ProjectVpcId() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["projectVpcId"])
}
// Redis specific server provided values
func (r *Service) Redis() pulumi.Output {
return r.s.State["redis"]
}
// Redis specific user configurable settings
func (r *Service) RedisUserConfig() pulumi.Output {
return r.s.State["redisUserConfig"]
}
// Service hostname
func (r *Service) ServiceHost() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceHost"])
}
// Service integrations to specify when creating a service. Not applied after initial service creation
func (r *Service) ServiceIntegrations() pulumi.ArrayOutput {
return (pulumi.ArrayOutput)(r.s.State["serviceIntegrations"])
}
// Service name
func (r *Service) ServiceName() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceName"])
}
// Password used for connecting to the service, if applicable
func (r *Service) ServicePassword() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["servicePassword"])
}
// Service port
func (r *Service) ServicePort() pulumi.IntOutput {
return (pulumi.IntOutput)(r.s.State["servicePort"])
}
// Service type code
func (r *Service) ServiceType() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceType"])
}
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
func (r *Service) ServiceUri() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceUri"])
}
// Username used for connecting to the service, if applicable
func (r *Service) ServiceUsername() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceUsername"])
}
// Service state
func (r *Service) State() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["state"])
}
// Prevent service from being deleted. It is recommended to have this enabled for all services.
func (r *Service) TerminationProtection() pulumi.BoolOutput {
return (pulumi.BoolOutput)(r.s.State["terminationProtection"])
}
// Input properties used for looking up and filtering Service resources.
type ServiceState struct {
// Cassandra specific server provided values
Cassandra interface{}
// Cassandra specific user configurable settings
CassandraUserConfig interface{}
// Cloud the service runs in
CloudName interface{}
// Service component information objects
Components interface{}
// Elasticsearch specific server provided values
Elasticsearch interface{}
// Elasticsearch specific user configurable settings
ElasticsearchUserConfig interface{}
// Grafana specific server provided values
Grafana interface{}
// Grafana specific user configurable settings
GrafanaUserConfig interface{}
// InfluxDB specific server provided values
Influxdb interface{}
// InfluxDB specific user configurable settings
InfluxdbUserConfig interface{}
// Kafka specific server provided values
Kafka interface{}
// Kafka Connect specific server provided values
KafkaConnect interface{}
// Kafka Connect specific user configurable settings
KafkaConnectUserConfig interface{}
// Kafka specific user configurable settings
KafkaUserConfig interface{}
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow interface{}
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime interface{}
// MySQL specific server provided values
Mysql interface{}
// MySQL specific user configurable settings
MysqlUserConfig interface{}
// PostgreSQL specific server provided values
Pg interface{}
// PostgreSQL specific user configurable settings
PgUserConfig interface{}
// Subscription plan
Plan interface{}
// Target project
Project interface{}
// Identifier of the VPC the service should be in, if any
ProjectVpcId interface{}
// Redis specific server provided values
Redis interface{}
// Redis specific user configurable settings
RedisUserConfig interface{}
// Service hostname
ServiceHost interface{}
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations interface{}
// Service name
ServiceName interface{}
// Password used for connecting to the service, if applicable
ServicePassword interface{}
// Service port
ServicePort interface{}
// Service type code
ServiceType interface{}
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
ServiceUri interface{}
// Username used for connecting to the service, if applicable
ServiceUsername interface{}
// Service state
State interface{}
// Prevent service from being deleted. It is recommended to have this enabled for all services.
TerminationProtection interface{}
}
// The set of arguments for constructing a Service resource.
type ServiceArgs struct {
// Cassandra specific server provided values
Cassandra interface{}
// Cassandra specific user configurable settings
CassandraUserConfig interface{}
// Cloud the service runs in
CloudName interface{}
// Elasticsearch specific server provided values
Elasticsearch interface{}
// Elasticsearch specific user configurable settings
ElasticsearchUserConfig interface{}
// Grafana specific server provided values
Grafana interface{}
// Grafana specific user configurable settings
GrafanaUserConfig interface{}
// InfluxDB specific server provided values
Influxdb interface{}
// InfluxDB specific user configurable settings
InfluxdbUserConfig interface{}
// Kafka specific server provided values
Kafka interface{}
// Kafka Connect specific server provided values
KafkaConnect interface{}
// Kafka Connect specific user configurable settings
KafkaConnectUserConfig interface{}
// Kafka specific user configurable settings
KafkaUserConfig interface{}
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow interface{}
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime interface{}
// MySQL specific server provided values
Mysql interface{}
// MySQL specific user configurable settings
MysqlUserConfig interface{}
// PostgreSQL specific server provided values
Pg interface{}
// PostgreSQL specific user configurable settings
PgUserConfig interface{}
// Subscription plan
Plan interface{}
// Target project
Project interface{}
// Identifier of the VPC the service should be in, if any
ProjectVpcId interface{}
// Redis specific server provided values
Redis interface{}
// Redis specific user configurable settings
RedisUserConfig interface{}
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations interface{}
// Service name
ServiceName interface{}
// Service type code
ServiceType interface{}
// Prevent service from being deleted. It is recommended to have this enabled for all services.
TerminationProtection interface{}
}