pulumi-newrelic 5.21.0a1710157101__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 +11 -6
- pulumi_newrelic/alert_channel.py +116 -127
- pulumi_newrelic/alert_condition.py +116 -129
- pulumi_newrelic/alert_muting_rule.py +128 -76
- pulumi_newrelic/alert_policy.py +78 -75
- pulumi_newrelic/alert_policy_channel.py +77 -68
- pulumi_newrelic/api_access_key.py +45 -28
- pulumi_newrelic/browser_application.py +77 -78
- pulumi_newrelic/cloud/_inputs.py +2527 -1082
- pulumi_newrelic/cloud/aws_govcloud_integrations.py +133 -128
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +23 -20
- pulumi_newrelic/cloud/aws_integrations.py +298 -1326
- pulumi_newrelic/cloud/aws_link_account.py +23 -20
- pulumi_newrelic/cloud/azure_integrations.py +521 -483
- pulumi_newrelic/cloud/azure_link_account.py +34 -31
- pulumi_newrelic/cloud/gcp_integrations.py +341 -322
- pulumi_newrelic/cloud/gcp_link_account.py +23 -20
- 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 +19 -18
- pulumi_newrelic/entity_tags.py +32 -31
- pulumi_newrelic/events_to_metrics_rule.py +23 -20
- pulumi_newrelic/get_account.py +24 -16
- pulumi_newrelic/get_alert_channel.py +26 -13
- pulumi_newrelic/get_alert_policy.py +35 -12
- pulumi_newrelic/get_application.py +39 -31
- pulumi_newrelic/get_authentication_domain.py +17 -13
- pulumi_newrelic/get_cloud_account.py +26 -18
- pulumi_newrelic/get_entity.py +90 -147
- pulumi_newrelic/get_group.py +58 -13
- pulumi_newrelic/get_key_transaction.py +109 -34
- pulumi_newrelic/get_notification_destination.py +64 -14
- pulumi_newrelic/get_obfuscation_expression.py +36 -28
- pulumi_newrelic/get_service_level_alert_helper.py +135 -117
- pulumi_newrelic/get_test_grok_pattern.py +29 -18
- pulumi_newrelic/get_user.py +17 -9
- pulumi_newrelic/group.py +5 -146
- pulumi_newrelic/infra_alert_condition.py +160 -167
- pulumi_newrelic/insights/_inputs.py +43 -0
- pulumi_newrelic/insights/event.py +48 -47
- pulumi_newrelic/insights/outputs.py +5 -0
- pulumi_newrelic/key_transaction.py +464 -0
- pulumi_newrelic/log_parsing_rule.py +25 -24
- pulumi_newrelic/monitor_downtime.py +211 -225
- pulumi_newrelic/notification_channel.py +381 -366
- pulumi_newrelic/notification_destination.py +192 -54
- pulumi_newrelic/nrql_alert_condition.py +345 -262
- pulumi_newrelic/nrql_drop_rule.py +31 -30
- pulumi_newrelic/obfuscation_expression.py +23 -20
- pulumi_newrelic/obfuscation_rule.py +38 -33
- pulumi_newrelic/one_dashboard.py +29 -24
- pulumi_newrelic/one_dashboard_json.py +19 -14
- pulumi_newrelic/one_dashboard_raw.py +110 -105
- pulumi_newrelic/outputs.py +2446 -245
- pulumi_newrelic/plugins/_inputs.py +145 -10
- pulumi_newrelic/plugins/application_settings.py +25 -36
- pulumi_newrelic/plugins/outputs.py +15 -10
- pulumi_newrelic/plugins/workload.py +215 -92
- pulumi_newrelic/provider.py +27 -33
- pulumi_newrelic/pulumi-plugin.json +2 -1
- pulumi_newrelic/service_level.py +185 -186
- pulumi_newrelic/synthetics/_inputs.py +159 -2
- pulumi_newrelic/synthetics/alert_condition.py +87 -98
- pulumi_newrelic/synthetics/broken_links_monitor.py +216 -99
- pulumi_newrelic/synthetics/cert_check_monitor.py +219 -100
- pulumi_newrelic/synthetics/get_private_location.py +34 -30
- pulumi_newrelic/synthetics/get_secure_credential.py +24 -16
- pulumi_newrelic/synthetics/monitor.py +348 -193
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +105 -100
- pulumi_newrelic/synthetics/outputs.py +7 -2
- pulumi_newrelic/synthetics/private_location.py +25 -20
- pulumi_newrelic/synthetics/script_monitor.py +317 -182
- pulumi_newrelic/synthetics/secure_credential.py +23 -22
- pulumi_newrelic/synthetics/step_monitor.py +405 -100
- pulumi_newrelic/user.py +13 -10
- pulumi_newrelic/workflow.py +209 -196
- {pulumi_newrelic-5.21.0a1710157101.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.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
- pulumi_newrelic-5.21.0a1710157101.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.21.0a1710157101.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,13 +52,11 @@ 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
|
-
<!--Start PulumiCodeChooser -->
|
51
|
-
```python
|
52
|
-
import pulumi
|
53
55
|
```
|
54
|
-
|
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.
|
57
|
+
```
|
55
58
|
:param pulumi.Input['InfraAlertConditionWarningArgs'] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
56
|
-
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '
|
59
|
+
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
57
60
|
"""
|
58
61
|
pulumi.set(__self__, "policy_id", policy_id)
|
59
62
|
pulumi.set(__self__, "type", type)
|
@@ -86,14 +89,14 @@ class InfraAlertConditionArgs:
|
|
86
89
|
|
87
90
|
@property
|
88
91
|
@pulumi.getter(name="policyId")
|
89
|
-
def policy_id(self) -> pulumi.Input[
|
92
|
+
def policy_id(self) -> pulumi.Input[str]:
|
90
93
|
"""
|
91
94
|
The ID of the alert policy where this condition should be used.
|
92
95
|
"""
|
93
96
|
return pulumi.get(self, "policy_id")
|
94
97
|
|
95
98
|
@policy_id.setter
|
96
|
-
def policy_id(self, value: pulumi.Input[
|
99
|
+
def policy_id(self, value: pulumi.Input[str]):
|
97
100
|
pulumi.set(self, "policy_id", value)
|
98
101
|
|
99
102
|
@property
|
@@ -234,11 +237,9 @@ class InfraAlertConditionArgs:
|
|
234
237
|
"""
|
235
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.
|
236
239
|
|
237
|
-
<!--Start PulumiCodeChooser -->
|
238
|
-
```python
|
239
|
-
import pulumi
|
240
240
|
```
|
241
|
-
|
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.
|
242
|
+
```
|
242
243
|
"""
|
243
244
|
return pulumi.get(self, "violation_close_timer")
|
244
245
|
|
@@ -262,7 +263,7 @@ class InfraAlertConditionArgs:
|
|
262
263
|
@pulumi.getter
|
263
264
|
def where(self) -> Optional[pulumi.Input[str]]:
|
264
265
|
"""
|
265
|
-
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '
|
266
|
+
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
266
267
|
"""
|
267
268
|
return pulumi.get(self, "where")
|
268
269
|
|
@@ -283,7 +284,7 @@ class _InfraAlertConditionState:
|
|
283
284
|
event: Optional[pulumi.Input[str]] = None,
|
284
285
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
285
286
|
name: Optional[pulumi.Input[str]] = None,
|
286
|
-
policy_id: Optional[pulumi.Input[
|
287
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
287
288
|
process_where: Optional[pulumi.Input[str]] = None,
|
288
289
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
289
290
|
select: Optional[pulumi.Input[str]] = None,
|
@@ -303,7 +304,7 @@ class _InfraAlertConditionState:
|
|
303
304
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
304
305
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
305
306
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
306
|
-
:param pulumi.Input[
|
307
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
307
308
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
308
309
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
309
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.
|
@@ -311,13 +312,11 @@ class _InfraAlertConditionState:
|
|
311
312
|
:param pulumi.Input[int] updated_at: The timestamp the alert condition was last updated.
|
312
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.
|
313
314
|
|
314
|
-
<!--Start PulumiCodeChooser -->
|
315
|
-
```python
|
316
|
-
import pulumi
|
317
315
|
```
|
318
|
-
|
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.
|
317
|
+
```
|
319
318
|
:param pulumi.Input['InfraAlertConditionWarningArgs'] warning: Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.
|
320
|
-
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '
|
319
|
+
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
321
320
|
"""
|
322
321
|
if comparison is not None:
|
323
322
|
pulumi.set(__self__, "comparison", comparison)
|
@@ -466,14 +465,14 @@ class _InfraAlertConditionState:
|
|
466
465
|
|
467
466
|
@property
|
468
467
|
@pulumi.getter(name="policyId")
|
469
|
-
def policy_id(self) -> Optional[pulumi.Input[
|
468
|
+
def policy_id(self) -> Optional[pulumi.Input[str]]:
|
470
469
|
"""
|
471
470
|
The ID of the alert policy where this condition should be used.
|
472
471
|
"""
|
473
472
|
return pulumi.get(self, "policy_id")
|
474
473
|
|
475
474
|
@policy_id.setter
|
476
|
-
def policy_id(self, value: Optional[pulumi.Input[
|
475
|
+
def policy_id(self, value: Optional[pulumi.Input[str]]):
|
477
476
|
pulumi.set(self, "policy_id", value)
|
478
477
|
|
479
478
|
@property
|
@@ -542,11 +541,9 @@ class _InfraAlertConditionState:
|
|
542
541
|
"""
|
543
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.
|
544
543
|
|
545
|
-
<!--Start PulumiCodeChooser -->
|
546
|
-
```python
|
547
|
-
import pulumi
|
548
544
|
```
|
549
|
-
|
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.
|
546
|
+
```
|
550
547
|
"""
|
551
548
|
return pulumi.get(self, "violation_close_timer")
|
552
549
|
|
@@ -570,7 +567,7 @@ class _InfraAlertConditionState:
|
|
570
567
|
@pulumi.getter
|
571
568
|
def where(self) -> Optional[pulumi.Input[str]]:
|
572
569
|
"""
|
573
|
-
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '
|
570
|
+
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
574
571
|
"""
|
575
572
|
return pulumi.get(self, "where")
|
576
573
|
|
@@ -585,54 +582,55 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
585
582
|
resource_name: str,
|
586
583
|
opts: Optional[pulumi.ResourceOptions] = None,
|
587
584
|
comparison: Optional[pulumi.Input[str]] = None,
|
588
|
-
critical: Optional[pulumi.Input[
|
585
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
589
586
|
description: Optional[pulumi.Input[str]] = None,
|
590
587
|
enabled: Optional[pulumi.Input[bool]] = None,
|
591
588
|
event: Optional[pulumi.Input[str]] = None,
|
592
589
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
593
590
|
name: Optional[pulumi.Input[str]] = None,
|
594
|
-
policy_id: Optional[pulumi.Input[
|
591
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
595
592
|
process_where: Optional[pulumi.Input[str]] = None,
|
596
593
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
597
594
|
select: Optional[pulumi.Input[str]] = None,
|
598
595
|
type: Optional[pulumi.Input[str]] = None,
|
599
596
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
600
|
-
warning: Optional[pulumi.Input[
|
597
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
601
598
|
where: Optional[pulumi.Input[str]] = None,
|
602
599
|
__props__=None):
|
603
600
|
"""
|
604
601
|
Use this resource to create and manage Infrastructure alert conditions in New Relic.
|
605
602
|
|
606
|
-
> **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.
|
607
604
|
|
608
605
|
## Example Usage
|
609
606
|
|
610
|
-
<!--Start PulumiCodeChooser -->
|
611
607
|
```python
|
612
608
|
import pulumi
|
613
609
|
import pulumi_newrelic as newrelic
|
614
610
|
|
615
|
-
foo = newrelic.AlertPolicy("foo")
|
616
|
-
high_disk_usage = newrelic.InfraAlertCondition("
|
611
|
+
foo = newrelic.AlertPolicy("foo", name="foo")
|
612
|
+
high_disk_usage = newrelic.InfraAlertCondition("high_disk_usage",
|
617
613
|
policy_id=foo.id,
|
614
|
+
name="High disk usage",
|
618
615
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
619
616
|
type="infra_metric",
|
620
617
|
event="StorageSample",
|
621
618
|
select="diskUsedPercent",
|
622
619
|
comparison="above",
|
623
620
|
where="(hostname LIKE '%frontend%')",
|
624
|
-
critical=
|
625
|
-
duration
|
626
|
-
value
|
627
|
-
time_function
|
628
|
-
|
629
|
-
warning=
|
630
|
-
duration
|
631
|
-
value
|
632
|
-
time_function
|
633
|
-
)
|
634
|
-
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",
|
635
632
|
policy_id=foo.id,
|
633
|
+
name="High database connection count",
|
636
634
|
description="Critical alert when the number of database connections goes above 90",
|
637
635
|
type="infra_metric",
|
638
636
|
event="DatastoreSample",
|
@@ -640,32 +638,33 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
640
638
|
comparison="above",
|
641
639
|
where="(hostname LIKE '%db%')",
|
642
640
|
integration_provider="RdsDbInstance",
|
643
|
-
critical=
|
644
|
-
duration
|
645
|
-
value
|
646
|
-
time_function
|
647
|
-
)
|
648
|
-
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",
|
649
647
|
policy_id=foo.id,
|
648
|
+
name="Process not running (/usr/bin/ruby)",
|
650
649
|
description="Critical alert when ruby isn't running",
|
651
650
|
type="infra_process_running",
|
652
651
|
comparison="equal",
|
653
652
|
where="hostname = 'web01'",
|
654
653
|
process_where="commandName = '/usr/bin/ruby'",
|
655
|
-
critical=
|
656
|
-
duration
|
657
|
-
value
|
658
|
-
)
|
659
|
-
host_not_reporting = newrelic.InfraAlertCondition("
|
654
|
+
critical={
|
655
|
+
"duration": 5,
|
656
|
+
"value": 0,
|
657
|
+
})
|
658
|
+
host_not_reporting = newrelic.InfraAlertCondition("host_not_reporting",
|
660
659
|
policy_id=foo.id,
|
660
|
+
name="Host not reporting",
|
661
661
|
description="Critical alert when the host is not reporting",
|
662
662
|
type="infra_host_not_reporting",
|
663
663
|
where="(hostname LIKE '%frontend%')",
|
664
|
-
critical=
|
665
|
-
duration
|
666
|
-
)
|
664
|
+
critical={
|
665
|
+
"duration": 5,
|
666
|
+
})
|
667
667
|
```
|
668
|
-
<!--End PulumiCodeChooser -->
|
669
668
|
|
670
669
|
## Thresholds
|
671
670
|
|
@@ -679,47 +678,46 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
679
678
|
|
680
679
|
Manage infra alert condition tags with `EntityTags`. For up-to-date documentation about the tagging resource, please check EntityTags
|
681
680
|
|
682
|
-
<!--Start PulumiCodeChooser -->
|
683
681
|
```python
|
684
682
|
import pulumi
|
685
683
|
import pulumi_newrelic as newrelic
|
686
684
|
|
687
|
-
|
688
|
-
foo_infra_alert_condition = newrelic.InfraAlertCondition("
|
689
|
-
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",
|
690
689
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
691
690
|
type="infra_metric",
|
692
691
|
event="StorageSample",
|
693
692
|
select="diskUsedPercent",
|
694
693
|
comparison="above",
|
695
694
|
where="(hostname LIKE '%frontend%')",
|
696
|
-
critical=
|
697
|
-
duration
|
698
|
-
value
|
699
|
-
time_function
|
700
|
-
|
701
|
-
warning=
|
702
|
-
duration
|
703
|
-
value
|
704
|
-
time_function
|
705
|
-
)
|
706
|
-
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",
|
707
706
|
guid=foo_infra_alert_condition.entity_guid,
|
708
707
|
tags=[
|
709
|
-
|
710
|
-
key
|
711
|
-
values
|
708
|
+
{
|
709
|
+
"key": "my-key",
|
710
|
+
"values": [
|
712
711
|
"my-value",
|
713
712
|
"my-other-value",
|
714
713
|
],
|
715
|
-
|
716
|
-
|
717
|
-
key
|
718
|
-
values
|
719
|
-
|
714
|
+
},
|
715
|
+
{
|
716
|
+
"key": "my-key-2",
|
717
|
+
"values": ["my-value-2"],
|
718
|
+
},
|
720
719
|
])
|
721
720
|
```
|
722
|
-
<!--End PulumiCodeChooser -->
|
723
721
|
|
724
722
|
## Import
|
725
723
|
|
@@ -732,26 +730,24 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
732
730
|
:param str resource_name: The name of the resource.
|
733
731
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
734
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.
|
735
|
-
: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.
|
736
734
|
:param pulumi.Input[str] description: The description of the Infrastructure alert condition.
|
737
735
|
:param pulumi.Input[bool] enabled: Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`.
|
738
736
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
739
737
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
740
738
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
741
|
-
:param pulumi.Input[
|
739
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
742
740
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
743
741
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
744
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.
|
745
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`.
|
746
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.
|
747
745
|
|
748
|
-
<!--Start PulumiCodeChooser -->
|
749
|
-
```python
|
750
|
-
import pulumi
|
751
746
|
```
|
752
|
-
|
753
|
-
|
754
|
-
:param pulumi.Input[
|
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.
|
750
|
+
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
755
751
|
"""
|
756
752
|
...
|
757
753
|
@overload
|
@@ -762,36 +758,37 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
762
758
|
"""
|
763
759
|
Use this resource to create and manage Infrastructure alert conditions in New Relic.
|
764
760
|
|
765
|
-
> **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.
|
766
762
|
|
767
763
|
## Example Usage
|
768
764
|
|
769
|
-
<!--Start PulumiCodeChooser -->
|
770
765
|
```python
|
771
766
|
import pulumi
|
772
767
|
import pulumi_newrelic as newrelic
|
773
768
|
|
774
|
-
foo = newrelic.AlertPolicy("foo")
|
775
|
-
high_disk_usage = newrelic.InfraAlertCondition("
|
769
|
+
foo = newrelic.AlertPolicy("foo", name="foo")
|
770
|
+
high_disk_usage = newrelic.InfraAlertCondition("high_disk_usage",
|
776
771
|
policy_id=foo.id,
|
772
|
+
name="High disk usage",
|
777
773
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
778
774
|
type="infra_metric",
|
779
775
|
event="StorageSample",
|
780
776
|
select="diskUsedPercent",
|
781
777
|
comparison="above",
|
782
778
|
where="(hostname LIKE '%frontend%')",
|
783
|
-
critical=
|
784
|
-
duration
|
785
|
-
value
|
786
|
-
time_function
|
787
|
-
|
788
|
-
warning=
|
789
|
-
duration
|
790
|
-
value
|
791
|
-
time_function
|
792
|
-
)
|
793
|
-
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",
|
794
790
|
policy_id=foo.id,
|
791
|
+
name="High database connection count",
|
795
792
|
description="Critical alert when the number of database connections goes above 90",
|
796
793
|
type="infra_metric",
|
797
794
|
event="DatastoreSample",
|
@@ -799,32 +796,33 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
799
796
|
comparison="above",
|
800
797
|
where="(hostname LIKE '%db%')",
|
801
798
|
integration_provider="RdsDbInstance",
|
802
|
-
critical=
|
803
|
-
duration
|
804
|
-
value
|
805
|
-
time_function
|
806
|
-
)
|
807
|
-
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",
|
808
805
|
policy_id=foo.id,
|
806
|
+
name="Process not running (/usr/bin/ruby)",
|
809
807
|
description="Critical alert when ruby isn't running",
|
810
808
|
type="infra_process_running",
|
811
809
|
comparison="equal",
|
812
810
|
where="hostname = 'web01'",
|
813
811
|
process_where="commandName = '/usr/bin/ruby'",
|
814
|
-
critical=
|
815
|
-
duration
|
816
|
-
value
|
817
|
-
)
|
818
|
-
host_not_reporting = newrelic.InfraAlertCondition("
|
812
|
+
critical={
|
813
|
+
"duration": 5,
|
814
|
+
"value": 0,
|
815
|
+
})
|
816
|
+
host_not_reporting = newrelic.InfraAlertCondition("host_not_reporting",
|
819
817
|
policy_id=foo.id,
|
818
|
+
name="Host not reporting",
|
820
819
|
description="Critical alert when the host is not reporting",
|
821
820
|
type="infra_host_not_reporting",
|
822
821
|
where="(hostname LIKE '%frontend%')",
|
823
|
-
critical=
|
824
|
-
duration
|
825
|
-
)
|
822
|
+
critical={
|
823
|
+
"duration": 5,
|
824
|
+
})
|
826
825
|
```
|
827
|
-
<!--End PulumiCodeChooser -->
|
828
826
|
|
829
827
|
## Thresholds
|
830
828
|
|
@@ -838,47 +836,46 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
838
836
|
|
839
837
|
Manage infra alert condition tags with `EntityTags`. For up-to-date documentation about the tagging resource, please check EntityTags
|
840
838
|
|
841
|
-
<!--Start PulumiCodeChooser -->
|
842
839
|
```python
|
843
840
|
import pulumi
|
844
841
|
import pulumi_newrelic as newrelic
|
845
842
|
|
846
|
-
|
847
|
-
foo_infra_alert_condition = newrelic.InfraAlertCondition("
|
848
|
-
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",
|
849
847
|
description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
|
850
848
|
type="infra_metric",
|
851
849
|
event="StorageSample",
|
852
850
|
select="diskUsedPercent",
|
853
851
|
comparison="above",
|
854
852
|
where="(hostname LIKE '%frontend%')",
|
855
|
-
critical=
|
856
|
-
duration
|
857
|
-
value
|
858
|
-
time_function
|
859
|
-
|
860
|
-
warning=
|
861
|
-
duration
|
862
|
-
value
|
863
|
-
time_function
|
864
|
-
)
|
865
|
-
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",
|
866
864
|
guid=foo_infra_alert_condition.entity_guid,
|
867
865
|
tags=[
|
868
|
-
|
869
|
-
key
|
870
|
-
values
|
866
|
+
{
|
867
|
+
"key": "my-key",
|
868
|
+
"values": [
|
871
869
|
"my-value",
|
872
870
|
"my-other-value",
|
873
871
|
],
|
874
|
-
|
875
|
-
|
876
|
-
key
|
877
|
-
values
|
878
|
-
|
872
|
+
},
|
873
|
+
{
|
874
|
+
"key": "my-key-2",
|
875
|
+
"values": ["my-value-2"],
|
876
|
+
},
|
879
877
|
])
|
880
878
|
```
|
881
|
-
<!--End PulumiCodeChooser -->
|
882
879
|
|
883
880
|
## Import
|
884
881
|
|
@@ -904,19 +901,19 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
904
901
|
resource_name: str,
|
905
902
|
opts: Optional[pulumi.ResourceOptions] = None,
|
906
903
|
comparison: Optional[pulumi.Input[str]] = None,
|
907
|
-
critical: Optional[pulumi.Input[
|
904
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
908
905
|
description: Optional[pulumi.Input[str]] = None,
|
909
906
|
enabled: Optional[pulumi.Input[bool]] = None,
|
910
907
|
event: Optional[pulumi.Input[str]] = None,
|
911
908
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
912
909
|
name: Optional[pulumi.Input[str]] = None,
|
913
|
-
policy_id: Optional[pulumi.Input[
|
910
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
914
911
|
process_where: Optional[pulumi.Input[str]] = None,
|
915
912
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
916
913
|
select: Optional[pulumi.Input[str]] = None,
|
917
914
|
type: Optional[pulumi.Input[str]] = None,
|
918
915
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
919
|
-
warning: Optional[pulumi.Input[
|
916
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
920
917
|
where: Optional[pulumi.Input[str]] = None,
|
921
918
|
__props__=None):
|
922
919
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
@@ -961,21 +958,21 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
961
958
|
opts: Optional[pulumi.ResourceOptions] = None,
|
962
959
|
comparison: Optional[pulumi.Input[str]] = None,
|
963
960
|
created_at: Optional[pulumi.Input[int]] = None,
|
964
|
-
critical: Optional[pulumi.Input[
|
961
|
+
critical: Optional[pulumi.Input[Union['InfraAlertConditionCriticalArgs', 'InfraAlertConditionCriticalArgsDict']]] = None,
|
965
962
|
description: Optional[pulumi.Input[str]] = None,
|
966
963
|
enabled: Optional[pulumi.Input[bool]] = None,
|
967
964
|
entity_guid: Optional[pulumi.Input[str]] = None,
|
968
965
|
event: Optional[pulumi.Input[str]] = None,
|
969
966
|
integration_provider: Optional[pulumi.Input[str]] = None,
|
970
967
|
name: Optional[pulumi.Input[str]] = None,
|
971
|
-
policy_id: Optional[pulumi.Input[
|
968
|
+
policy_id: Optional[pulumi.Input[str]] = None,
|
972
969
|
process_where: Optional[pulumi.Input[str]] = None,
|
973
970
|
runbook_url: Optional[pulumi.Input[str]] = None,
|
974
971
|
select: Optional[pulumi.Input[str]] = None,
|
975
972
|
type: Optional[pulumi.Input[str]] = None,
|
976
973
|
updated_at: Optional[pulumi.Input[int]] = None,
|
977
974
|
violation_close_timer: Optional[pulumi.Input[int]] = None,
|
978
|
-
warning: Optional[pulumi.Input[
|
975
|
+
warning: Optional[pulumi.Input[Union['InfraAlertConditionWarningArgs', 'InfraAlertConditionWarningArgsDict']]] = None,
|
979
976
|
where: Optional[pulumi.Input[str]] = None) -> 'InfraAlertCondition':
|
980
977
|
"""
|
981
978
|
Get an existing InfraAlertCondition resource's state with the given name, id, and optional extra
|
@@ -986,14 +983,14 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
986
983
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
987
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.
|
988
985
|
:param pulumi.Input[int] created_at: The timestamp the alert condition was created.
|
989
|
-
: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.
|
990
987
|
:param pulumi.Input[str] description: The description of the Infrastructure alert condition.
|
991
988
|
:param pulumi.Input[bool] enabled: Whether the condition is turned on or off. Valid values are `true` and `false`. Defaults to `true`.
|
992
989
|
:param pulumi.Input[str] entity_guid: The unique entity identifier of the condition in New Relic.
|
993
990
|
:param pulumi.Input[str] event: The metric event; for example, `SystemSample` or `StorageSample`. Supported by the `infra_metric` condition type.
|
994
991
|
:param pulumi.Input[str] integration_provider: For alerts on integrations, use this instead of `event`. Supported by the `infra_metric` condition type.
|
995
992
|
:param pulumi.Input[str] name: The Infrastructure alert condition's name.
|
996
|
-
:param pulumi.Input[
|
993
|
+
:param pulumi.Input[str] policy_id: The ID of the alert policy where this condition should be used.
|
997
994
|
:param pulumi.Input[str] process_where: Any filters applied to processes; for example: `commandName = 'java'`. Required by the `infra_process_running` condition type.
|
998
995
|
:param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
|
999
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.
|
@@ -1001,13 +998,11 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1001
998
|
:param pulumi.Input[int] updated_at: The timestamp the alert condition was last updated.
|
1002
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.
|
1003
1000
|
|
1004
|
-
<!--Start PulumiCodeChooser -->
|
1005
|
-
```python
|
1006
|
-
import pulumi
|
1007
1001
|
```
|
1008
|
-
|
1009
|
-
|
1010
|
-
:param pulumi.Input[
|
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.
|
1005
|
+
:param pulumi.Input[str] where: If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
1011
1006
|
"""
|
1012
1007
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
1013
1008
|
|
@@ -1107,7 +1102,7 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1107
1102
|
|
1108
1103
|
@property
|
1109
1104
|
@pulumi.getter(name="policyId")
|
1110
|
-
def policy_id(self) -> pulumi.Output[
|
1105
|
+
def policy_id(self) -> pulumi.Output[str]:
|
1111
1106
|
"""
|
1112
1107
|
The ID of the alert policy where this condition should be used.
|
1113
1108
|
"""
|
@@ -1159,11 +1154,9 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1159
1154
|
"""
|
1160
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.
|
1161
1156
|
|
1162
|
-
<!--Start PulumiCodeChooser -->
|
1163
|
-
```python
|
1164
|
-
import pulumi
|
1165
1157
|
```
|
1166
|
-
|
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.
|
1159
|
+
```
|
1167
1160
|
"""
|
1168
1161
|
return pulumi.get(self, "violation_close_timer")
|
1169
1162
|
|
@@ -1179,7 +1172,7 @@ class InfraAlertCondition(pulumi.CustomResource):
|
|
1179
1172
|
@pulumi.getter
|
1180
1173
|
def where(self) -> pulumi.Output[Optional[str]]:
|
1181
1174
|
"""
|
1182
|
-
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '
|
1175
|
+
If applicable, this identifies any Infrastructure host filters used; for example: `hostname LIKE '%cassandra%'`.
|
1183
1176
|
"""
|
1184
1177
|
return pulumi.get(self, "where")
|
1185
1178
|
|