/
thirdPartyIntegration.go
488 lines (428 loc) · 16.8 KB
/
thirdPartyIntegration.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
// *** 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 mongodbatlas
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// ## Import
//
// Third-Party Integration Settings can be imported using project ID and the integration type, in the format `project_id`-`type`, e.g.
//
// ```sh
// $ pulumi import mongodbatlas:index/thirdPartyIntegration:ThirdPartyIntegration my_user 1112222b3bf99403840e8934-OPS_GENIE
// ```
//
// See [MongoDB Atlas API](https://docs.atlas.mongodb.com/reference/api/third-party-integration-settings-create/) Documentation for more information.
type ThirdPartyIntegration struct {
pulumi.CustomResourceState
// Unique identifier of your New Relic account.
AccountId pulumi.StringPtrOutput `pulumi:"accountId"`
// Your API Key.
ApiKey pulumi.StringPtrOutput `pulumi:"apiKey"`
// Your API Token.
ApiToken pulumi.StringPtrOutput `pulumi:"apiToken"`
ChannelName pulumi.StringPtrOutput `pulumi:"channelName"`
// Your Flowdock Flow name.
FlowName pulumi.StringPtrOutput `pulumi:"flowName"`
// Your License Key.
LicenseKey pulumi.StringPtrOutput `pulumi:"licenseKey"`
// Your Flowdock organization name.
// * `WEBHOOK`
OrgName pulumi.StringPtrOutput `pulumi:"orgName"`
// The unique ID for the project to get all Third-Party service integrations
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// Your Insights Query Key.
// * `OPS_GENIE`
ReadToken pulumi.StringPtrOutput `pulumi:"readToken"`
// Indicates which API URL to use, either US or EU. Opsgenie will use US by default.
// * `VICTOR_OPS`
Region pulumi.StringPtrOutput `pulumi:"region"`
// An optional field for your Routing Key.
// * `FLOWDOCK`
RoutingKey pulumi.StringPtrOutput `pulumi:"routingKey"`
// An optional field for your webhook secret.
Secret pulumi.StringPtrOutput `pulumi:"secret"`
// Your Service Key.
// * `DATADOG`
ServiceKey pulumi.StringPtrOutput `pulumi:"serviceKey"`
TeamName pulumi.StringPtrOutput `pulumi:"teamName"`
// Third-Party Integration Settings type
// * PAGER_DUTY
// * DATADOG
// * NEW_RELIC
// * OPS_GENIE
// * VICTOR_OPS
// * FLOWDOCK
// * WEBHOOK
Type pulumi.StringOutput `pulumi:"type"`
// Your webhook URL.
Url pulumi.StringPtrOutput `pulumi:"url"`
// Your Insights Insert Key.
WriteToken pulumi.StringPtrOutput `pulumi:"writeToken"`
}
// NewThirdPartyIntegration registers a new resource with the given unique name, arguments, and options.
func NewThirdPartyIntegration(ctx *pulumi.Context,
name string, args *ThirdPartyIntegrationArgs, opts ...pulumi.ResourceOption) (*ThirdPartyIntegration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
var resource ThirdPartyIntegration
err := ctx.RegisterResource("mongodbatlas:index/thirdPartyIntegration:ThirdPartyIntegration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetThirdPartyIntegration gets an existing ThirdPartyIntegration 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 GetThirdPartyIntegration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ThirdPartyIntegrationState, opts ...pulumi.ResourceOption) (*ThirdPartyIntegration, error) {
var resource ThirdPartyIntegration
err := ctx.ReadResource("mongodbatlas:index/thirdPartyIntegration:ThirdPartyIntegration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ThirdPartyIntegration resources.
type thirdPartyIntegrationState struct {
// Unique identifier of your New Relic account.
AccountId *string `pulumi:"accountId"`
// Your API Key.
ApiKey *string `pulumi:"apiKey"`
// Your API Token.
ApiToken *string `pulumi:"apiToken"`
ChannelName *string `pulumi:"channelName"`
// Your Flowdock Flow name.
FlowName *string `pulumi:"flowName"`
// Your License Key.
LicenseKey *string `pulumi:"licenseKey"`
// Your Flowdock organization name.
// * `WEBHOOK`
OrgName *string `pulumi:"orgName"`
// The unique ID for the project to get all Third-Party service integrations
ProjectId *string `pulumi:"projectId"`
// Your Insights Query Key.
// * `OPS_GENIE`
ReadToken *string `pulumi:"readToken"`
// Indicates which API URL to use, either US or EU. Opsgenie will use US by default.
// * `VICTOR_OPS`
Region *string `pulumi:"region"`
// An optional field for your Routing Key.
// * `FLOWDOCK`
RoutingKey *string `pulumi:"routingKey"`
// An optional field for your webhook secret.
Secret *string `pulumi:"secret"`
// Your Service Key.
// * `DATADOG`
ServiceKey *string `pulumi:"serviceKey"`
TeamName *string `pulumi:"teamName"`
// Third-Party Integration Settings type
// * PAGER_DUTY
// * DATADOG
// * NEW_RELIC
// * OPS_GENIE
// * VICTOR_OPS
// * FLOWDOCK
// * WEBHOOK
Type *string `pulumi:"type"`
// Your webhook URL.
Url *string `pulumi:"url"`
// Your Insights Insert Key.
WriteToken *string `pulumi:"writeToken"`
}
type ThirdPartyIntegrationState struct {
// Unique identifier of your New Relic account.
AccountId pulumi.StringPtrInput
// Your API Key.
ApiKey pulumi.StringPtrInput
// Your API Token.
ApiToken pulumi.StringPtrInput
ChannelName pulumi.StringPtrInput
// Your Flowdock Flow name.
FlowName pulumi.StringPtrInput
// Your License Key.
LicenseKey pulumi.StringPtrInput
// Your Flowdock organization name.
// * `WEBHOOK`
OrgName pulumi.StringPtrInput
// The unique ID for the project to get all Third-Party service integrations
ProjectId pulumi.StringPtrInput
// Your Insights Query Key.
// * `OPS_GENIE`
ReadToken pulumi.StringPtrInput
// Indicates which API URL to use, either US or EU. Opsgenie will use US by default.
// * `VICTOR_OPS`
Region pulumi.StringPtrInput
// An optional field for your Routing Key.
// * `FLOWDOCK`
RoutingKey pulumi.StringPtrInput
// An optional field for your webhook secret.
Secret pulumi.StringPtrInput
// Your Service Key.
// * `DATADOG`
ServiceKey pulumi.StringPtrInput
TeamName pulumi.StringPtrInput
// Third-Party Integration Settings type
// * PAGER_DUTY
// * DATADOG
// * NEW_RELIC
// * OPS_GENIE
// * VICTOR_OPS
// * FLOWDOCK
// * WEBHOOK
Type pulumi.StringPtrInput
// Your webhook URL.
Url pulumi.StringPtrInput
// Your Insights Insert Key.
WriteToken pulumi.StringPtrInput
}
func (ThirdPartyIntegrationState) ElementType() reflect.Type {
return reflect.TypeOf((*thirdPartyIntegrationState)(nil)).Elem()
}
type thirdPartyIntegrationArgs struct {
// Unique identifier of your New Relic account.
AccountId *string `pulumi:"accountId"`
// Your API Key.
ApiKey *string `pulumi:"apiKey"`
// Your API Token.
ApiToken *string `pulumi:"apiToken"`
ChannelName *string `pulumi:"channelName"`
// Your Flowdock Flow name.
FlowName *string `pulumi:"flowName"`
// Your License Key.
LicenseKey *string `pulumi:"licenseKey"`
// Your Flowdock organization name.
// * `WEBHOOK`
OrgName *string `pulumi:"orgName"`
// The unique ID for the project to get all Third-Party service integrations
ProjectId string `pulumi:"projectId"`
// Your Insights Query Key.
// * `OPS_GENIE`
ReadToken *string `pulumi:"readToken"`
// Indicates which API URL to use, either US or EU. Opsgenie will use US by default.
// * `VICTOR_OPS`
Region *string `pulumi:"region"`
// An optional field for your Routing Key.
// * `FLOWDOCK`
RoutingKey *string `pulumi:"routingKey"`
// An optional field for your webhook secret.
Secret *string `pulumi:"secret"`
// Your Service Key.
// * `DATADOG`
ServiceKey *string `pulumi:"serviceKey"`
TeamName *string `pulumi:"teamName"`
// Third-Party Integration Settings type
// * PAGER_DUTY
// * DATADOG
// * NEW_RELIC
// * OPS_GENIE
// * VICTOR_OPS
// * FLOWDOCK
// * WEBHOOK
Type string `pulumi:"type"`
// Your webhook URL.
Url *string `pulumi:"url"`
// Your Insights Insert Key.
WriteToken *string `pulumi:"writeToken"`
}
// The set of arguments for constructing a ThirdPartyIntegration resource.
type ThirdPartyIntegrationArgs struct {
// Unique identifier of your New Relic account.
AccountId pulumi.StringPtrInput
// Your API Key.
ApiKey pulumi.StringPtrInput
// Your API Token.
ApiToken pulumi.StringPtrInput
ChannelName pulumi.StringPtrInput
// Your Flowdock Flow name.
FlowName pulumi.StringPtrInput
// Your License Key.
LicenseKey pulumi.StringPtrInput
// Your Flowdock organization name.
// * `WEBHOOK`
OrgName pulumi.StringPtrInput
// The unique ID for the project to get all Third-Party service integrations
ProjectId pulumi.StringInput
// Your Insights Query Key.
// * `OPS_GENIE`
ReadToken pulumi.StringPtrInput
// Indicates which API URL to use, either US or EU. Opsgenie will use US by default.
// * `VICTOR_OPS`
Region pulumi.StringPtrInput
// An optional field for your Routing Key.
// * `FLOWDOCK`
RoutingKey pulumi.StringPtrInput
// An optional field for your webhook secret.
Secret pulumi.StringPtrInput
// Your Service Key.
// * `DATADOG`
ServiceKey pulumi.StringPtrInput
TeamName pulumi.StringPtrInput
// Third-Party Integration Settings type
// * PAGER_DUTY
// * DATADOG
// * NEW_RELIC
// * OPS_GENIE
// * VICTOR_OPS
// * FLOWDOCK
// * WEBHOOK
Type pulumi.StringInput
// Your webhook URL.
Url pulumi.StringPtrInput
// Your Insights Insert Key.
WriteToken pulumi.StringPtrInput
}
func (ThirdPartyIntegrationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*thirdPartyIntegrationArgs)(nil)).Elem()
}
type ThirdPartyIntegrationInput interface {
pulumi.Input
ToThirdPartyIntegrationOutput() ThirdPartyIntegrationOutput
ToThirdPartyIntegrationOutputWithContext(ctx context.Context) ThirdPartyIntegrationOutput
}
func (*ThirdPartyIntegration) ElementType() reflect.Type {
return reflect.TypeOf((*ThirdPartyIntegration)(nil))
}
func (i *ThirdPartyIntegration) ToThirdPartyIntegrationOutput() ThirdPartyIntegrationOutput {
return i.ToThirdPartyIntegrationOutputWithContext(context.Background())
}
func (i *ThirdPartyIntegration) ToThirdPartyIntegrationOutputWithContext(ctx context.Context) ThirdPartyIntegrationOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThirdPartyIntegrationOutput)
}
func (i *ThirdPartyIntegration) ToThirdPartyIntegrationPtrOutput() ThirdPartyIntegrationPtrOutput {
return i.ToThirdPartyIntegrationPtrOutputWithContext(context.Background())
}
func (i *ThirdPartyIntegration) ToThirdPartyIntegrationPtrOutputWithContext(ctx context.Context) ThirdPartyIntegrationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThirdPartyIntegrationPtrOutput)
}
type ThirdPartyIntegrationPtrInput interface {
pulumi.Input
ToThirdPartyIntegrationPtrOutput() ThirdPartyIntegrationPtrOutput
ToThirdPartyIntegrationPtrOutputWithContext(ctx context.Context) ThirdPartyIntegrationPtrOutput
}
type thirdPartyIntegrationPtrType ThirdPartyIntegrationArgs
func (*thirdPartyIntegrationPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**ThirdPartyIntegration)(nil))
}
func (i *thirdPartyIntegrationPtrType) ToThirdPartyIntegrationPtrOutput() ThirdPartyIntegrationPtrOutput {
return i.ToThirdPartyIntegrationPtrOutputWithContext(context.Background())
}
func (i *thirdPartyIntegrationPtrType) ToThirdPartyIntegrationPtrOutputWithContext(ctx context.Context) ThirdPartyIntegrationPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThirdPartyIntegrationPtrOutput)
}
// ThirdPartyIntegrationArrayInput is an input type that accepts ThirdPartyIntegrationArray and ThirdPartyIntegrationArrayOutput values.
// You can construct a concrete instance of `ThirdPartyIntegrationArrayInput` via:
//
// ThirdPartyIntegrationArray{ ThirdPartyIntegrationArgs{...} }
type ThirdPartyIntegrationArrayInput interface {
pulumi.Input
ToThirdPartyIntegrationArrayOutput() ThirdPartyIntegrationArrayOutput
ToThirdPartyIntegrationArrayOutputWithContext(context.Context) ThirdPartyIntegrationArrayOutput
}
type ThirdPartyIntegrationArray []ThirdPartyIntegrationInput
func (ThirdPartyIntegrationArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*ThirdPartyIntegration)(nil))
}
func (i ThirdPartyIntegrationArray) ToThirdPartyIntegrationArrayOutput() ThirdPartyIntegrationArrayOutput {
return i.ToThirdPartyIntegrationArrayOutputWithContext(context.Background())
}
func (i ThirdPartyIntegrationArray) ToThirdPartyIntegrationArrayOutputWithContext(ctx context.Context) ThirdPartyIntegrationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThirdPartyIntegrationArrayOutput)
}
// ThirdPartyIntegrationMapInput is an input type that accepts ThirdPartyIntegrationMap and ThirdPartyIntegrationMapOutput values.
// You can construct a concrete instance of `ThirdPartyIntegrationMapInput` via:
//
// ThirdPartyIntegrationMap{ "key": ThirdPartyIntegrationArgs{...} }
type ThirdPartyIntegrationMapInput interface {
pulumi.Input
ToThirdPartyIntegrationMapOutput() ThirdPartyIntegrationMapOutput
ToThirdPartyIntegrationMapOutputWithContext(context.Context) ThirdPartyIntegrationMapOutput
}
type ThirdPartyIntegrationMap map[string]ThirdPartyIntegrationInput
func (ThirdPartyIntegrationMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*ThirdPartyIntegration)(nil))
}
func (i ThirdPartyIntegrationMap) ToThirdPartyIntegrationMapOutput() ThirdPartyIntegrationMapOutput {
return i.ToThirdPartyIntegrationMapOutputWithContext(context.Background())
}
func (i ThirdPartyIntegrationMap) ToThirdPartyIntegrationMapOutputWithContext(ctx context.Context) ThirdPartyIntegrationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ThirdPartyIntegrationMapOutput)
}
type ThirdPartyIntegrationOutput struct {
*pulumi.OutputState
}
func (ThirdPartyIntegrationOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ThirdPartyIntegration)(nil))
}
func (o ThirdPartyIntegrationOutput) ToThirdPartyIntegrationOutput() ThirdPartyIntegrationOutput {
return o
}
func (o ThirdPartyIntegrationOutput) ToThirdPartyIntegrationOutputWithContext(ctx context.Context) ThirdPartyIntegrationOutput {
return o
}
func (o ThirdPartyIntegrationOutput) ToThirdPartyIntegrationPtrOutput() ThirdPartyIntegrationPtrOutput {
return o.ToThirdPartyIntegrationPtrOutputWithContext(context.Background())
}
func (o ThirdPartyIntegrationOutput) ToThirdPartyIntegrationPtrOutputWithContext(ctx context.Context) ThirdPartyIntegrationPtrOutput {
return o.ApplyT(func(v ThirdPartyIntegration) *ThirdPartyIntegration {
return &v
}).(ThirdPartyIntegrationPtrOutput)
}
type ThirdPartyIntegrationPtrOutput struct {
*pulumi.OutputState
}
func (ThirdPartyIntegrationPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ThirdPartyIntegration)(nil))
}
func (o ThirdPartyIntegrationPtrOutput) ToThirdPartyIntegrationPtrOutput() ThirdPartyIntegrationPtrOutput {
return o
}
func (o ThirdPartyIntegrationPtrOutput) ToThirdPartyIntegrationPtrOutputWithContext(ctx context.Context) ThirdPartyIntegrationPtrOutput {
return o
}
type ThirdPartyIntegrationArrayOutput struct{ *pulumi.OutputState }
func (ThirdPartyIntegrationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]ThirdPartyIntegration)(nil))
}
func (o ThirdPartyIntegrationArrayOutput) ToThirdPartyIntegrationArrayOutput() ThirdPartyIntegrationArrayOutput {
return o
}
func (o ThirdPartyIntegrationArrayOutput) ToThirdPartyIntegrationArrayOutputWithContext(ctx context.Context) ThirdPartyIntegrationArrayOutput {
return o
}
func (o ThirdPartyIntegrationArrayOutput) Index(i pulumi.IntInput) ThirdPartyIntegrationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) ThirdPartyIntegration {
return vs[0].([]ThirdPartyIntegration)[vs[1].(int)]
}).(ThirdPartyIntegrationOutput)
}
type ThirdPartyIntegrationMapOutput struct{ *pulumi.OutputState }
func (ThirdPartyIntegrationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]ThirdPartyIntegration)(nil))
}
func (o ThirdPartyIntegrationMapOutput) ToThirdPartyIntegrationMapOutput() ThirdPartyIntegrationMapOutput {
return o
}
func (o ThirdPartyIntegrationMapOutput) ToThirdPartyIntegrationMapOutputWithContext(ctx context.Context) ThirdPartyIntegrationMapOutput {
return o
}
func (o ThirdPartyIntegrationMapOutput) MapIndex(k pulumi.StringInput) ThirdPartyIntegrationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) ThirdPartyIntegration {
return vs[0].(map[string]ThirdPartyIntegration)[vs[1].(string)]
}).(ThirdPartyIntegrationOutput)
}
func init() {
pulumi.RegisterOutputType(ThirdPartyIntegrationOutput{})
pulumi.RegisterOutputType(ThirdPartyIntegrationPtrOutput{})
pulumi.RegisterOutputType(ThirdPartyIntegrationArrayOutput{})
pulumi.RegisterOutputType(ThirdPartyIntegrationMapOutput{})
}