generated from pulumi/pulumi-tf-provider-boilerplate
/
clusterAlterRule.go
456 lines (396 loc) · 17.2 KB
/
clusterAlterRule.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
// 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 rancher2
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Rancher v2 Cluster Alert Group resource. This can be used to create Cluster Alert Group for Rancher v2 environments and retrieve their information.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-rancher2/sdk/v4/go/rancher2"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := rancher2.NewClusterAlertGroup(ctx, "foo", &rancher2.ClusterAlertGroupArgs{
// ClusterId: pulumi.String("<cluster_id>"),
// Description: pulumi.String("Terraform cluster alert group"),
// GroupIntervalSeconds: pulumi.Int(300),
// RepeatIntervalSeconds: pulumi.Int(3600),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// # Cluster Alert Group can be imported using the Rancher cluster alert group ID
//
// ```sh
//
// $ pulumi import rancher2:index/clusterAlterRule:ClusterAlterRule foo <CLUSTER_ALERT_GROUP_ID>
//
// ```
//
// Deprecated: rancher2.ClusterAlterRule has been deprecated in favor of rancher2.ClusterAlertRule
type ClusterAlterRule struct {
pulumi.CustomResourceState
// The cluster alert group annotations (map)
Annotations pulumi.MapOutput `pulumi:"annotations"`
// The cluster id where create cluster alert group (string)
ClusterId pulumi.StringOutput `pulumi:"clusterId"`
// Alert event rule
EventRule ClusterAlterRuleEventRulePtrOutput `pulumi:"eventRule"`
// Alert rule group ID
GroupId pulumi.StringOutput `pulumi:"groupId"`
// The cluster alert group interval seconds. Default: `180` (int)
GroupIntervalSeconds pulumi.IntPtrOutput `pulumi:"groupIntervalSeconds"`
// The cluster alert group wait seconds. Default: `180` (int)
GroupWaitSeconds pulumi.IntPtrOutput `pulumi:"groupWaitSeconds"`
// Alert rule inherited
Inherited pulumi.BoolPtrOutput `pulumi:"inherited"`
// The cluster alert group labels (map)
Labels pulumi.MapOutput `pulumi:"labels"`
// Alert metric rule
MetricRule ClusterAlterRuleMetricRulePtrOutput `pulumi:"metricRule"`
// The cluster alert group name (string)
Name pulumi.StringOutput `pulumi:"name"`
// Alert node rule
NodeRule ClusterAlterRuleNodeRulePtrOutput `pulumi:"nodeRule"`
// The cluster alert group wait seconds. Default: `3600` (int)
RepeatIntervalSeconds pulumi.IntPtrOutput `pulumi:"repeatIntervalSeconds"`
// Alert rule severity
Severity pulumi.StringPtrOutput `pulumi:"severity"`
// Alert system service rule
SystemServiceRule ClusterAlterRuleSystemServiceRulePtrOutput `pulumi:"systemServiceRule"`
}
// NewClusterAlterRule registers a new resource with the given unique name, arguments, and options.
func NewClusterAlterRule(ctx *pulumi.Context,
name string, args *ClusterAlterRuleArgs, opts ...pulumi.ResourceOption) (*ClusterAlterRule, 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.GroupId == nil {
return nil, errors.New("invalid value for required argument 'GroupId'")
}
var resource ClusterAlterRule
err := ctx.RegisterResource("rancher2:index/clusterAlterRule:ClusterAlterRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetClusterAlterRule gets an existing ClusterAlterRule 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 GetClusterAlterRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterAlterRuleState, opts ...pulumi.ResourceOption) (*ClusterAlterRule, error) {
var resource ClusterAlterRule
err := ctx.ReadResource("rancher2:index/clusterAlterRule:ClusterAlterRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ClusterAlterRule resources.
type clusterAlterRuleState struct {
// The cluster alert group annotations (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// The cluster id where create cluster alert group (string)
ClusterId *string `pulumi:"clusterId"`
// Alert event rule
EventRule *ClusterAlterRuleEventRule `pulumi:"eventRule"`
// Alert rule group ID
GroupId *string `pulumi:"groupId"`
// The cluster alert group interval seconds. Default: `180` (int)
GroupIntervalSeconds *int `pulumi:"groupIntervalSeconds"`
// The cluster alert group wait seconds. Default: `180` (int)
GroupWaitSeconds *int `pulumi:"groupWaitSeconds"`
// Alert rule inherited
Inherited *bool `pulumi:"inherited"`
// The cluster alert group labels (map)
Labels map[string]interface{} `pulumi:"labels"`
// Alert metric rule
MetricRule *ClusterAlterRuleMetricRule `pulumi:"metricRule"`
// The cluster alert group name (string)
Name *string `pulumi:"name"`
// Alert node rule
NodeRule *ClusterAlterRuleNodeRule `pulumi:"nodeRule"`
// The cluster alert group wait seconds. Default: `3600` (int)
RepeatIntervalSeconds *int `pulumi:"repeatIntervalSeconds"`
// Alert rule severity
Severity *string `pulumi:"severity"`
// Alert system service rule
SystemServiceRule *ClusterAlterRuleSystemServiceRule `pulumi:"systemServiceRule"`
}
type ClusterAlterRuleState struct {
// The cluster alert group annotations (map)
Annotations pulumi.MapInput
// The cluster id where create cluster alert group (string)
ClusterId pulumi.StringPtrInput
// Alert event rule
EventRule ClusterAlterRuleEventRulePtrInput
// Alert rule group ID
GroupId pulumi.StringPtrInput
// The cluster alert group interval seconds. Default: `180` (int)
GroupIntervalSeconds pulumi.IntPtrInput
// The cluster alert group wait seconds. Default: `180` (int)
GroupWaitSeconds pulumi.IntPtrInput
// Alert rule inherited
Inherited pulumi.BoolPtrInput
// The cluster alert group labels (map)
Labels pulumi.MapInput
// Alert metric rule
MetricRule ClusterAlterRuleMetricRulePtrInput
// The cluster alert group name (string)
Name pulumi.StringPtrInput
// Alert node rule
NodeRule ClusterAlterRuleNodeRulePtrInput
// The cluster alert group wait seconds. Default: `3600` (int)
RepeatIntervalSeconds pulumi.IntPtrInput
// Alert rule severity
Severity pulumi.StringPtrInput
// Alert system service rule
SystemServiceRule ClusterAlterRuleSystemServiceRulePtrInput
}
func (ClusterAlterRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterAlterRuleState)(nil)).Elem()
}
type clusterAlterRuleArgs struct {
// The cluster alert group annotations (map)
Annotations map[string]interface{} `pulumi:"annotations"`
// The cluster id where create cluster alert group (string)
ClusterId string `pulumi:"clusterId"`
// Alert event rule
EventRule *ClusterAlterRuleEventRule `pulumi:"eventRule"`
// Alert rule group ID
GroupId string `pulumi:"groupId"`
// The cluster alert group interval seconds. Default: `180` (int)
GroupIntervalSeconds *int `pulumi:"groupIntervalSeconds"`
// The cluster alert group wait seconds. Default: `180` (int)
GroupWaitSeconds *int `pulumi:"groupWaitSeconds"`
// Alert rule inherited
Inherited *bool `pulumi:"inherited"`
// The cluster alert group labels (map)
Labels map[string]interface{} `pulumi:"labels"`
// Alert metric rule
MetricRule *ClusterAlterRuleMetricRule `pulumi:"metricRule"`
// The cluster alert group name (string)
Name *string `pulumi:"name"`
// Alert node rule
NodeRule *ClusterAlterRuleNodeRule `pulumi:"nodeRule"`
// The cluster alert group wait seconds. Default: `3600` (int)
RepeatIntervalSeconds *int `pulumi:"repeatIntervalSeconds"`
// Alert rule severity
Severity *string `pulumi:"severity"`
// Alert system service rule
SystemServiceRule *ClusterAlterRuleSystemServiceRule `pulumi:"systemServiceRule"`
}
// The set of arguments for constructing a ClusterAlterRule resource.
type ClusterAlterRuleArgs struct {
// The cluster alert group annotations (map)
Annotations pulumi.MapInput
// The cluster id where create cluster alert group (string)
ClusterId pulumi.StringInput
// Alert event rule
EventRule ClusterAlterRuleEventRulePtrInput
// Alert rule group ID
GroupId pulumi.StringInput
// The cluster alert group interval seconds. Default: `180` (int)
GroupIntervalSeconds pulumi.IntPtrInput
// The cluster alert group wait seconds. Default: `180` (int)
GroupWaitSeconds pulumi.IntPtrInput
// Alert rule inherited
Inherited pulumi.BoolPtrInput
// The cluster alert group labels (map)
Labels pulumi.MapInput
// Alert metric rule
MetricRule ClusterAlterRuleMetricRulePtrInput
// The cluster alert group name (string)
Name pulumi.StringPtrInput
// Alert node rule
NodeRule ClusterAlterRuleNodeRulePtrInput
// The cluster alert group wait seconds. Default: `3600` (int)
RepeatIntervalSeconds pulumi.IntPtrInput
// Alert rule severity
Severity pulumi.StringPtrInput
// Alert system service rule
SystemServiceRule ClusterAlterRuleSystemServiceRulePtrInput
}
func (ClusterAlterRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterAlterRuleArgs)(nil)).Elem()
}
type ClusterAlterRuleInput interface {
pulumi.Input
ToClusterAlterRuleOutput() ClusterAlterRuleOutput
ToClusterAlterRuleOutputWithContext(ctx context.Context) ClusterAlterRuleOutput
}
func (*ClusterAlterRule) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterAlterRule)(nil)).Elem()
}
func (i *ClusterAlterRule) ToClusterAlterRuleOutput() ClusterAlterRuleOutput {
return i.ToClusterAlterRuleOutputWithContext(context.Background())
}
func (i *ClusterAlterRule) ToClusterAlterRuleOutputWithContext(ctx context.Context) ClusterAlterRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterAlterRuleOutput)
}
// ClusterAlterRuleArrayInput is an input type that accepts ClusterAlterRuleArray and ClusterAlterRuleArrayOutput values.
// You can construct a concrete instance of `ClusterAlterRuleArrayInput` via:
//
// ClusterAlterRuleArray{ ClusterAlterRuleArgs{...} }
type ClusterAlterRuleArrayInput interface {
pulumi.Input
ToClusterAlterRuleArrayOutput() ClusterAlterRuleArrayOutput
ToClusterAlterRuleArrayOutputWithContext(context.Context) ClusterAlterRuleArrayOutput
}
type ClusterAlterRuleArray []ClusterAlterRuleInput
func (ClusterAlterRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterAlterRule)(nil)).Elem()
}
func (i ClusterAlterRuleArray) ToClusterAlterRuleArrayOutput() ClusterAlterRuleArrayOutput {
return i.ToClusterAlterRuleArrayOutputWithContext(context.Background())
}
func (i ClusterAlterRuleArray) ToClusterAlterRuleArrayOutputWithContext(ctx context.Context) ClusterAlterRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterAlterRuleArrayOutput)
}
// ClusterAlterRuleMapInput is an input type that accepts ClusterAlterRuleMap and ClusterAlterRuleMapOutput values.
// You can construct a concrete instance of `ClusterAlterRuleMapInput` via:
//
// ClusterAlterRuleMap{ "key": ClusterAlterRuleArgs{...} }
type ClusterAlterRuleMapInput interface {
pulumi.Input
ToClusterAlterRuleMapOutput() ClusterAlterRuleMapOutput
ToClusterAlterRuleMapOutputWithContext(context.Context) ClusterAlterRuleMapOutput
}
type ClusterAlterRuleMap map[string]ClusterAlterRuleInput
func (ClusterAlterRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterAlterRule)(nil)).Elem()
}
func (i ClusterAlterRuleMap) ToClusterAlterRuleMapOutput() ClusterAlterRuleMapOutput {
return i.ToClusterAlterRuleMapOutputWithContext(context.Background())
}
func (i ClusterAlterRuleMap) ToClusterAlterRuleMapOutputWithContext(ctx context.Context) ClusterAlterRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterAlterRuleMapOutput)
}
type ClusterAlterRuleOutput struct{ *pulumi.OutputState }
func (ClusterAlterRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ClusterAlterRule)(nil)).Elem()
}
func (o ClusterAlterRuleOutput) ToClusterAlterRuleOutput() ClusterAlterRuleOutput {
return o
}
func (o ClusterAlterRuleOutput) ToClusterAlterRuleOutputWithContext(ctx context.Context) ClusterAlterRuleOutput {
return o
}
// The cluster alert group annotations (map)
func (o ClusterAlterRuleOutput) Annotations() pulumi.MapOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.MapOutput { return v.Annotations }).(pulumi.MapOutput)
}
// The cluster id where create cluster alert group (string)
func (o ClusterAlterRuleOutput) ClusterId() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.StringOutput { return v.ClusterId }).(pulumi.StringOutput)
}
// Alert event rule
func (o ClusterAlterRuleOutput) EventRule() ClusterAlterRuleEventRulePtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) ClusterAlterRuleEventRulePtrOutput { return v.EventRule }).(ClusterAlterRuleEventRulePtrOutput)
}
// Alert rule group ID
func (o ClusterAlterRuleOutput) GroupId() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.StringOutput { return v.GroupId }).(pulumi.StringOutput)
}
// The cluster alert group interval seconds. Default: `180` (int)
func (o ClusterAlterRuleOutput) GroupIntervalSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.IntPtrOutput { return v.GroupIntervalSeconds }).(pulumi.IntPtrOutput)
}
// The cluster alert group wait seconds. Default: `180` (int)
func (o ClusterAlterRuleOutput) GroupWaitSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.IntPtrOutput { return v.GroupWaitSeconds }).(pulumi.IntPtrOutput)
}
// Alert rule inherited
func (o ClusterAlterRuleOutput) Inherited() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.BoolPtrOutput { return v.Inherited }).(pulumi.BoolPtrOutput)
}
// The cluster alert group labels (map)
func (o ClusterAlterRuleOutput) Labels() pulumi.MapOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.MapOutput { return v.Labels }).(pulumi.MapOutput)
}
// Alert metric rule
func (o ClusterAlterRuleOutput) MetricRule() ClusterAlterRuleMetricRulePtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) ClusterAlterRuleMetricRulePtrOutput { return v.MetricRule }).(ClusterAlterRuleMetricRulePtrOutput)
}
// The cluster alert group name (string)
func (o ClusterAlterRuleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Alert node rule
func (o ClusterAlterRuleOutput) NodeRule() ClusterAlterRuleNodeRulePtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) ClusterAlterRuleNodeRulePtrOutput { return v.NodeRule }).(ClusterAlterRuleNodeRulePtrOutput)
}
// The cluster alert group wait seconds. Default: `3600` (int)
func (o ClusterAlterRuleOutput) RepeatIntervalSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.IntPtrOutput { return v.RepeatIntervalSeconds }).(pulumi.IntPtrOutput)
}
// Alert rule severity
func (o ClusterAlterRuleOutput) Severity() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) pulumi.StringPtrOutput { return v.Severity }).(pulumi.StringPtrOutput)
}
// Alert system service rule
func (o ClusterAlterRuleOutput) SystemServiceRule() ClusterAlterRuleSystemServiceRulePtrOutput {
return o.ApplyT(func(v *ClusterAlterRule) ClusterAlterRuleSystemServiceRulePtrOutput { return v.SystemServiceRule }).(ClusterAlterRuleSystemServiceRulePtrOutput)
}
type ClusterAlterRuleArrayOutput struct{ *pulumi.OutputState }
func (ClusterAlterRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ClusterAlterRule)(nil)).Elem()
}
func (o ClusterAlterRuleArrayOutput) ToClusterAlterRuleArrayOutput() ClusterAlterRuleArrayOutput {
return o
}
func (o ClusterAlterRuleArrayOutput) ToClusterAlterRuleArrayOutputWithContext(ctx context.Context) ClusterAlterRuleArrayOutput {
return o
}
func (o ClusterAlterRuleArrayOutput) Index(i pulumi.IntInput) ClusterAlterRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterAlterRule {
return vs[0].([]*ClusterAlterRule)[vs[1].(int)]
}).(ClusterAlterRuleOutput)
}
type ClusterAlterRuleMapOutput struct{ *pulumi.OutputState }
func (ClusterAlterRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ClusterAlterRule)(nil)).Elem()
}
func (o ClusterAlterRuleMapOutput) ToClusterAlterRuleMapOutput() ClusterAlterRuleMapOutput {
return o
}
func (o ClusterAlterRuleMapOutput) ToClusterAlterRuleMapOutputWithContext(ctx context.Context) ClusterAlterRuleMapOutput {
return o
}
func (o ClusterAlterRuleMapOutput) MapIndex(k pulumi.StringInput) ClusterAlterRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterAlterRule {
return vs[0].(map[string]*ClusterAlterRule)[vs[1].(string)]
}).(ClusterAlterRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ClusterAlterRuleInput)(nil)).Elem(), &ClusterAlterRule{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterAlterRuleArrayInput)(nil)).Elem(), ClusterAlterRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterAlterRuleMapInput)(nil)).Elem(), ClusterAlterRuleMap{})
pulumi.RegisterOutputType(ClusterAlterRuleOutput{})
pulumi.RegisterOutputType(ClusterAlterRuleArrayOutput{})
pulumi.RegisterOutputType(ClusterAlterRuleMapOutput{})
}