pulumi-newrelic 5.20.0a1709643785__py3-none-any.whl → 5.39.0a1736834464__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pulumi_newrelic/__init__.py +9 -0
- pulumi_newrelic/_inputs.py +7153 -461
- pulumi_newrelic/_utilities.py +41 -5
- pulumi_newrelic/account_management.py +13 -4
- pulumi_newrelic/alert_channel.py +122 -101
- pulumi_newrelic/alert_condition.py +120 -109
- pulumi_newrelic/alert_muting_rule.py +130 -74
- pulumi_newrelic/alert_policy.py +88 -67
- pulumi_newrelic/alert_policy_channel.py +81 -68
- pulumi_newrelic/api_access_key.py +49 -52
- pulumi_newrelic/browser_application.py +79 -76
- pulumi_newrelic/cloud/_inputs.py +2527 -1082
- pulumi_newrelic/cloud/aws_govcloud_integrations.py +135 -130
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +25 -18
- pulumi_newrelic/cloud/aws_integrations.py +300 -1324
- pulumi_newrelic/cloud/aws_link_account.py +25 -18
- pulumi_newrelic/cloud/azure_integrations.py +523 -481
- pulumi_newrelic/cloud/azure_link_account.py +36 -29
- pulumi_newrelic/cloud/gcp_integrations.py +343 -320
- pulumi_newrelic/cloud/gcp_link_account.py +25 -18
- pulumi_newrelic/cloud/outputs.py +327 -1072
- pulumi_newrelic/config/__init__.pyi +6 -1
- pulumi_newrelic/config/vars.py +7 -2
- pulumi_newrelic/data_partition_rule.py +23 -16
- pulumi_newrelic/entity_tags.py +36 -31
- pulumi_newrelic/events_to_metrics_rule.py +27 -20
- pulumi_newrelic/get_account.py +24 -12
- pulumi_newrelic/get_alert_channel.py +26 -13
- pulumi_newrelic/get_alert_policy.py +35 -12
- pulumi_newrelic/get_application.py +39 -27
- pulumi_newrelic/get_authentication_domain.py +17 -9
- pulumi_newrelic/get_cloud_account.py +26 -14
- pulumi_newrelic/get_entity.py +90 -85
- pulumi_newrelic/get_group.py +58 -9
- pulumi_newrelic/get_key_transaction.py +109 -30
- pulumi_newrelic/get_notification_destination.py +64 -14
- pulumi_newrelic/get_obfuscation_expression.py +36 -24
- pulumi_newrelic/get_service_level_alert_helper.py +135 -105
- pulumi_newrelic/get_test_grok_pattern.py +29 -14
- pulumi_newrelic/get_user.py +17 -5
- pulumi_newrelic/group.py +5 -132
- pulumi_newrelic/infra_alert_condition.py +157 -140
- pulumi_newrelic/insights/_inputs.py +43 -0
- pulumi_newrelic/insights/event.py +50 -43
- pulumi_newrelic/insights/outputs.py +5 -0
- pulumi_newrelic/key_transaction.py +464 -0
- pulumi_newrelic/log_parsing_rule.py +29 -18
- pulumi_newrelic/monitor_downtime.py +215 -203
- pulumi_newrelic/notification_channel.py +387 -326
- pulumi_newrelic/notification_destination.py +248 -118
- pulumi_newrelic/nrql_alert_condition.py +353 -246
- pulumi_newrelic/nrql_drop_rule.py +57 -30
- pulumi_newrelic/obfuscation_expression.py +25 -18
- pulumi_newrelic/obfuscation_rule.py +40 -31
- pulumi_newrelic/one_dashboard.py +31 -26
- pulumi_newrelic/one_dashboard_json.py +21 -16
- pulumi_newrelic/one_dashboard_raw.py +112 -101
- pulumi_newrelic/outputs.py +2446 -245
- pulumi_newrelic/plugins/_inputs.py +145 -10
- pulumi_newrelic/plugins/application_settings.py +29 -20
- pulumi_newrelic/plugins/outputs.py +15 -10
- pulumi_newrelic/plugins/workload.py +285 -54
- pulumi_newrelic/provider.py +27 -33
- pulumi_newrelic/pulumi-plugin.json +2 -1
- pulumi_newrelic/service_level.py +193 -180
- pulumi_newrelic/synthetics/_inputs.py +159 -2
- pulumi_newrelic/synthetics/alert_condition.py +91 -78
- pulumi_newrelic/synthetics/broken_links_monitor.py +220 -93
- pulumi_newrelic/synthetics/cert_check_monitor.py +223 -94
- pulumi_newrelic/synthetics/get_private_location.py +34 -22
- pulumi_newrelic/synthetics/get_secure_credential.py +24 -12
- pulumi_newrelic/synthetics/monitor.py +352 -179
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +109 -96
- pulumi_newrelic/synthetics/outputs.py +7 -2
- pulumi_newrelic/synthetics/private_location.py +27 -18
- pulumi_newrelic/synthetics/script_monitor.py +321 -168
- pulumi_newrelic/synthetics/secure_credential.py +25 -20
- pulumi_newrelic/synthetics/step_monitor.py +409 -98
- pulumi_newrelic/user.py +13 -6
- pulumi_newrelic/workflow.py +215 -184
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/METADATA +7 -6
- pulumi_newrelic-5.39.0a1736834464.dist-info/RECORD +90 -0
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
- pulumi_newrelic-5.20.0a1709643785.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/top_level.txt +0 -0
@@ -4,9 +4,14 @@
|
|
4
4
|
|
5
5
|
import copy
|
6
6
|
import warnings
|
7
|
+
import sys
|
7
8
|
import pulumi
|
8
9
|
import pulumi.runtime
|
9
10
|
from typing import Any, Mapping, Optional, Sequence, Union, overload
|
11
|
+
if sys.version_info >= (3, 11):
|
12
|
+
from typing import NotRequired, TypedDict, TypeAlias
|
13
|
+
else:
|
14
|
+
from typing_extensions import NotRequired, TypedDict, TypeAlias
|
10
15
|
from . import _utilities
|
11
16
|
from . import outputs
|
12
17
|
from ._inputs import *
|
@@ -16,7 +21,7 @@ __all__ = ['InfraAlertConditionArgs', 'InfraAlertCondition']
|
|
16
21
|
@pulumi.input_type
|
17
22
|
class InfraAlertConditionArgs:
|
18
23
|
def __init__(__self__, *,
|
19
|
-
policy_id: pulumi.Input[
|
24
|
+
policy_id: pulumi.Input[str],
|
20
25
|
type: pulumi.Input[str],
|
21
26
|
comparison: Optional[pulumi.Input[str]] = None,
|
22
27
|
critical: Optional[pulumi.Input['InfraAlertConditionCriticalArgs']] = None,
|
@@ -33,7 +38,7 @@ class InfraAlertConditionArgs:
|
|
33
38
|
where: Optional[pulumi.Input[str]] = None):
|
34
39
|
"""
|
35
40
|
The set of arguments for constructing a InfraAlertCondition resource.
|
36
|
-
:param pulumi.Input[
|
41
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
37
42
|
:param pulumi.Input[str] type: The type of Infrastructure alert condition. Valid values are `infra_process_running`, `infra_metric`, and `infra_host_not_reporting`.
|
38
43
|
:param pulumi.Input[str] comparison: The operator used to evaluate the threshold value. Valid values are `above`, `below`, and `equal`. Supported by the `infra_metric` and `infra_process_running` condition types.
|
39
44
|
:param pulumi.Input['InfraAlertConditionCriticalArgs'] critical: Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.
|
@@ -47,8 +52,8 @@ class InfraAlertConditionArgs:
|
|
47
52
|
:param pulumi.Input[str] select: The attribute name to identify the metric being targeted; for example, `cpuPercent`, `diskFreePercent`, or `memoryResidentSizeBytes`. The underlying API will automatically populate this value for Infrastructure integrations (for example `diskFreePercent`), so make sure to explicitly include this value to avoid diff issues. Supported by the `infra_metric` condition type.
|
48
53
|
:param pulumi.Input[int] violation_close_timer: Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
49
54
|
|
50
|
-
```
|
51
|
-
|
55
|
+
```
|
56
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
52
57
|
```
|
53
58
|
:param pulumi.Input['InfraAlertConditionWarningArgs'] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
54
59
|
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
@@ -84,14 +89,14 @@ class InfraAlertConditionArgs:
|
|
84
89
|
|
85
90
|
@property
|
86
91
|
@pulumi.getter(name="policyId")
|
87
|
-
def policy_id(self) -> pulumi.Input[
|
92
|
+
def policy_id(self) -> pulumi.Input[str]:
|
88
93
|
"""
|
89
94
|
The ID of the alert policy where this condition should be used.
|
90
95
|
"""
|
91
96
|
return pulumi.get(self, "policy_id")
|
92
97
|
|
93
98
|
@policy_id.setter
|
94
|
-
def policy_id(self, value: pulumi.Input[
|
99
|
+
def policy_id(self, value: pulumi.Input[str]):
|
95
100
|
pulumi.set(self, "policy_id", value)
|
96
101
|
|
97
102
|
@property
|
@@ -232,8 +237,8 @@ class InfraAlertConditionArgs:
|
|
232
237
|
"""
|
233
238
|
Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
234
239
|
|
235
|
-
```
|
236
|
-
|
240
|
+
```
|
241
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
237
242
|
```
|
238
243
|
"""
|
239
244
|
return pulumi.get(self, "violation_close_timer")
|
@@ -279,7 +284,7 @@ class _InfraAlertConditionState:
|
|
279
284
|
event: Optional[pulumi.Input[str]] = None,
|
280
285
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
281
286
|
name: Optional[pulumi.Input[str]] = None,
|
282
|
-
policy_id: Optional[pulumi.Input[
|
287
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
283
288
|
process_where: Optional[pulumi.Input[str]] = None,
|
284
289
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
285
290
|
select: Optional[pulumi.Input[str]] = None,
|
@@ -299,7 +304,7 @@ class _InfraAlertConditionState:
|
|
299
304
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
300
305
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
301
306
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
302
|
-
:param pulumi.Input[
|
307
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
303
308
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
304
309
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
305
310
|
:param pulumi.Input[str] select: The attribute name to identify the metric being targeted; for example, `cpuPercent`, `diskFreePercent`, or `memoryResidentSizeBytes`. The underlying API will automatically populate this value for Infrastructure integrations (for example `diskFreePercent`), so make sure to explicitly include this value to avoid diff issues. Supported by the `infra_metric` condition type.
|
@@ -307,8 +312,8 @@ class _InfraAlertConditionState:
|
|
307
312
|
:param pulumi.Input[int] updated_at: The timestamp the alert condition was last updated.
|
308
313
|
:param pulumi.Input[int] violation_close_timer: Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
309
314
|
|
310
|
-
```
|
311
|
-
|
315
|
+
```
|
316
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
312
317
|
```
|
313
318
|
:param pulumi.Input['InfraAlertConditionWarningArgs'] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
314
319
|
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
@@ -460,14 +465,14 @@ class _InfraAlertConditionState:
|
|
460
465
|
|
461
466
|
@property
|
462
467
|
@pulumi.getter(name="policyId")
|
463
|
-
def policy_id(self) -> Optional[pulumi.Input[
|
468
|
+
def policy_id(self) -> Optional[pulumi.Input[str]]:
|
464
469
|
"""
|
465
470
|
The ID of the alert policy where this condition should be used.
|
466
471
|
"""
|
467
472
|
return pulumi.get(self, "policy_id")
|
468
473
|
|
469
474
|
@policy_id.setter
|
470
|
-
def policy_id(self, value: Optional[pulumi.Input[
|
475
|
+
def policy_id(self, value: Optional[pulumi.Input[str]]):
|
471
476
|
pulumi.set(self, "policy_id", value)
|
472
477
|
|
473
478
|
@property
|
@@ -536,8 +541,8 @@ class _InfraAlertConditionState:
|
|
536
541
|
"""
|
537
542
|
Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
538
543
|
|
539
|
-
```
|
540
|
-
|
544
|
+
```
|
545
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
541
546
|
```
|
542
547
|
"""
|
543
548
|
return pulumi.get(self, "violation_close_timer")
|
@@ -577,25 +582,25 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
577
582
|
resource_name: str,
|
578
583
|
opts: Optional[pulumi.ResourceOptions] = None,
|
579
584
|
comparison: Optional[pulumi.Input[str]] = None,
|
580
|
-
critical: Optional[pulumi.Input[
|
585
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
581
586
|
description: Optional[pulumi.Input[str]] = None,
|
582
587
|
enabled: Optional[pulumi.Input[bool]] = None,
|
583
588
|
event: Optional[pulumi.Input[str]] = None,
|
584
589
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
585
590
|
name: Optional[pulumi.Input[str]] = None,
|
586
|
-
policy_id: Optional[pulumi.Input[
|
591
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
587
592
|
process_where: Optional[pulumi.Input[str]] = None,
|
588
593
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
589
594
|
select: Optional[pulumi.Input[str]] = None,
|
590
595
|
type: Optional[pulumi.Input[str]] = None,
|
591
596
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
592
|
-
warning: Optional[pulumi.Input[
|
597
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
593
598
|
where: Optional[pulumi.Input[str]] = None,
|
594
599
|
__props__=None):
|
595
600
|
"""
|
596
601
|
Use this resource to create and manage Infrastructure alert conditions in New Relic.
|
597
602
|
|
598
|
-
> **WARNING:** The `InfraAlertCondition` resource is deprecated and will be removed in the next major release. The resource NrqlAlertCondition would be a preferred alternative to configure alert conditions - in most cases, feature parity can be achieved with a NRQL query.
|
603
|
+
> **WARNING:** The `InfraAlertCondition` resource is deprecated and will be removed in the next major release. The resource NrqlAlertCondition would be a preferred alternative to configure alert conditions - in most cases, feature parity can be achieved with a NRQL query. For more details and examples on moving away from infra alert conditions to the NRQL based alternative, please check out these examples.
|
599
604
|
|
600
605
|
## Example Usage
|
601
606
|
|
@@ -603,27 +608,29 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
603
608
|
import pulumi
|
604
609
|
import pulumi_newrelic as newrelic
|
605
610
|
|
606
|
-
foo = newrelic.AlertPolicy("foo")
|
607
|
-
high_disk_usage = newrelic.InfraAlertCondition("
|
611
|
+
foo = newrelic.AlertPolicy("foo", name="foo")
|
612
|
+
high_disk_usage = newrelic.InfraAlertCondition("high_disk_usage",
|
608
613
|
policy_id=foo.id,
|
614
|
+
name="High disk usage",
|
609
615
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
610
616
|
type="infra_metric",
|
611
617
|
event="StorageSample",
|
612
618
|
select="diskUsedPercent",
|
613
619
|
comparison="above",
|
614
620
|
where="(hostname LIKE '%frontend%')",
|
615
|
-
critical=
|
616
|
-
duration
|
617
|
-
value
|
618
|
-
time_function
|
619
|
-
|
620
|
-
warning=
|
621
|
-
duration
|
622
|
-
value
|
623
|
-
time_function
|
624
|
-
)
|
625
|
-
high_db_conn_count = newrelic.InfraAlertCondition("
|
621
|
+
critical={
|
622
|
+
"duration": 25,
|
623
|
+
"value": 90,
|
624
|
+
"time_function": "all",
|
625
|
+
},
|
626
|
+
warning={
|
627
|
+
"duration": 10,
|
628
|
+
"value": 80,
|
629
|
+
"time_function": "all",
|
630
|
+
})
|
631
|
+
high_db_conn_count = newrelic.InfraAlertCondition("high_db_conn_count",
|
626
632
|
policy_id=foo.id,
|
633
|
+
name="High database connection count",
|
627
634
|
description="Critical alert when the number of database connections goes above 90",
|
628
635
|
type="infra_metric",
|
629
636
|
event="DatastoreSample",
|
@@ -631,31 +638,34 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
631
638
|
comparison="above",
|
632
639
|
where="(hostname LIKE '%db%')",
|
633
640
|
integration_provider="RdsDbInstance",
|
634
|
-
critical=
|
635
|
-
duration
|
636
|
-
value
|
637
|
-
time_function
|
638
|
-
)
|
639
|
-
process_not_running = newrelic.InfraAlertCondition("
|
641
|
+
critical={
|
642
|
+
"duration": 25,
|
643
|
+
"value": 90,
|
644
|
+
"time_function": "all",
|
645
|
+
})
|
646
|
+
process_not_running = newrelic.InfraAlertCondition("process_not_running",
|
640
647
|
policy_id=foo.id,
|
648
|
+
name="Process not running (/usr/bin/ruby)",
|
641
649
|
description="Critical alert when ruby isn't running",
|
642
650
|
type="infra_process_running",
|
643
651
|
comparison="equal",
|
644
652
|
where="hostname = 'web01'",
|
645
653
|
process_where="commandName = '/usr/bin/ruby'",
|
646
|
-
critical=
|
647
|
-
duration
|
648
|
-
value
|
649
|
-
)
|
650
|
-
host_not_reporting = newrelic.InfraAlertCondition("
|
654
|
+
critical={
|
655
|
+
"duration": 5,
|
656
|
+
"value": 0,
|
657
|
+
})
|
658
|
+
host_not_reporting = newrelic.InfraAlertCondition("host_not_reporting",
|
651
659
|
policy_id=foo.id,
|
660
|
+
name="Host not reporting",
|
652
661
|
description="Critical alert when the host is not reporting",
|
653
662
|
type="infra_host_not_reporting",
|
654
663
|
where="(hostname LIKE '%frontend%')",
|
655
|
-
critical=
|
656
|
-
duration
|
657
|
-
)
|
664
|
+
critical={
|
665
|
+
"duration": 5,
|
666
|
+
})
|
658
667
|
```
|
668
|
+
|
659
669
|
## Thresholds
|
660
670
|
|
661
671
|
The `critical` and `warning` threshold mapping supports the following arguments:
|
@@ -672,39 +682,40 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
672
682
|
import pulumi
|
673
683
|
import pulumi_newrelic as newrelic
|
674
684
|
|
675
|
-
|
676
|
-
foo_infra_alert_condition = newrelic.InfraAlertCondition("
|
677
|
-
policy_id=
|
685
|
+
foo = newrelic.AlertPolicy("foo", name="foo policy")
|
686
|
+
foo_infra_alert_condition = newrelic.InfraAlertCondition("foo",
|
687
|
+
policy_id=foo.id,
|
688
|
+
name="foo infra condition",
|
678
689
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
679
690
|
type="infra_metric",
|
680
691
|
event="StorageSample",
|
681
692
|
select="diskUsedPercent",
|
682
693
|
comparison="above",
|
683
694
|
where="(hostname LIKE '%frontend%')",
|
684
|
-
critical=
|
685
|
-
duration
|
686
|
-
value
|
687
|
-
time_function
|
688
|
-
|
689
|
-
warning=
|
690
|
-
duration
|
691
|
-
value
|
692
|
-
time_function
|
693
|
-
)
|
694
|
-
my_condition_entity_tags = newrelic.EntityTags("
|
695
|
+
critical={
|
696
|
+
"duration": 25,
|
697
|
+
"value": 90,
|
698
|
+
"time_function": "all",
|
699
|
+
},
|
700
|
+
warning={
|
701
|
+
"duration": 10,
|
702
|
+
"value": 80,
|
703
|
+
"time_function": "all",
|
704
|
+
})
|
705
|
+
my_condition_entity_tags = newrelic.EntityTags("my_condition_entity_tags",
|
695
706
|
guid=foo_infra_alert_condition.entity_guid,
|
696
707
|
tags=[
|
697
|
-
|
698
|
-
key
|
699
|
-
values
|
708
|
+
{
|
709
|
+
"key": "my-key",
|
710
|
+
"values": [
|
700
711
|
"my-value",
|
701
712
|
"my-other-value",
|
702
713
|
],
|
703
|
-
|
704
|
-
|
705
|
-
key
|
706
|
-
values
|
707
|
-
|
714
|
+
},
|
715
|
+
{
|
716
|
+
"key": "my-key-2",
|
717
|
+
"values": ["my-value-2"],
|
718
|
+
},
|
708
719
|
])
|
709
720
|
```
|
710
721
|
|
@@ -713,29 +724,29 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
713
724
|
Infrastructure alert conditions can be imported using a composite ID of `<policy_id>:<condition_id>`, e.g.
|
714
725
|
|
715
726
|
```sh
|
716
|
-
|
727
|
+
$ pulumi import newrelic:index/infraAlertCondition:InfraAlertCondition main 12345:67890
|
717
728
|
```
|
718
729
|
|
719
730
|
:param str resource_name: The name of the resource.
|
720
731
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
721
732
|
:param pulumi.Input[str] comparison: The operator used to evaluate the threshold value. Valid values are `above`, `below`, and `equal`. Supported by the `infra_metric` and `infra_process_running` condition types.
|
722
|
-
:param pulumi.Input[
|
733
|
+
:param pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']] critical: Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.
|
723
734
|
:param pulumi.Input[str] description: The description of the Infrastructure alert condition.
|
724
735
|
:param pulumi.Input[bool] enabled: Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`.
|
725
736
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
726
737
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
727
738
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
728
|
-
:param pulumi.Input[
|
739
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
729
740
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
730
741
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
731
742
|
:param pulumi.Input[str] select: The attribute name to identify the metric being targeted; for example, `cpuPercent`, `diskFreePercent`, or `memoryResidentSizeBytes`. The underlying API will automatically populate this value for Infrastructure integrations (for example `diskFreePercent`), so make sure to explicitly include this value to avoid diff issues. Supported by the `infra_metric` condition type.
|
732
743
|
:param pulumi.Input[str] type: The type of Infrastructure alert condition. Valid values are `infra_process_running`, `infra_metric`, and `infra_host_not_reporting`.
|
733
744
|
:param pulumi.Input[int] violation_close_timer: Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
734
745
|
|
735
|
-
```python
|
736
|
-
import pulumi
|
737
746
|
```
|
738
|
-
|
747
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
748
|
+
```
|
749
|
+
:param pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
739
750
|
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
740
751
|
"""
|
741
752
|
...
|
@@ -747,7 +758,7 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
747
758
|
"""
|
748
759
|
Use this resource to create and manage Infrastructure alert conditions in New Relic.
|
749
760
|
|
750
|
-
> **WARNING:** The `InfraAlertCondition` resource is deprecated and will be removed in the next major release. The resource NrqlAlertCondition would be a preferred alternative to configure alert conditions - in most cases, feature parity can be achieved with a NRQL query.
|
761
|
+
> **WARNING:** The `InfraAlertCondition` resource is deprecated and will be removed in the next major release. The resource NrqlAlertCondition would be a preferred alternative to configure alert conditions - in most cases, feature parity can be achieved with a NRQL query. For more details and examples on moving away from infra alert conditions to the NRQL based alternative, please check out these examples.
|
751
762
|
|
752
763
|
## Example Usage
|
753
764
|
|
@@ -755,27 +766,29 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
755
766
|
import pulumi
|
756
767
|
import pulumi_newrelic as newrelic
|
757
768
|
|
758
|
-
foo = newrelic.AlertPolicy("foo")
|
759
|
-
high_disk_usage = newrelic.InfraAlertCondition("
|
769
|
+
foo = newrelic.AlertPolicy("foo", name="foo")
|
770
|
+
high_disk_usage = newrelic.InfraAlertCondition("high_disk_usage",
|
760
771
|
policy_id=foo.id,
|
772
|
+
name="High disk usage",
|
761
773
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
762
774
|
type="infra_metric",
|
763
775
|
event="StorageSample",
|
764
776
|
select="diskUsedPercent",
|
765
777
|
comparison="above",
|
766
778
|
where="(hostname LIKE '%frontend%')",
|
767
|
-
critical=
|
768
|
-
duration
|
769
|
-
value
|
770
|
-
time_function
|
771
|
-
|
772
|
-
warning=
|
773
|
-
duration
|
774
|
-
value
|
775
|
-
time_function
|
776
|
-
)
|
777
|
-
high_db_conn_count = newrelic.InfraAlertCondition("
|
779
|
+
critical={
|
780
|
+
"duration": 25,
|
781
|
+
"value": 90,
|
782
|
+
"time_function": "all",
|
783
|
+
},
|
784
|
+
warning={
|
785
|
+
"duration": 10,
|
786
|
+
"value": 80,
|
787
|
+
"time_function": "all",
|
788
|
+
})
|
789
|
+
high_db_conn_count = newrelic.InfraAlertCondition("high_db_conn_count",
|
778
790
|
policy_id=foo.id,
|
791
|
+
name="High database connection count",
|
779
792
|
description="Critical alert when the number of database connections goes above 90",
|
780
793
|
type="infra_metric",
|
781
794
|
event="DatastoreSample",
|
@@ -783,31 +796,34 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
783
796
|
comparison="above",
|
784
797
|
where="(hostname LIKE '%db%')",
|
785
798
|
integration_provider="RdsDbInstance",
|
786
|
-
critical=
|
787
|
-
duration
|
788
|
-
value
|
789
|
-
time_function
|
790
|
-
)
|
791
|
-
process_not_running = newrelic.InfraAlertCondition("
|
799
|
+
critical={
|
800
|
+
"duration": 25,
|
801
|
+
"value": 90,
|
802
|
+
"time_function": "all",
|
803
|
+
})
|
804
|
+
process_not_running = newrelic.InfraAlertCondition("process_not_running",
|
792
805
|
policy_id=foo.id,
|
806
|
+
name="Process not running (/usr/bin/ruby)",
|
793
807
|
description="Critical alert when ruby isn't running",
|
794
808
|
type="infra_process_running",
|
795
809
|
comparison="equal",
|
796
810
|
where="hostname = 'web01'",
|
797
811
|
process_where="commandName = '/usr/bin/ruby'",
|
798
|
-
critical=
|
799
|
-
duration
|
800
|
-
value
|
801
|
-
)
|
802
|
-
host_not_reporting = newrelic.InfraAlertCondition("
|
812
|
+
critical={
|
813
|
+
"duration": 5,
|
814
|
+
"value": 0,
|
815
|
+
})
|
816
|
+
host_not_reporting = newrelic.InfraAlertCondition("host_not_reporting",
|
803
817
|
policy_id=foo.id,
|
818
|
+
name="Host not reporting",
|
804
819
|
description="Critical alert when the host is not reporting",
|
805
820
|
type="infra_host_not_reporting",
|
806
821
|
where="(hostname LIKE '%frontend%')",
|
807
|
-
critical=
|
808
|
-
duration
|
809
|
-
)
|
822
|
+
critical={
|
823
|
+
"duration": 5,
|
824
|
+
})
|
810
825
|
```
|
826
|
+
|
811
827
|
## Thresholds
|
812
828
|
|
813
829
|
The `critical` and `warning` threshold mapping supports the following arguments:
|
@@ -824,39 +840,40 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
824
840
|
import pulumi
|
825
841
|
import pulumi_newrelic as newrelic
|
826
842
|
|
827
|
-
|
828
|
-
foo_infra_alert_condition = newrelic.InfraAlertCondition("
|
829
|
-
policy_id=
|
843
|
+
foo = newrelic.AlertPolicy("foo", name="foo policy")
|
844
|
+
foo_infra_alert_condition = newrelic.InfraAlertCondition("foo",
|
845
|
+
policy_id=foo.id,
|
846
|
+
name="foo infra condition",
|
830
847
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
831
848
|
type="infra_metric",
|
832
849
|
event="StorageSample",
|
833
850
|
select="diskUsedPercent",
|
834
851
|
comparison="above",
|
835
852
|
where="(hostname LIKE '%frontend%')",
|
836
|
-
critical=
|
837
|
-
duration
|
838
|
-
value
|
839
|
-
time_function
|
840
|
-
|
841
|
-
warning=
|
842
|
-
duration
|
843
|
-
value
|
844
|
-
time_function
|
845
|
-
)
|
846
|
-
my_condition_entity_tags = newrelic.EntityTags("
|
853
|
+
critical={
|
854
|
+
"duration": 25,
|
855
|
+
"value": 90,
|
856
|
+
"time_function": "all",
|
857
|
+
},
|
858
|
+
warning={
|
859
|
+
"duration": 10,
|
860
|
+
"value": 80,
|
861
|
+
"time_function": "all",
|
862
|
+
})
|
863
|
+
my_condition_entity_tags = newrelic.EntityTags("my_condition_entity_tags",
|
847
864
|
guid=foo_infra_alert_condition.entity_guid,
|
848
865
|
tags=[
|
849
|
-
|
850
|
-
key
|
851
|
-
values
|
866
|
+
{
|
867
|
+
"key": "my-key",
|
868
|
+
"values": [
|
852
869
|
"my-value",
|
853
870
|
"my-other-value",
|
854
871
|
],
|
855
|
-
|
856
|
-
|
857
|
-
key
|
858
|
-
values
|
859
|
-
|
872
|
+
},
|
873
|
+
{
|
874
|
+
"key": "my-key-2",
|
875
|
+
"values": ["my-value-2"],
|
876
|
+
},
|
860
877
|
])
|
861
878
|
```
|
862
879
|
|
@@ -865,7 +882,7 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
865
882
|
Infrastructure alert conditions can be imported using a composite ID of `<policy_id>:<condition_id>`, e.g.
|
866
883
|
|
867
884
|
```sh
|
868
|
-
|
885
|
+
$ pulumi import newrelic:index/infraAlertCondition:InfraAlertCondition main 12345:67890
|
869
886
|
```
|
870
887
|
|
871
888
|
:param str resource_name: The name of the resource.
|
@@ -884,19 +901,19 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
884
901
|
resource_name: str,
|
885
902
|
opts: Optional[pulumi.ResourceOptions] = None,
|
886
903
|
comparison: Optional[pulumi.Input[str]] = None,
|
887
|
-
critical: Optional[pulumi.Input[
|
904
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
888
905
|
description: Optional[pulumi.Input[str]] = None,
|
889
906
|
enabled: Optional[pulumi.Input[bool]] = None,
|
890
907
|
event: Optional[pulumi.Input[str]] = None,
|
891
908
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
892
909
|
name: Optional[pulumi.Input[str]] = None,
|
893
|
-
policy_id: Optional[pulumi.Input[
|
910
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
894
911
|
process_where: Optional[pulumi.Input[str]] = None,
|
895
912
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
896
913
|
select: Optional[pulumi.Input[str]] = None,
|
897
914
|
type: Optional[pulumi.Input[str]] = None,
|
898
915
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
899
|
-
warning: Optional[pulumi.Input[
|
916
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
900
917
|
where: Optional[pulumi.Input[str]] = None,
|
901
918
|
__props__=None):
|
902
919
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
@@ -941,21 +958,21 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
941
958
|
opts: Optional[pulumi.ResourceOptions] = None,
|
942
959
|
comparison: Optional[pulumi.Input[str]] = None,
|
943
960
|
created_at: Optional[pulumi.Input[int]] = None,
|
944
|
-
critical: Optional[pulumi.Input[
|
961
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
945
962
|
description: Optional[pulumi.Input[str]] = None,
|
946
963
|
enabled: Optional[pulumi.Input[bool]] = None,
|
947
964
|
entity_guid: Optional[pulumi.Input[str]] = None,
|
948
965
|
event: Optional[pulumi.Input[str]] = None,
|
949
966
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
950
967
|
name: Optional[pulumi.Input[str]] = None,
|
951
|
-
policy_id: Optional[pulumi.Input[
|
968
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
952
969
|
process_where: Optional[pulumi.Input[str]] = None,
|
953
970
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
954
971
|
select: Optional[pulumi.Input[str]] = None,
|
955
972
|
type: Optional[pulumi.Input[str]] = None,
|
956
973
|
updated_at: Optional[pulumi.Input[int]] = None,
|
957
974
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
958
|
-
warning: Optional[pulumi.Input[
|
975
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
959
976
|
where: Optional[pulumi.Input[str]] = None) -> 'InfraAlertCondition':
|
960
977
|
"""
|
961
978
|
Get an existing InfraAlertCondition resource's state with the given name, id, and optional extra
|
@@ -966,14 +983,14 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
966
983
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
967
984
|
:param pulumi.Input[str] comparison: The operator used to evaluate the threshold value. Valid values are `above`, `below`, and `equal`. Supported by the `infra_metric` and `infra_process_running` condition types.
|
968
985
|
:param pulumi.Input[int] created_at: The timestamp the alert condition was created.
|
969
|
-
:param pulumi.Input[
|
986
|
+
:param pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']] critical: Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.
|
970
987
|
:param pulumi.Input[str] description: The description of the Infrastructure alert condition.
|
971
988
|
:param pulumi.Input[bool] enabled: Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`.
|
972
989
|
:param pulumi.Input[str] entity_guid: The unique entity identifier of the condition in New Relic.
|
973
990
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
974
991
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
975
992
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
976
|
-
:param pulumi.Input[
|
993
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
977
994
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
978
995
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
979
996
|
:param pulumi.Input[str] select: The attribute name to identify the metric being targeted; for example, `cpuPercent`, `diskFreePercent`, or `memoryResidentSizeBytes`. The underlying API will automatically populate this value for Infrastructure integrations (for example `diskFreePercent`), so make sure to explicitly include this value to avoid diff issues. Supported by the `infra_metric` condition type.
|
@@ -981,10 +998,10 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
981
998
|
:param pulumi.Input[int] updated_at: The timestamp the alert condition was last updated.
|
982
999
|
:param pulumi.Input[int] violation_close_timer: Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
983
1000
|
|
984
|
-
```python
|
985
|
-
import pulumi
|
986
1001
|
```
|
987
|
-
|
1002
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
1003
|
+
```
|
1004
|
+
:param pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
988
1005
|
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
989
1006
|
"""
|
990
1007
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
@@ -1085,7 +1102,7 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1085
1102
|
|
1086
1103
|
@property
|
1087
1104
|
@pulumi.getter(name="policyId")
|
1088
|
-
def policy_id(self) -> pulumi.Output[
|
1105
|
+
def policy_id(self) -> pulumi.Output[str]:
|
1089
1106
|
"""
|
1090
1107
|
The ID of the alert policy where this condition should be used.
|
1091
1108
|
"""
|
@@ -1137,8 +1154,8 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1137
1154
|
"""
|
1138
1155
|
Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are `1 2 4 8 12 24 48 72`. Defaults to 24. If `0` is provided, default of `24` is used and will have configuration drift during the apply phase until a valid value is provided.
|
1139
1156
|
|
1140
|
-
```
|
1141
|
-
|
1157
|
+
```
|
1158
|
+
Warning: This resource will use the account ID linked to your API key. At the moment it is not possible to dynamically set the account ID.
|
1142
1159
|
```
|
1143
1160
|
"""
|
1144
1161
|
return pulumi.get(self, "violation_close_timer")
|