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.
Files changed (85) hide show
  1. pulumi_newrelic/__init__.py +9 -0
  2. pulumi_newrelic/_inputs.py +7153 -461
  3. pulumi_newrelic/_utilities.py +41 -5
  4. pulumi_newrelic/account_management.py +13 -4
  5. pulumi_newrelic/alert_channel.py +122 -101
  6. pulumi_newrelic/alert_condition.py +120 -109
  7. pulumi_newrelic/alert_muting_rule.py +130 -74
  8. pulumi_newrelic/alert_policy.py +88 -67
  9. pulumi_newrelic/alert_policy_channel.py +81 -68
  10. pulumi_newrelic/api_access_key.py +49 -52
  11. pulumi_newrelic/browser_application.py +79 -76
  12. pulumi_newrelic/cloud/_inputs.py +2527 -1082
  13. pulumi_newrelic/cloud/aws_govcloud_integrations.py +135 -130
  14. pulumi_newrelic/cloud/aws_govcloud_link_account.py +25 -18
  15. pulumi_newrelic/cloud/aws_integrations.py +300 -1324
  16. pulumi_newrelic/cloud/aws_link_account.py +25 -18
  17. pulumi_newrelic/cloud/azure_integrations.py +523 -481
  18. pulumi_newrelic/cloud/azure_link_account.py +36 -29
  19. pulumi_newrelic/cloud/gcp_integrations.py +343 -320
  20. pulumi_newrelic/cloud/gcp_link_account.py +25 -18
  21. pulumi_newrelic/cloud/outputs.py +327 -1072
  22. pulumi_newrelic/config/__init__.pyi +6 -1
  23. pulumi_newrelic/config/vars.py +7 -2
  24. pulumi_newrelic/data_partition_rule.py +23 -16
  25. pulumi_newrelic/entity_tags.py +36 -31
  26. pulumi_newrelic/events_to_metrics_rule.py +27 -20
  27. pulumi_newrelic/get_account.py +24 -12
  28. pulumi_newrelic/get_alert_channel.py +26 -13
  29. pulumi_newrelic/get_alert_policy.py +35 -12
  30. pulumi_newrelic/get_application.py +39 -27
  31. pulumi_newrelic/get_authentication_domain.py +17 -9
  32. pulumi_newrelic/get_cloud_account.py +26 -14
  33. pulumi_newrelic/get_entity.py +90 -85
  34. pulumi_newrelic/get_group.py +58 -9
  35. pulumi_newrelic/get_key_transaction.py +109 -30
  36. pulumi_newrelic/get_notification_destination.py +64 -14
  37. pulumi_newrelic/get_obfuscation_expression.py +36 -24
  38. pulumi_newrelic/get_service_level_alert_helper.py +135 -105
  39. pulumi_newrelic/get_test_grok_pattern.py +29 -14
  40. pulumi_newrelic/get_user.py +17 -5
  41. pulumi_newrelic/group.py +5 -132
  42. pulumi_newrelic/infra_alert_condition.py +157 -140
  43. pulumi_newrelic/insights/_inputs.py +43 -0
  44. pulumi_newrelic/insights/event.py +50 -43
  45. pulumi_newrelic/insights/outputs.py +5 -0
  46. pulumi_newrelic/key_transaction.py +464 -0
  47. pulumi_newrelic/log_parsing_rule.py +29 -18
  48. pulumi_newrelic/monitor_downtime.py +215 -203
  49. pulumi_newrelic/notification_channel.py +387 -326
  50. pulumi_newrelic/notification_destination.py +248 -118
  51. pulumi_newrelic/nrql_alert_condition.py +353 -246
  52. pulumi_newrelic/nrql_drop_rule.py +57 -30
  53. pulumi_newrelic/obfuscation_expression.py +25 -18
  54. pulumi_newrelic/obfuscation_rule.py +40 -31
  55. pulumi_newrelic/one_dashboard.py +31 -26
  56. pulumi_newrelic/one_dashboard_json.py +21 -16
  57. pulumi_newrelic/one_dashboard_raw.py +112 -101
  58. pulumi_newrelic/outputs.py +2446 -245
  59. pulumi_newrelic/plugins/_inputs.py +145 -10
  60. pulumi_newrelic/plugins/application_settings.py +29 -20
  61. pulumi_newrelic/plugins/outputs.py +15 -10
  62. pulumi_newrelic/plugins/workload.py +285 -54
  63. pulumi_newrelic/provider.py +27 -33
  64. pulumi_newrelic/pulumi-plugin.json +2 -1
  65. pulumi_newrelic/service_level.py +193 -180
  66. pulumi_newrelic/synthetics/_inputs.py +159 -2
  67. pulumi_newrelic/synthetics/alert_condition.py +91 -78
  68. pulumi_newrelic/synthetics/broken_links_monitor.py +220 -93
  69. pulumi_newrelic/synthetics/cert_check_monitor.py +223 -94
  70. pulumi_newrelic/synthetics/get_private_location.py +34 -22
  71. pulumi_newrelic/synthetics/get_secure_credential.py +24 -12
  72. pulumi_newrelic/synthetics/monitor.py +352 -179
  73. pulumi_newrelic/synthetics/multi_location_alert_condition.py +109 -96
  74. pulumi_newrelic/synthetics/outputs.py +7 -2
  75. pulumi_newrelic/synthetics/private_location.py +27 -18
  76. pulumi_newrelic/synthetics/script_monitor.py +321 -168
  77. pulumi_newrelic/synthetics/secure_credential.py +25 -20
  78. pulumi_newrelic/synthetics/step_monitor.py +409 -98
  79. pulumi_newrelic/user.py +13 -6
  80. pulumi_newrelic/workflow.py +215 -184
  81. {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/METADATA +7 -6
  82. pulumi_newrelic-5.39.0a1736834464.dist-info/RECORD +90 -0
  83. {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
  84. pulumi_newrelic-5.20.0a1709643785.dist-info/RECORD +0 -89
  85. {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,9 +21,9 @@ __all__ = ['AlertConditionArgs', 'AlertCondition']
16
21
  @pulumi.input_type
17
22
  class AlertConditionArgs:
18
23
  def __init__(__self__, *,
19
- entities: pulumi.Input[Sequence[pulumi.Input[int]]],
24
+ entities: pulumi.Input[Sequence[pulumi.Input[str]]],
20
25
  metric: pulumi.Input[str],
21
- policy_id: pulumi.Input[int],
26
+ policy_id: pulumi.Input[str],
22
27
  terms: pulumi.Input[Sequence[pulumi.Input['AlertConditionTermArgs']]],
23
28
  type: pulumi.Input[str],
24
29
  condition_scope: Optional[pulumi.Input[str]] = None,
@@ -31,9 +36,9 @@ class AlertConditionArgs:
31
36
  violation_close_timer: Optional[pulumi.Input[int]] = None):
32
37
  """
33
38
  The set of arguments for constructing a AlertCondition resource.
34
- :param pulumi.Input[Sequence[pulumi.Input[int]]] entities: The instance IDs associated with this condition.
39
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] entities: The instance IDs associated with this condition.
35
40
  :param pulumi.Input[str] metric: The metric field accepts parameters based on the `type` set. One of these metrics based on `type`:
36
- :param pulumi.Input[int] policy_id: The ID of the policy where this condition should be used.
41
+ :param pulumi.Input[str] policy_id: The ID of the policy where this condition should be used.
37
42
  :param pulumi.Input[Sequence[pulumi.Input['AlertConditionTermArgs']]] terms: A list of terms for this condition. See Terms below for details.
38
43
  :param pulumi.Input[str] type: The type of condition. One of: `apm_app_metric`, `apm_jvm_metric`, `apm_kt_metric`, `browser_metric`, `mobile_metric`
39
44
  :param pulumi.Input[str] condition_scope: `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances).
@@ -46,8 +51,8 @@ class AlertConditionArgs:
46
51
 
47
52
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
48
53
 
49
- ```python
50
- import pulumi
54
+ ```
55
+ 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.
51
56
  ```
52
57
  :param pulumi.Input[int] violation_close_timer: Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift:
53
58
  * when `type` = `apm_app_metric` and `condition_scope` = `instance`
@@ -77,14 +82,14 @@ class AlertConditionArgs:
77
82
 
78
83
  @property
79
84
  @pulumi.getter
80
- def entities(self) -> pulumi.Input[Sequence[pulumi.Input[int]]]:
85
+ def entities(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
81
86
  """
82
87
  The instance IDs associated with this condition.
83
88
  """
84
89
  return pulumi.get(self, "entities")
85
90
 
86
91
  @entities.setter
87
- def entities(self, value: pulumi.Input[Sequence[pulumi.Input[int]]]):
92
+ def entities(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
88
93
  pulumi.set(self, "entities", value)
89
94
 
90
95
  @property
@@ -101,14 +106,14 @@ class AlertConditionArgs:
101
106
 
102
107
  @property
103
108
  @pulumi.getter(name="policyId")
104
- def policy_id(self) -> pulumi.Input[int]:
109
+ def policy_id(self) -> pulumi.Input[str]:
105
110
  """
106
111
  The ID of the policy where this condition should be used.
107
112
  """
108
113
  return pulumi.get(self, "policy_id")
109
114
 
110
115
  @policy_id.setter
111
- def policy_id(self, value: pulumi.Input[int]):
116
+ def policy_id(self, value: pulumi.Input[str]):
112
117
  pulumi.set(self, "policy_id", value)
113
118
 
114
119
  @property
@@ -215,8 +220,8 @@ class AlertConditionArgs:
215
220
 
216
221
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
217
222
 
218
- ```python
219
- import pulumi
223
+ ```
224
+ 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.
220
225
  ```
221
226
  """
222
227
  return pulumi.get(self, "user_defined_value_function")
@@ -245,12 +250,12 @@ class _AlertConditionState:
245
250
  def __init__(__self__, *,
246
251
  condition_scope: Optional[pulumi.Input[str]] = None,
247
252
  enabled: Optional[pulumi.Input[bool]] = None,
248
- entities: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
253
+ entities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
249
254
  entity_guid: Optional[pulumi.Input[str]] = None,
250
255
  gc_metric: Optional[pulumi.Input[str]] = None,
251
256
  metric: Optional[pulumi.Input[str]] = None,
252
257
  name: Optional[pulumi.Input[str]] = None,
253
- policy_id: Optional[pulumi.Input[int]] = None,
258
+ policy_id: Optional[pulumi.Input[str]] = None,
254
259
  runbook_url: Optional[pulumi.Input[str]] = None,
255
260
  terms: Optional[pulumi.Input[Sequence[pulumi.Input['AlertConditionTermArgs']]]] = None,
256
261
  type: Optional[pulumi.Input[str]] = None,
@@ -261,12 +266,12 @@ class _AlertConditionState:
261
266
  Input properties used for looking up and filtering AlertCondition resources.
262
267
  :param pulumi.Input[str] condition_scope: `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances).
263
268
  :param pulumi.Input[bool] enabled: Whether the condition is enabled or not. Defaults to true.
264
- :param pulumi.Input[Sequence[pulumi.Input[int]]] entities: The instance IDs associated with this condition.
269
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] entities: The instance IDs associated with this condition.
265
270
  :param pulumi.Input[str] entity_guid: The unique entity identifier of the condition in New Relic.
266
271
  :param pulumi.Input[str] gc_metric: A valid Garbage Collection metric e.g. `GC/G1 Young Generation`.
267
272
  :param pulumi.Input[str] metric: The metric field accepts parameters based on the `type` set. One of these metrics based on `type`:
268
273
  :param pulumi.Input[str] name: The title of the condition. Must be between 1 and 64 characters, inclusive.
269
- :param pulumi.Input[int] policy_id: The ID of the policy where this condition should be used.
274
+ :param pulumi.Input[str] policy_id: The ID of the policy where this condition should be used.
270
275
  :param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
271
276
  :param pulumi.Input[Sequence[pulumi.Input['AlertConditionTermArgs']]] terms: A list of terms for this condition. See Terms below for details.
272
277
  :param pulumi.Input[str] type: The type of condition. One of: `apm_app_metric`, `apm_jvm_metric`, `apm_kt_metric`, `browser_metric`, `mobile_metric`
@@ -275,8 +280,8 @@ class _AlertConditionState:
275
280
 
276
281
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
277
282
 
278
- ```python
279
- import pulumi
283
+ ```
284
+ 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.
280
285
  ```
281
286
  :param pulumi.Input[int] violation_close_timer: Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift:
282
287
  * when `type` = `apm_app_metric` and `condition_scope` = `instance`
@@ -337,14 +342,14 @@ class _AlertConditionState:
337
342
 
338
343
  @property
339
344
  @pulumi.getter
340
- def entities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
345
+ def entities(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
341
346
  """
342
347
  The instance IDs associated with this condition.
343
348
  """
344
349
  return pulumi.get(self, "entities")
345
350
 
346
351
  @entities.setter
347
- def entities(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
352
+ def entities(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
348
353
  pulumi.set(self, "entities", value)
349
354
 
350
355
  @property
@@ -397,14 +402,14 @@ class _AlertConditionState:
397
402
 
398
403
  @property
399
404
  @pulumi.getter(name="policyId")
400
- def policy_id(self) -> Optional[pulumi.Input[int]]:
405
+ def policy_id(self) -> Optional[pulumi.Input[str]]:
401
406
  """
402
407
  The ID of the policy where this condition should be used.
403
408
  """
404
409
  return pulumi.get(self, "policy_id")
405
410
 
406
411
  @policy_id.setter
407
- def policy_id(self, value: Optional[pulumi.Input[int]]):
412
+ def policy_id(self, value: Optional[pulumi.Input[str]]):
408
413
  pulumi.set(self, "policy_id", value)
409
414
 
410
415
  @property
@@ -463,8 +468,8 @@ class _AlertConditionState:
463
468
 
464
469
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
465
470
 
466
- ```python
467
- import pulumi
471
+ ```
472
+ 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.
468
473
  ```
469
474
  """
470
475
  return pulumi.get(self, "user_defined_value_function")
@@ -495,13 +500,13 @@ class AlertCondition(pulumi.CustomResource):
495
500
  opts: Optional[pulumi.ResourceOptions] = None,
496
501
  condition_scope: Optional[pulumi.Input[str]] = None,
497
502
  enabled: Optional[pulumi.Input[bool]] = None,
498
- entities: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
503
+ entities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
499
504
  gc_metric: Optional[pulumi.Input[str]] = None,
500
505
  metric: Optional[pulumi.Input[str]] = None,
501
506
  name: Optional[pulumi.Input[str]] = None,
502
- policy_id: Optional[pulumi.Input[int]] = None,
507
+ policy_id: Optional[pulumi.Input[str]] = None,
503
508
  runbook_url: Optional[pulumi.Input[str]] = None,
504
- terms: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AlertConditionTermArgs']]]]] = None,
509
+ terms: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AlertConditionTermArgs', 'AlertConditionTermArgsDict']]]]] = None,
505
510
  type: Optional[pulumi.Input[str]] = None,
506
511
  user_defined_metric: Optional[pulumi.Input[str]] = None,
507
512
  user_defined_value_function: Optional[pulumi.Input[str]] = None,
@@ -521,22 +526,24 @@ class AlertCondition(pulumi.CustomResource):
521
526
  app = newrelic.get_entity(name="my-app",
522
527
  type="APPLICATION",
523
528
  domain="APM")
524
- foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
525
- foo_alert_condition = newrelic.AlertCondition("fooAlertCondition",
526
- policy_id=foo_alert_policy.id,
529
+ foo = newrelic.AlertPolicy("foo", name="foo")
530
+ foo_alert_condition = newrelic.AlertCondition("foo",
531
+ policy_id=foo.id,
532
+ name="foo",
527
533
  type="apm_app_metric",
528
534
  entities=[app.application_id],
529
535
  metric="apdex",
530
536
  runbook_url="https://www.example.com",
531
537
  condition_scope="application",
532
- terms=[newrelic.AlertConditionTermArgs(
533
- duration=5,
534
- operator="below",
535
- priority="critical",
536
- threshold=0.75,
537
- time_function="all",
538
- )])
538
+ terms=[{
539
+ "duration": 5,
540
+ "operator": "below",
541
+ "priority": "critical",
542
+ "threshold": 0.75,
543
+ "time_function": "all",
544
+ }])
539
545
  ```
546
+
540
547
  ## Terms
541
548
 
542
549
  The `term` mapping supports the following arguments:
@@ -555,36 +562,37 @@ class AlertCondition(pulumi.CustomResource):
555
562
  import pulumi
556
563
  import pulumi_newrelic as newrelic
557
564
 
558
- foo_entity = newrelic.get_entity(name="foo entitiy")
559
- foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
560
- foo_alert_condition = newrelic.AlertCondition("fooAlertCondition",
565
+ foo = newrelic.get_entity(name="foo entitiy")
566
+ foo_alert_policy = newrelic.AlertPolicy("foo", name="foo policy")
567
+ foo_alert_condition = newrelic.AlertCondition("foo",
561
568
  policy_id=foo_alert_policy.id,
569
+ name="foo condition",
562
570
  type="apm_app_metric",
563
- entities=[foo_entity.application_id],
571
+ entities=[foo.application_id],
564
572
  metric="apdex",
565
573
  runbook_url="https://www.example.com",
566
574
  condition_scope="application",
567
- terms=[newrelic.AlertConditionTermArgs(
568
- duration=5,
569
- operator="below",
570
- priority="critical",
571
- threshold=0.75,
572
- time_function="all",
573
- )])
574
- my_condition_entity_tags = newrelic.EntityTags("myConditionEntityTags",
575
+ terms=[{
576
+ "duration": 5,
577
+ "operator": "below",
578
+ "priority": "critical",
579
+ "threshold": 0.75,
580
+ "time_function": "all",
581
+ }])
582
+ my_condition_entity_tags = newrelic.EntityTags("my_condition_entity_tags",
575
583
  guid=foo_alert_condition.entity_guid,
576
584
  tags=[
577
- newrelic.EntityTagsTagArgs(
578
- key="my-key",
579
- values=[
585
+ {
586
+ "key": "my-key",
587
+ "values": [
580
588
  "my-value",
581
589
  "my-other-value",
582
590
  ],
583
- ),
584
- newrelic.EntityTagsTagArgs(
585
- key="my-key-2",
586
- values=["my-value-2"],
587
- ),
591
+ },
592
+ {
593
+ "key": "my-key-2",
594
+ "values": ["my-value-2"],
595
+ },
588
596
  ])
589
597
  ```
590
598
 
@@ -593,28 +601,28 @@ class AlertCondition(pulumi.CustomResource):
593
601
  Alert conditions can be imported using notation `alert_policy_id:alert_condition_id`, e.g.
594
602
 
595
603
  ```sh
596
- $ pulumi import newrelic:index/alertCondition:AlertCondition main 123456:6789012345
604
+ $ pulumi import newrelic:index/alertCondition:AlertCondition main 123456:6789012345
597
605
  ```
598
606
 
599
607
  :param str resource_name: The name of the resource.
600
608
  :param pulumi.ResourceOptions opts: Options for the resource.
601
609
  :param pulumi.Input[str] condition_scope: `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances).
602
610
  :param pulumi.Input[bool] enabled: Whether the condition is enabled or not. Defaults to true.
603
- :param pulumi.Input[Sequence[pulumi.Input[int]]] entities: The instance IDs associated with this condition.
611
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] entities: The instance IDs associated with this condition.
604
612
  :param pulumi.Input[str] gc_metric: A valid Garbage Collection metric e.g. `GC/G1 Young Generation`.
605
613
  :param pulumi.Input[str] metric: The metric field accepts parameters based on the `type` set. One of these metrics based on `type`:
606
614
  :param pulumi.Input[str] name: The title of the condition. Must be between 1 and 64 characters, inclusive.
607
- :param pulumi.Input[int] policy_id: The ID of the policy where this condition should be used.
615
+ :param pulumi.Input[str] policy_id: The ID of the policy where this condition should be used.
608
616
  :param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
609
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AlertConditionTermArgs']]]] terms: A list of terms for this condition. See Terms below for details.
617
+ :param pulumi.Input[Sequence[pulumi.Input[Union['AlertConditionTermArgs', 'AlertConditionTermArgsDict']]]] terms: A list of terms for this condition. See Terms below for details.
610
618
  :param pulumi.Input[str] type: The type of condition. One of: `apm_app_metric`, `apm_jvm_metric`, `apm_kt_metric`, `browser_metric`, `mobile_metric`
611
619
  :param pulumi.Input[str] user_defined_metric: A custom metric to be evaluated.
612
620
  :param pulumi.Input[str] user_defined_value_function: One of: `average`, `min`, `max`, `total`, `sample_size`, `rate` or `percent`.
613
621
 
614
622
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
615
623
 
616
- ```python
617
- import pulumi
624
+ ```
625
+ 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.
618
626
  ```
619
627
  :param pulumi.Input[int] violation_close_timer: Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift:
620
628
  * when `type` = `apm_app_metric` and `condition_scope` = `instance`
@@ -640,22 +648,24 @@ class AlertCondition(pulumi.CustomResource):
640
648
  app = newrelic.get_entity(name="my-app",
641
649
  type="APPLICATION",
642
650
  domain="APM")
643
- foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
644
- foo_alert_condition = newrelic.AlertCondition("fooAlertCondition",
645
- policy_id=foo_alert_policy.id,
651
+ foo = newrelic.AlertPolicy("foo", name="foo")
652
+ foo_alert_condition = newrelic.AlertCondition("foo",
653
+ policy_id=foo.id,
654
+ name="foo",
646
655
  type="apm_app_metric",
647
656
  entities=[app.application_id],
648
657
  metric="apdex",
649
658
  runbook_url="https://www.example.com",
650
659
  condition_scope="application",
651
- terms=[newrelic.AlertConditionTermArgs(
652
- duration=5,
653
- operator="below",
654
- priority="critical",
655
- threshold=0.75,
656
- time_function="all",
657
- )])
660
+ terms=[{
661
+ "duration": 5,
662
+ "operator": "below",
663
+ "priority": "critical",
664
+ "threshold": 0.75,
665
+ "time_function": "all",
666
+ }])
658
667
  ```
668
+
659
669
  ## Terms
660
670
 
661
671
  The `term` mapping supports the following arguments:
@@ -674,36 +684,37 @@ class AlertCondition(pulumi.CustomResource):
674
684
  import pulumi
675
685
  import pulumi_newrelic as newrelic
676
686
 
677
- foo_entity = newrelic.get_entity(name="foo entitiy")
678
- foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
679
- foo_alert_condition = newrelic.AlertCondition("fooAlertCondition",
687
+ foo = newrelic.get_entity(name="foo entitiy")
688
+ foo_alert_policy = newrelic.AlertPolicy("foo", name="foo policy")
689
+ foo_alert_condition = newrelic.AlertCondition("foo",
680
690
  policy_id=foo_alert_policy.id,
691
+ name="foo condition",
681
692
  type="apm_app_metric",
682
- entities=[foo_entity.application_id],
693
+ entities=[foo.application_id],
683
694
  metric="apdex",
684
695
  runbook_url="https://www.example.com",
685
696
  condition_scope="application",
686
- terms=[newrelic.AlertConditionTermArgs(
687
- duration=5,
688
- operator="below",
689
- priority="critical",
690
- threshold=0.75,
691
- time_function="all",
692
- )])
693
- my_condition_entity_tags = newrelic.EntityTags("myConditionEntityTags",
697
+ terms=[{
698
+ "duration": 5,
699
+ "operator": "below",
700
+ "priority": "critical",
701
+ "threshold": 0.75,
702
+ "time_function": "all",
703
+ }])
704
+ my_condition_entity_tags = newrelic.EntityTags("my_condition_entity_tags",
694
705
  guid=foo_alert_condition.entity_guid,
695
706
  tags=[
696
- newrelic.EntityTagsTagArgs(
697
- key="my-key",
698
- values=[
707
+ {
708
+ "key": "my-key",
709
+ "values": [
699
710
  "my-value",
700
711
  "my-other-value",
701
712
  ],
702
- ),
703
- newrelic.EntityTagsTagArgs(
704
- key="my-key-2",
705
- values=["my-value-2"],
706
- ),
713
+ },
714
+ {
715
+ "key": "my-key-2",
716
+ "values": ["my-value-2"],
717
+ },
707
718
  ])
708
719
  ```
709
720
 
@@ -712,7 +723,7 @@ class AlertCondition(pulumi.CustomResource):
712
723
  Alert conditions can be imported using notation `alert_policy_id:alert_condition_id`, e.g.
713
724
 
714
725
  ```sh
715
- $ pulumi import newrelic:index/alertCondition:AlertCondition main 123456:6789012345
726
+ $ pulumi import newrelic:index/alertCondition:AlertCondition main 123456:6789012345
716
727
  ```
717
728
 
718
729
  :param str resource_name: The name of the resource.
@@ -732,13 +743,13 @@ class AlertCondition(pulumi.CustomResource):
732
743
  opts: Optional[pulumi.ResourceOptions] = None,
733
744
  condition_scope: Optional[pulumi.Input[str]] = None,
734
745
  enabled: Optional[pulumi.Input[bool]] = None,
735
- entities: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
746
+ entities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
736
747
  gc_metric: Optional[pulumi.Input[str]] = None,
737
748
  metric: Optional[pulumi.Input[str]] = None,
738
749
  name: Optional[pulumi.Input[str]] = None,
739
- policy_id: Optional[pulumi.Input[int]] = None,
750
+ policy_id: Optional[pulumi.Input[str]] = None,
740
751
  runbook_url: Optional[pulumi.Input[str]] = None,
741
- terms: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AlertConditionTermArgs']]]]] = None,
752
+ terms: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AlertConditionTermArgs', 'AlertConditionTermArgsDict']]]]] = None,
742
753
  type: Optional[pulumi.Input[str]] = None,
743
754
  user_defined_metric: Optional[pulumi.Input[str]] = None,
744
755
  user_defined_value_function: Optional[pulumi.Input[str]] = None,
@@ -788,14 +799,14 @@ class AlertCondition(pulumi.CustomResource):
788
799
  opts: Optional[pulumi.ResourceOptions] = None,
789
800
  condition_scope: Optional[pulumi.Input[str]] = None,
790
801
  enabled: Optional[pulumi.Input[bool]] = None,
791
- entities: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
802
+ entities: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
792
803
  entity_guid: Optional[pulumi.Input[str]] = None,
793
804
  gc_metric: Optional[pulumi.Input[str]] = None,
794
805
  metric: Optional[pulumi.Input[str]] = None,
795
806
  name: Optional[pulumi.Input[str]] = None,
796
- policy_id: Optional[pulumi.Input[int]] = None,
807
+ policy_id: Optional[pulumi.Input[str]] = None,
797
808
  runbook_url: Optional[pulumi.Input[str]] = None,
798
- terms: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AlertConditionTermArgs']]]]] = None,
809
+ terms: Optional[pulumi.Input[Sequence[pulumi.Input[Union['AlertConditionTermArgs', 'AlertConditionTermArgsDict']]]]] = None,
799
810
  type: Optional[pulumi.Input[str]] = None,
800
811
  user_defined_metric: Optional[pulumi.Input[str]] = None,
801
812
  user_defined_value_function: Optional[pulumi.Input[str]] = None,
@@ -809,22 +820,22 @@ class AlertCondition(pulumi.CustomResource):
809
820
  :param pulumi.ResourceOptions opts: Options for the resource.
810
821
  :param pulumi.Input[str] condition_scope: `application` or `instance`. Choose `application` for most scenarios. If you are using the JVM plugin in New Relic, the `instance` setting allows your condition to trigger [for specific app instances](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/scope-alert-thresholds-specific-instances).
811
822
  :param pulumi.Input[bool] enabled: Whether the condition is enabled or not. Defaults to true.
812
- :param pulumi.Input[Sequence[pulumi.Input[int]]] entities: The instance IDs associated with this condition.
823
+ :param pulumi.Input[Sequence[pulumi.Input[str]]] entities: The instance IDs associated with this condition.
813
824
  :param pulumi.Input[str] entity_guid: The unique entity identifier of the condition in New Relic.
814
825
  :param pulumi.Input[str] gc_metric: A valid Garbage Collection metric e.g. `GC/G1 Young Generation`.
815
826
  :param pulumi.Input[str] metric: The metric field accepts parameters based on the `type` set. One of these metrics based on `type`:
816
827
  :param pulumi.Input[str] name: The title of the condition. Must be between 1 and 64 characters, inclusive.
817
- :param pulumi.Input[int] policy_id: The ID of the policy where this condition should be used.
828
+ :param pulumi.Input[str] policy_id: The ID of the policy where this condition should be used.
818
829
  :param pulumi.Input[str] runbook_url: Runbook URL to display in notifications.
819
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AlertConditionTermArgs']]]] terms: A list of terms for this condition. See Terms below for details.
830
+ :param pulumi.Input[Sequence[pulumi.Input[Union['AlertConditionTermArgs', 'AlertConditionTermArgsDict']]]] terms: A list of terms for this condition. See Terms below for details.
820
831
  :param pulumi.Input[str] type: The type of condition. One of: `apm_app_metric`, `apm_jvm_metric`, `apm_kt_metric`, `browser_metric`, `mobile_metric`
821
832
  :param pulumi.Input[str] user_defined_metric: A custom metric to be evaluated.
822
833
  :param pulumi.Input[str] user_defined_value_function: One of: `average`, `min`, `max`, `total`, `sample_size`, `rate` or `percent`.
823
834
 
824
835
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
825
836
 
826
- ```python
827
- import pulumi
837
+ ```
838
+ 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.
828
839
  ```
829
840
  :param pulumi.Input[int] violation_close_timer: Automatically close instance-based incidents, including JVM health metric incidents, after the number of hours specified. Must be between 1 and 720 hours. Must be specified in the following two cases, to prevent drift:
830
841
  * when `type` = `apm_app_metric` and `condition_scope` = `instance`
@@ -868,7 +879,7 @@ class AlertCondition(pulumi.CustomResource):
868
879
 
869
880
  @property
870
881
  @pulumi.getter
871
- def entities(self) -> pulumi.Output[Sequence[int]]:
882
+ def entities(self) -> pulumi.Output[Sequence[str]]:
872
883
  """
873
884
  The instance IDs associated with this condition.
874
885
  """
@@ -908,7 +919,7 @@ class AlertCondition(pulumi.CustomResource):
908
919
 
909
920
  @property
910
921
  @pulumi.getter(name="policyId")
911
- def policy_id(self) -> pulumi.Output[int]:
922
+ def policy_id(self) -> pulumi.Output[str]:
912
923
  """
913
924
  The ID of the policy where this condition should be used.
914
925
  """
@@ -954,8 +965,8 @@ class AlertCondition(pulumi.CustomResource):
954
965
 
955
966
  > **NOTE:** The `user_defined_value_function` can have `rate` or `percent` only when the `type` is `mobile_metric`.
956
967
 
957
- ```python
958
- import pulumi
968
+ ```
969
+ 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.
959
970
  ```
960
971
  """
961
972
  return pulumi.get(self, "user_defined_value_function")