/
nrqlAlertCondition.go
987 lines (915 loc) · 58.1 KB
/
nrqlAlertCondition.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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
// 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 newrelic
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this resource to create and manage NRQL alert conditions in New Relic.
//
// ## Example Usage
//
// ### Type: `static` (default)
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := newrelic.NewAlertPolicy(ctx, "foo", &newrelic.AlertPolicyArgs{
// Name: pulumi.String("foo"),
// })
// if err != nil {
// return err
// }
// _, err = newrelic.NewNrqlAlertCondition(ctx, "foo", &newrelic.NrqlAlertConditionArgs{
// AccountId: pulumi.Int(12345678),
// PolicyId: foo.ID(),
// Type: pulumi.String("static"),
// Name: pulumi.String("foo"),
// Description: pulumi.String("Alert when transactions are taking too long"),
// RunbookUrl: pulumi.String("https://www.example.com"),
// Enabled: pulumi.Bool(true),
// ViolationTimeLimitSeconds: pulumi.Int(3600),
// FillOption: pulumi.String("static"),
// FillValue: pulumi.Float64(1),
// AggregationWindow: pulumi.Int(60),
// AggregationMethod: pulumi.String("event_flow"),
// AggregationDelay: pulumi.String("120"),
// ExpirationDuration: pulumi.Int(120),
// OpenViolationOnExpiration: pulumi.Bool(true),
// CloseViolationsOnExpiration: pulumi.Bool(true),
// SlideBy: pulumi.Int(30),
// Nrql: &newrelic.NrqlAlertConditionNrqlArgs{
// Query: pulumi.String("SELECT average(duration) FROM Transaction where appName = 'Your App'"),
// },
// Critical: &newrelic.NrqlAlertConditionCriticalArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(5.5),
// ThresholdDuration: pulumi.Int(300),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// Warning: &newrelic.NrqlAlertConditionWarningArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(3.5),
// ThresholdDuration: pulumi.Int(600),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## NRQL
//
// The `nrql` block supports the following arguments:
//
// - `query` - (Required) The NRQL query to execute for the condition.
// - `evaluationOffset` - (Optional) **DEPRECATED:** Use `aggregationMethod` instead. Represented in minutes and must be within 1-20 minutes (inclusive). NRQL queries are evaluated based on their `aggregationWindow` size. The start time depends on this value. It's recommended to set this to 3 windows. An offset of less than 3 windows will trigger incidents sooner, but you may see more false positives and negatives due to data latency. With `evaluationOffset` set to 3 windows and an `aggregationWindow` of 60 seconds, the NRQL time window applied to your query will be: `SINCE 3 minutes ago UNTIL 2 minutes ago`. `evaluationOffset` cannot be set with `aggregationMethod`, `aggregationDelay`, or `aggregationTimer`.<br>
// - `sinceValue` - (Optional) **DEPRECATED:** Use `aggregationMethod` instead. The value to be used in the `SINCE <X> minutes ago` clause for the NRQL query. Must be between 1-20 (inclusive). <br>
//
// ## Terms
//
// > **NOTE:** The direct use of the `term` has been deprecated, and users should use `critical` and `warning` instead. What follows now applies to the named priority attributes for `critical` and `warning`, but for those attributes the priority is not allowed. At least one `critical` or `warning` term must be defined.
//
// NRQL alert conditions support up to two terms. At least one `term` must have `priority` set to `critical` and the second optional `term` must have `priority` set to `warning`.
//
// The `term` block supports the following arguments:
//
// - `operator` - (Optional) Valid values are `above`, `aboveOrEquals`, `below`, `belowOrEquals`, `equals`, or `notEquals` (case insensitive). Defaults to `equals`. Note that when using a `type` of `baseline`, the only valid option here is `above`.
// - `priority` - (Optional) `critical` or `warning`. Defaults to `critical`.
// - `threshold` - (Required) The value which will trigger an incident.
// <br>For _baseline_ NRQL alert conditions, the value must be in the range [1, 1000]. The value is the number of standard deviations from the baseline that the metric must exceed in order to create an incident.
// - `thresholdDuration` - (Optional) The duration, in seconds, that the threshold must violate in order to create an incident. Value must be a multiple of the `aggregationWindow` (which has a default of 60 seconds).
// <br>For _baseline_ NRQL alert conditions, the value must be within 120-86400 seconds (inclusive).
// <br>For _static_ NRQL alert conditions, the value must be within 60-86400 seconds (inclusive).
//
// - `thresholdOccurrences` - (Optional) The criteria for how many data points must be in violation for the specified threshold duration. Valid values are: `all` or `atLeastOnce` (case insensitive).
// - `duration` - (Optional) **DEPRECATED:** Use `thresholdDuration` instead. The duration of time, in _minutes_, that the threshold must violate for in order to create an incident. Must be within 1-120 (inclusive).
// - `timeFunction` - (Optional) **DEPRECATED:** Use `thresholdOccurrences` instead. The criteria for how many data points must be in violation for the specified threshold duration. Valid values are: `all` or `any`.
//
// > **NOTE:** When a `critical` or `warning` block is added to this resource, using either `duration` or `thresholdDuration` (one of the two) is mandatory. Both of these should not be specified.
//
// > **NOTE:** When a `critical` or `warning` block is added to this resource, using either `timeFunction` or `thresholdOccurrences` (one of the two) is mandatory. Both of these should not be specified.
//
// ## Additional Examples
//
// ##### Type: `baseline`
//
// [Baseline NRQL alert conditions](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/create-baseline-alert-conditions) are dynamic in nature and adjust to the behavior of your data. The example below demonstrates a baseline NRQL alert condition for alerting when transaction durations are above a specified threshold and dynamically adjusts based on data trends.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := newrelic.NewAlertPolicy(ctx, "foo", &newrelic.AlertPolicyArgs{
// Name: pulumi.String("foo"),
// })
// if err != nil {
// return err
// }
// _, err = newrelic.NewNrqlAlertCondition(ctx, "foo", &newrelic.NrqlAlertConditionArgs{
// AccountId: pulumi.Int("your_account_id"),
// PolicyId: foo.ID(),
// Type: pulumi.String("static"),
// Name: pulumi.String("foo"),
// Description: pulumi.String("Alert when transactions are taking too long"),
// RunbookUrl: pulumi.String("https://www.example.com"),
// Enabled: pulumi.Bool(true),
// ViolationTimeLimitSeconds: pulumi.Int(3600),
// FillOption: pulumi.String("static"),
// FillValue: pulumi.Float64(1),
// AggregationWindow: pulumi.Int(60),
// AggregationMethod: pulumi.String("event_flow"),
// AggregationDelay: pulumi.String("120"),
// ExpirationDuration: pulumi.Int(120),
// OpenViolationOnExpiration: pulumi.Bool(true),
// CloseViolationsOnExpiration: pulumi.Bool(true),
// SlideBy: pulumi.Int(30),
// Nrql: &newrelic.NrqlAlertConditionNrqlArgs{
// Query: pulumi.String("SELECT average(duration) FROM Transaction where appName = 'Your App'"),
// },
// Critical: &newrelic.NrqlAlertConditionCriticalArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(5.5),
// ThresholdDuration: pulumi.Int(300),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// Warning: &newrelic.NrqlAlertConditionWarningArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(3.5),
// ThresholdDuration: pulumi.Int(600),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Tags
//
// Manage NRQL alert condition tags with `EntityTags`. For up-to-date documentation about the tagging resource, please check `EntityTags`.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// foo, err := newrelic.NewAlertPolicy(ctx, "foo", &newrelic.AlertPolicyArgs{
// Name: pulumi.String("foo"),
// })
// if err != nil {
// return err
// }
// fooNrqlAlertCondition, err := newrelic.NewNrqlAlertCondition(ctx, "foo", &newrelic.NrqlAlertConditionArgs{
// AccountId: pulumi.Int(12345678),
// PolicyId: foo.ID(),
// Type: pulumi.String("static"),
// Name: pulumi.String("foo"),
// Description: pulumi.String("Alert when transactions are taking too long"),
// RunbookUrl: pulumi.String("https://www.example.com"),
// Enabled: pulumi.Bool(true),
// ViolationTimeLimitSeconds: pulumi.Int(3600),
// FillOption: pulumi.String("static"),
// FillValue: pulumi.Float64(1),
// AggregationWindow: pulumi.Int(60),
// AggregationMethod: pulumi.String("event_flow"),
// AggregationDelay: pulumi.String("120"),
// ExpirationDuration: pulumi.Int(120),
// OpenViolationOnExpiration: pulumi.Bool(true),
// CloseViolationsOnExpiration: pulumi.Bool(true),
// SlideBy: pulumi.Int(30),
// Nrql: &newrelic.NrqlAlertConditionNrqlArgs{
// Query: pulumi.String("SELECT average(duration) FROM Transaction where appName = 'Your App'"),
// },
// Critical: &newrelic.NrqlAlertConditionCriticalArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(5.5),
// ThresholdDuration: pulumi.Int(300),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// Warning: &newrelic.NrqlAlertConditionWarningArgs{
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(3.5),
// ThresholdDuration: pulumi.Int(600),
// ThresholdOccurrences: pulumi.String("ALL"),
// },
// })
// if err != nil {
// return err
// }
// _, err = newrelic.NewEntityTags(ctx, "my_condition_entity_tags", &newrelic.EntityTagsArgs{
// Guid: fooNrqlAlertCondition.EntityGuid,
// Tags: newrelic.EntityTagsTagArray{
// &newrelic.EntityTagsTagArgs{
// Key: pulumi.String("my-key"),
// Values: pulumi.StringArray{
// pulumi.String("my-value"),
// pulumi.String("my-other-value"),
// },
// },
// &newrelic.EntityTagsTagArgs{
// Key: pulumi.String("my-key-2"),
// Values: pulumi.StringArray{
// pulumi.String("my-value-2"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// <small>alerts.newrelic.com/accounts/**\<account_id\>**/policies/**\<policy_id\>**/conditions/**\<condition_id\>**/edit</small>
//
// ## Upgrade from 1.x to 2.x
//
// There have been several deprecations in the `NrqlAlertCondition`
// resource. Users will need to make some updates in order to have a smooth
// upgrade.
//
// An example resource from 1.x might look like the following.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := newrelic.NewNrqlAlertCondition(ctx, "z", &newrelic.NrqlAlertConditionArgs{
// PolicyId: pulumi.Any(zNewrelicAlertPolicy.Id),
// Name: pulumi.String("zleslie-test"),
// Type: pulumi.String("static"),
// RunbookUrl: pulumi.String("https://localhost"),
// Enabled: pulumi.Bool(true),
// ViolationTimeLimit: pulumi.String("TWENTY_FOUR_HOURS"),
// Critical: &newrelic.NrqlAlertConditionCriticalArgs{
// Operator: pulumi.String("above"),
// ThresholdDuration: pulumi.Int(120),
// Threshold: pulumi.Float64(3),
// ThresholdOccurrences: pulumi.String("AT_LEAST_ONCE"),
// },
// Nrql: &newrelic.NrqlAlertConditionNrqlArgs{
// Query: pulumi.String("SELECT count(*) FROM TransactionError WHERE appName like '%Dummy App%' FACET appName"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// After making the appropriate adjustments mentioned in the deprecation warnings,
// the resource now looks like the following.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := newrelic.NewNrqlAlertCondition(ctx, "z", &newrelic.NrqlAlertConditionArgs{
// PolicyId: pulumi.Any(zNewrelicAlertPolicy.Id),
// Name: pulumi.String("zleslie-test"),
// Type: pulumi.String("static"),
// RunbookUrl: pulumi.String("https://localhost"),
// Enabled: pulumi.Bool(true),
// ViolationTimeLimitSeconds: pulumi.Int(86400),
// Terms: newrelic.NrqlAlertConditionTermArray{
// &newrelic.NrqlAlertConditionTermArgs{
// Priority: pulumi.String("critical"),
// Operator: pulumi.String("above"),
// Threshold: pulumi.Float64(3),
// Duration: pulumi.Int(5),
// TimeFunction: pulumi.String("any"),
// },
// },
// Nrql: &newrelic.NrqlAlertConditionNrqlArgs{
// Query: pulumi.String("SELECT count(*) FROM TransactionError WHERE appName like '%Dummy App%' FACET appName"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// NRQL alert conditions can be imported using a composite ID of `<policy_id>:<condition_id>:<conditionType>`, e.g.
//
// // For `baseline` conditions
//
// ```sh
// $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:baseline
// ```
//
// // For `static` conditions
//
// ```sh
// $ pulumi import newrelic:index/nrqlAlertCondition:NrqlAlertCondition foo 538291:6789035:static
// ```
type NrqlAlertCondition struct {
pulumi.CustomResourceState
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
AccountId pulumi.IntOutput `pulumi:"accountId"`
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
AggregationDelay pulumi.StringPtrOutput `pulumi:"aggregationDelay"`
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
AggregationMethod pulumi.StringPtrOutput `pulumi:"aggregationMethod"`
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
AggregationTimer pulumi.StringPtrOutput `pulumi:"aggregationTimer"`
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
AggregationWindow pulumi.IntOutput `pulumi:"aggregationWindow"`
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
BaselineDirection pulumi.StringPtrOutput `pulumi:"baselineDirection"`
// Whether to close all open incidents when the signal expires.
CloseViolationsOnExpiration pulumi.BoolPtrOutput `pulumi:"closeViolationsOnExpiration"`
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Critical NrqlAlertConditionCriticalPtrOutput `pulumi:"critical"`
// The description of the NRQL alert condition.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// The unique entity identifier of the NRQL Condition in New Relic.
EntityGuid pulumi.StringOutput `pulumi:"entityGuid"`
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
EvaluationDelay pulumi.IntPtrOutput `pulumi:"evaluationDelay"`
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
ExpirationDuration pulumi.IntPtrOutput `pulumi:"expirationDuration"`
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
FillOption pulumi.StringPtrOutput `pulumi:"fillOption"`
// This value will be used for filling gaps in the signal.
FillValue pulumi.Float64PtrOutput `pulumi:"fillValue"`
// The title of the condition.
Name pulumi.StringOutput `pulumi:"name"`
// A NRQL query. See NRQL below for details.
Nrql NrqlAlertConditionNrqlOutput `pulumi:"nrql"`
// Whether to create a new incident to capture that the signal expired.
OpenViolationOnExpiration pulumi.BoolPtrOutput `pulumi:"openViolationOnExpiration"`
// The ID of the policy where this condition should be used.
PolicyId pulumi.IntOutput `pulumi:"policyId"`
// Runbook URL to display in notifications.
RunbookUrl pulumi.StringPtrOutput `pulumi:"runbookUrl"`
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
SlideBy pulumi.IntPtrOutput `pulumi:"slideBy"`
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
Terms NrqlAlertConditionTermArrayOutput `pulumi:"terms"`
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
Type pulumi.StringPtrOutput `pulumi:"type"`
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
ViolationTimeLimit pulumi.StringOutput `pulumi:"violationTimeLimit"`
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
ViolationTimeLimitSeconds pulumi.IntPtrOutput `pulumi:"violationTimeLimitSeconds"`
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Warning NrqlAlertConditionWarningPtrOutput `pulumi:"warning"`
}
// NewNrqlAlertCondition registers a new resource with the given unique name, arguments, and options.
func NewNrqlAlertCondition(ctx *pulumi.Context,
name string, args *NrqlAlertConditionArgs, opts ...pulumi.ResourceOption) (*NrqlAlertCondition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Nrql == nil {
return nil, errors.New("invalid value for required argument 'Nrql'")
}
if args.PolicyId == nil {
return nil, errors.New("invalid value for required argument 'PolicyId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource NrqlAlertCondition
err := ctx.RegisterResource("newrelic:index/nrqlAlertCondition:NrqlAlertCondition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNrqlAlertCondition gets an existing NrqlAlertCondition 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 GetNrqlAlertCondition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NrqlAlertConditionState, opts ...pulumi.ResourceOption) (*NrqlAlertCondition, error) {
var resource NrqlAlertCondition
err := ctx.ReadResource("newrelic:index/nrqlAlertCondition:NrqlAlertCondition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NrqlAlertCondition resources.
type nrqlAlertConditionState struct {
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
AccountId *int `pulumi:"accountId"`
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
AggregationDelay *string `pulumi:"aggregationDelay"`
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
AggregationMethod *string `pulumi:"aggregationMethod"`
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
AggregationTimer *string `pulumi:"aggregationTimer"`
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
AggregationWindow *int `pulumi:"aggregationWindow"`
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
BaselineDirection *string `pulumi:"baselineDirection"`
// Whether to close all open incidents when the signal expires.
CloseViolationsOnExpiration *bool `pulumi:"closeViolationsOnExpiration"`
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Critical *NrqlAlertConditionCritical `pulumi:"critical"`
// The description of the NRQL alert condition.
Description *string `pulumi:"description"`
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// The unique entity identifier of the NRQL Condition in New Relic.
EntityGuid *string `pulumi:"entityGuid"`
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
EvaluationDelay *int `pulumi:"evaluationDelay"`
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
ExpirationDuration *int `pulumi:"expirationDuration"`
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
FillOption *string `pulumi:"fillOption"`
// This value will be used for filling gaps in the signal.
FillValue *float64 `pulumi:"fillValue"`
// The title of the condition.
Name *string `pulumi:"name"`
// A NRQL query. See NRQL below for details.
Nrql *NrqlAlertConditionNrql `pulumi:"nrql"`
// Whether to create a new incident to capture that the signal expired.
OpenViolationOnExpiration *bool `pulumi:"openViolationOnExpiration"`
// The ID of the policy where this condition should be used.
PolicyId *int `pulumi:"policyId"`
// Runbook URL to display in notifications.
RunbookUrl *string `pulumi:"runbookUrl"`
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
SlideBy *int `pulumi:"slideBy"`
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
Terms []NrqlAlertConditionTerm `pulumi:"terms"`
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
Type *string `pulumi:"type"`
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
ViolationTimeLimit *string `pulumi:"violationTimeLimit"`
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
ViolationTimeLimitSeconds *int `pulumi:"violationTimeLimitSeconds"`
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Warning *NrqlAlertConditionWarning `pulumi:"warning"`
}
type NrqlAlertConditionState struct {
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
AccountId pulumi.IntPtrInput
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
AggregationDelay pulumi.StringPtrInput
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
AggregationMethod pulumi.StringPtrInput
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
AggregationTimer pulumi.StringPtrInput
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
AggregationWindow pulumi.IntPtrInput
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
BaselineDirection pulumi.StringPtrInput
// Whether to close all open incidents when the signal expires.
CloseViolationsOnExpiration pulumi.BoolPtrInput
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Critical NrqlAlertConditionCriticalPtrInput
// The description of the NRQL alert condition.
Description pulumi.StringPtrInput
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
Enabled pulumi.BoolPtrInput
// The unique entity identifier of the NRQL Condition in New Relic.
EntityGuid pulumi.StringPtrInput
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
EvaluationDelay pulumi.IntPtrInput
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
ExpirationDuration pulumi.IntPtrInput
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
FillOption pulumi.StringPtrInput
// This value will be used for filling gaps in the signal.
FillValue pulumi.Float64PtrInput
// The title of the condition.
Name pulumi.StringPtrInput
// A NRQL query. See NRQL below for details.
Nrql NrqlAlertConditionNrqlPtrInput
// Whether to create a new incident to capture that the signal expired.
OpenViolationOnExpiration pulumi.BoolPtrInput
// The ID of the policy where this condition should be used.
PolicyId pulumi.IntPtrInput
// Runbook URL to display in notifications.
RunbookUrl pulumi.StringPtrInput
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
SlideBy pulumi.IntPtrInput
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
Terms NrqlAlertConditionTermArrayInput
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
Type pulumi.StringPtrInput
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
ViolationTimeLimit pulumi.StringPtrInput
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
ViolationTimeLimitSeconds pulumi.IntPtrInput
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Warning NrqlAlertConditionWarningPtrInput
}
func (NrqlAlertConditionState) ElementType() reflect.Type {
return reflect.TypeOf((*nrqlAlertConditionState)(nil)).Elem()
}
type nrqlAlertConditionArgs struct {
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
AccountId *int `pulumi:"accountId"`
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
AggregationDelay *string `pulumi:"aggregationDelay"`
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
AggregationMethod *string `pulumi:"aggregationMethod"`
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
AggregationTimer *string `pulumi:"aggregationTimer"`
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
AggregationWindow *int `pulumi:"aggregationWindow"`
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
BaselineDirection *string `pulumi:"baselineDirection"`
// Whether to close all open incidents when the signal expires.
CloseViolationsOnExpiration *bool `pulumi:"closeViolationsOnExpiration"`
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Critical *NrqlAlertConditionCritical `pulumi:"critical"`
// The description of the NRQL alert condition.
Description *string `pulumi:"description"`
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
Enabled *bool `pulumi:"enabled"`
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
EvaluationDelay *int `pulumi:"evaluationDelay"`
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
ExpirationDuration *int `pulumi:"expirationDuration"`
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
FillOption *string `pulumi:"fillOption"`
// This value will be used for filling gaps in the signal.
FillValue *float64 `pulumi:"fillValue"`
// The title of the condition.
Name *string `pulumi:"name"`
// A NRQL query. See NRQL below for details.
Nrql NrqlAlertConditionNrql `pulumi:"nrql"`
// Whether to create a new incident to capture that the signal expired.
OpenViolationOnExpiration *bool `pulumi:"openViolationOnExpiration"`
// The ID of the policy where this condition should be used.
PolicyId int `pulumi:"policyId"`
// Runbook URL to display in notifications.
RunbookUrl *string `pulumi:"runbookUrl"`
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
SlideBy *int `pulumi:"slideBy"`
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
Terms []NrqlAlertConditionTerm `pulumi:"terms"`
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
Type *string `pulumi:"type"`
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
ViolationTimeLimit *string `pulumi:"violationTimeLimit"`
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
ViolationTimeLimitSeconds *int `pulumi:"violationTimeLimitSeconds"`
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Warning *NrqlAlertConditionWarning `pulumi:"warning"`
}
// The set of arguments for constructing a NrqlAlertCondition resource.
type NrqlAlertConditionArgs struct {
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
AccountId pulumi.IntPtrInput
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
AggregationDelay pulumi.StringPtrInput
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
AggregationMethod pulumi.StringPtrInput
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
AggregationTimer pulumi.StringPtrInput
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
AggregationWindow pulumi.IntPtrInput
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
BaselineDirection pulumi.StringPtrInput
// Whether to close all open incidents when the signal expires.
CloseViolationsOnExpiration pulumi.BoolPtrInput
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Critical NrqlAlertConditionCriticalPtrInput
// The description of the NRQL alert condition.
Description pulumi.StringPtrInput
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
Enabled pulumi.BoolPtrInput
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
EvaluationDelay pulumi.IntPtrInput
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
ExpirationDuration pulumi.IntPtrInput
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
FillOption pulumi.StringPtrInput
// This value will be used for filling gaps in the signal.
FillValue pulumi.Float64PtrInput
// The title of the condition.
Name pulumi.StringPtrInput
// A NRQL query. See NRQL below for details.
Nrql NrqlAlertConditionNrqlInput
// Whether to create a new incident to capture that the signal expired.
OpenViolationOnExpiration pulumi.BoolPtrInput
// The ID of the policy where this condition should be used.
PolicyId pulumi.IntInput
// Runbook URL to display in notifications.
RunbookUrl pulumi.StringPtrInput
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
SlideBy pulumi.IntPtrInput
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
Terms NrqlAlertConditionTermArrayInput
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
Type pulumi.StringPtrInput
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
ViolationTimeLimit pulumi.StringPtrInput
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
ViolationTimeLimitSeconds pulumi.IntPtrInput
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
Warning NrqlAlertConditionWarningPtrInput
}
func (NrqlAlertConditionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*nrqlAlertConditionArgs)(nil)).Elem()
}
type NrqlAlertConditionInput interface {
pulumi.Input
ToNrqlAlertConditionOutput() NrqlAlertConditionOutput
ToNrqlAlertConditionOutputWithContext(ctx context.Context) NrqlAlertConditionOutput
}
func (*NrqlAlertCondition) ElementType() reflect.Type {
return reflect.TypeOf((**NrqlAlertCondition)(nil)).Elem()
}
func (i *NrqlAlertCondition) ToNrqlAlertConditionOutput() NrqlAlertConditionOutput {
return i.ToNrqlAlertConditionOutputWithContext(context.Background())
}
func (i *NrqlAlertCondition) ToNrqlAlertConditionOutputWithContext(ctx context.Context) NrqlAlertConditionOutput {
return pulumi.ToOutputWithContext(ctx, i).(NrqlAlertConditionOutput)
}
// NrqlAlertConditionArrayInput is an input type that accepts NrqlAlertConditionArray and NrqlAlertConditionArrayOutput values.
// You can construct a concrete instance of `NrqlAlertConditionArrayInput` via:
//
// NrqlAlertConditionArray{ NrqlAlertConditionArgs{...} }
type NrqlAlertConditionArrayInput interface {
pulumi.Input
ToNrqlAlertConditionArrayOutput() NrqlAlertConditionArrayOutput
ToNrqlAlertConditionArrayOutputWithContext(context.Context) NrqlAlertConditionArrayOutput
}
type NrqlAlertConditionArray []NrqlAlertConditionInput
func (NrqlAlertConditionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NrqlAlertCondition)(nil)).Elem()
}
func (i NrqlAlertConditionArray) ToNrqlAlertConditionArrayOutput() NrqlAlertConditionArrayOutput {
return i.ToNrqlAlertConditionArrayOutputWithContext(context.Background())
}
func (i NrqlAlertConditionArray) ToNrqlAlertConditionArrayOutputWithContext(ctx context.Context) NrqlAlertConditionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(NrqlAlertConditionArrayOutput)
}
// NrqlAlertConditionMapInput is an input type that accepts NrqlAlertConditionMap and NrqlAlertConditionMapOutput values.
// You can construct a concrete instance of `NrqlAlertConditionMapInput` via:
//
// NrqlAlertConditionMap{ "key": NrqlAlertConditionArgs{...} }
type NrqlAlertConditionMapInput interface {
pulumi.Input
ToNrqlAlertConditionMapOutput() NrqlAlertConditionMapOutput
ToNrqlAlertConditionMapOutputWithContext(context.Context) NrqlAlertConditionMapOutput
}
type NrqlAlertConditionMap map[string]NrqlAlertConditionInput
func (NrqlAlertConditionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NrqlAlertCondition)(nil)).Elem()
}
func (i NrqlAlertConditionMap) ToNrqlAlertConditionMapOutput() NrqlAlertConditionMapOutput {
return i.ToNrqlAlertConditionMapOutputWithContext(context.Background())
}
func (i NrqlAlertConditionMap) ToNrqlAlertConditionMapOutputWithContext(ctx context.Context) NrqlAlertConditionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(NrqlAlertConditionMapOutput)
}
type NrqlAlertConditionOutput struct{ *pulumi.OutputState }
func (NrqlAlertConditionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NrqlAlertCondition)(nil)).Elem()
}
func (o NrqlAlertConditionOutput) ToNrqlAlertConditionOutput() NrqlAlertConditionOutput {
return o
}
func (o NrqlAlertConditionOutput) ToNrqlAlertConditionOutputWithContext(ctx context.Context) NrqlAlertConditionOutput {
return o
}
// The New Relic account ID of the account you wish to create the condition. Defaults to the account ID set in your environment variable `NEW_RELIC_ACCOUNT_ID`.
func (o NrqlAlertConditionOutput) AccountId() pulumi.IntOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntOutput { return v.AccountId }).(pulumi.IntOutput)
}
// How long we wait for data that belongs in each aggregation window. Depending on your data, a longer delay may increase accuracy but delay notifications. Use `aggregationDelay` with the `eventFlow` and `cadence` methods. The maximum delay is 1200 seconds (20 minutes) when using `eventFlow` and 3600 seconds (60 minutes) when using `cadence`. In both cases, the minimum delay is 0 seconds and the default is 120 seconds. `aggregationDelay` cannot be set with `nrql.evaluation_offset`.
func (o NrqlAlertConditionOutput) AggregationDelay() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.AggregationDelay }).(pulumi.StringPtrOutput)
}
// Determines when we consider an aggregation window to be complete so that we can evaluate the signal for incidents. Possible values are `cadence`, `eventFlow` or `eventTimer`. Default is `eventFlow`. `aggregationMethod` cannot be set with `nrql.evaluation_offset`.
func (o NrqlAlertConditionOutput) AggregationMethod() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.AggregationMethod }).(pulumi.StringPtrOutput)
}
// How long we wait after each data point arrives to make sure we've processed the whole batch. Use `aggregationTimer` with the `eventTimer` method. The timer value can range from 0 seconds to 1200 seconds (20 minutes); the default is 60 seconds. `aggregationTimer` cannot be set with `nrql.evaluation_offset`.
func (o NrqlAlertConditionOutput) AggregationTimer() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.AggregationTimer }).(pulumi.StringPtrOutput)
}
// The duration of the time window used to evaluate the NRQL query, in seconds. The value must be at least 30 seconds, and no more than 21600 seconds (6 hours). Default is 60 seconds.
func (o NrqlAlertConditionOutput) AggregationWindow() pulumi.IntOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntOutput { return v.AggregationWindow }).(pulumi.IntOutput)
}
// The baseline direction of a _baseline_ NRQL alert condition. Valid values are: `lowerOnly`, `upperAndLower`, `upperOnly` (case insensitive).
func (o NrqlAlertConditionOutput) BaselineDirection() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.BaselineDirection }).(pulumi.StringPtrOutput)
}
// Whether to close all open incidents when the signal expires.
func (o NrqlAlertConditionOutput) CloseViolationsOnExpiration() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.BoolPtrOutput { return v.CloseViolationsOnExpiration }).(pulumi.BoolPtrOutput)
}
// A list containing the `critical` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
func (o NrqlAlertConditionOutput) Critical() NrqlAlertConditionCriticalPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) NrqlAlertConditionCriticalPtrOutput { return v.Critical }).(NrqlAlertConditionCriticalPtrOutput)
}
// The description of the NRQL alert condition.
func (o NrqlAlertConditionOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Whether to enable the alert condition. Valid values are `true` and `false`. Defaults to `true`.
func (o NrqlAlertConditionOutput) Enabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.BoolPtrOutput { return v.Enabled }).(pulumi.BoolPtrOutput)
}
// The unique entity identifier of the NRQL Condition in New Relic.
func (o NrqlAlertConditionOutput) EntityGuid() pulumi.StringOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringOutput { return v.EntityGuid }).(pulumi.StringOutput)
}
// How long we wait until the signal starts evaluating. The maximum delay is 7200 seconds (120 minutes).
func (o NrqlAlertConditionOutput) EvaluationDelay() pulumi.IntPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntPtrOutput { return v.EvaluationDelay }).(pulumi.IntPtrOutput)
}
// The amount of time (in seconds) to wait before considering the signal expired. The value must be at least 30 seconds, and no more than 172800 seconds (48 hours).
func (o NrqlAlertConditionOutput) ExpirationDuration() pulumi.IntPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntPtrOutput { return v.ExpirationDuration }).(pulumi.IntPtrOutput)
}
// Which strategy to use when filling gaps in the signal. Possible values are `none`, `lastValue` or `static`. If `static`, the `fillValue` field will be used for filling gaps in the signal.
func (o NrqlAlertConditionOutput) FillOption() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.FillOption }).(pulumi.StringPtrOutput)
}
// This value will be used for filling gaps in the signal.
func (o NrqlAlertConditionOutput) FillValue() pulumi.Float64PtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.Float64PtrOutput { return v.FillValue }).(pulumi.Float64PtrOutput)
}
// The title of the condition.
func (o NrqlAlertConditionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// A NRQL query. See NRQL below for details.
func (o NrqlAlertConditionOutput) Nrql() NrqlAlertConditionNrqlOutput {
return o.ApplyT(func(v *NrqlAlertCondition) NrqlAlertConditionNrqlOutput { return v.Nrql }).(NrqlAlertConditionNrqlOutput)
}
// Whether to create a new incident to capture that the signal expired.
func (o NrqlAlertConditionOutput) OpenViolationOnExpiration() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.BoolPtrOutput { return v.OpenViolationOnExpiration }).(pulumi.BoolPtrOutput)
}
// The ID of the policy where this condition should be used.
func (o NrqlAlertConditionOutput) PolicyId() pulumi.IntOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntOutput { return v.PolicyId }).(pulumi.IntOutput)
}
// Runbook URL to display in notifications.
func (o NrqlAlertConditionOutput) RunbookUrl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.RunbookUrl }).(pulumi.StringPtrOutput)
}
// Gathers data in overlapping time windows to smooth the chart line, making it easier to spot trends. The `slideBy` value is specified in seconds and must be smaller than and a factor of the `aggregationWindow`.
func (o NrqlAlertConditionOutput) SlideBy() pulumi.IntPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntPtrOutput { return v.SlideBy }).(pulumi.IntPtrOutput)
}
// **DEPRECATED** Use `critical`, and `warning` instead. A list of terms for this condition. See Terms below for details.
//
// Deprecated: use `critical` and `warning` attributes instead
func (o NrqlAlertConditionOutput) Terms() NrqlAlertConditionTermArrayOutput {
return o.ApplyT(func(v *NrqlAlertCondition) NrqlAlertConditionTermArrayOutput { return v.Terms }).(NrqlAlertConditionTermArrayOutput)
}
// The type of the condition. Valid values are `static` or `baseline`. Defaults to `static`.
func (o NrqlAlertConditionOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
}
// **DEPRECATED:** Use `violationTimeLimitSeconds` instead. Sets a time limit, in hours, that will automatically force-close a long-lasting incident after the time limit you select. Possible values are `ONE_HOUR`, `TWO_HOURS`, `FOUR_HOURS`, `EIGHT_HOURS`, `TWELVE_HOURS`, `TWENTY_FOUR_HOURS`, `THIRTY_DAYS` (case insensitive).<br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
//
// Deprecated: use `violationTimeLimitSeconds` attribute instead
func (o NrqlAlertConditionOutput) ViolationTimeLimit() pulumi.StringOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.StringOutput { return v.ViolationTimeLimit }).(pulumi.StringOutput)
}
// Sets a time limit, in seconds, that will automatically force-close a long-lasting incident after the time limit you select. The value must be between 300 seconds (5 minutes) to 2592000 seconds (30 days) (inclusive). <br>
// <small>\***Note**: One of `violationTimeLimit` _or_ `violationTimeLimitSeconds` must be set, but not both.</small>
func (o NrqlAlertConditionOutput) ViolationTimeLimitSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) pulumi.IntPtrOutput { return v.ViolationTimeLimitSeconds }).(pulumi.IntPtrOutput)
}
// A list containing the `warning` threshold values. At least one `critical` or `warning` threshold must be defined. See Terms below for details.
func (o NrqlAlertConditionOutput) Warning() NrqlAlertConditionWarningPtrOutput {
return o.ApplyT(func(v *NrqlAlertCondition) NrqlAlertConditionWarningPtrOutput { return v.Warning }).(NrqlAlertConditionWarningPtrOutput)
}
type NrqlAlertConditionArrayOutput struct{ *pulumi.OutputState }
func (NrqlAlertConditionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*NrqlAlertCondition)(nil)).Elem()
}
func (o NrqlAlertConditionArrayOutput) ToNrqlAlertConditionArrayOutput() NrqlAlertConditionArrayOutput {
return o
}
func (o NrqlAlertConditionArrayOutput) ToNrqlAlertConditionArrayOutputWithContext(ctx context.Context) NrqlAlertConditionArrayOutput {
return o
}
func (o NrqlAlertConditionArrayOutput) Index(i pulumi.IntInput) NrqlAlertConditionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NrqlAlertCondition {
return vs[0].([]*NrqlAlertCondition)[vs[1].(int)]
}).(NrqlAlertConditionOutput)
}
type NrqlAlertConditionMapOutput struct{ *pulumi.OutputState }
func (NrqlAlertConditionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*NrqlAlertCondition)(nil)).Elem()
}
func (o NrqlAlertConditionMapOutput) ToNrqlAlertConditionMapOutput() NrqlAlertConditionMapOutput {
return o
}
func (o NrqlAlertConditionMapOutput) ToNrqlAlertConditionMapOutputWithContext(ctx context.Context) NrqlAlertConditionMapOutput {
return o
}
func (o NrqlAlertConditionMapOutput) MapIndex(k pulumi.StringInput) NrqlAlertConditionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NrqlAlertCondition {
return vs[0].(map[string]*NrqlAlertCondition)[vs[1].(string)]
}).(NrqlAlertConditionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NrqlAlertConditionInput)(nil)).Elem(), &NrqlAlertCondition{})
pulumi.RegisterInputType(reflect.TypeOf((*NrqlAlertConditionArrayInput)(nil)).Elem(), NrqlAlertConditionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*NrqlAlertConditionMapInput)(nil)).Elem(), NrqlAlertConditionMap{})
pulumi.RegisterOutputType(NrqlAlertConditionOutput{})
pulumi.RegisterOutputType(NrqlAlertConditionArrayOutput{})
pulumi.RegisterOutputType(NrqlAlertConditionMapOutput{})
}