pulumi-newrelic 5.16.0a1698964311__py3-none-any.whl → 5.58.0a1763707205__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pulumi-newrelic might be problematic. Click here for more details.

Files changed (92) hide show
  1. pulumi_newrelic/__init__.py +58 -1
  2. pulumi_newrelic/_inputs.py +10772 -2775
  3. pulumi_newrelic/_utilities.py +92 -11
  4. pulumi_newrelic/account_management.py +56 -42
  5. pulumi_newrelic/alert_channel.py +177 -151
  6. pulumi_newrelic/alert_condition.py +313 -301
  7. pulumi_newrelic/alert_muting_rule.py +195 -138
  8. pulumi_newrelic/alert_policy.py +157 -109
  9. pulumi_newrelic/alert_policy_channel.py +95 -81
  10. pulumi_newrelic/api_access_key.py +191 -209
  11. pulumi_newrelic/browser_application.py +161 -153
  12. pulumi_newrelic/cloud/__init__.py +3 -1
  13. pulumi_newrelic/cloud/_inputs.py +4267 -2710
  14. pulumi_newrelic/cloud/aws_govcloud_integrations.py +238 -200
  15. pulumi_newrelic/cloud/aws_govcloud_link_account.py +159 -212
  16. pulumi_newrelic/cloud/aws_integrations.py +518 -1490
  17. pulumi_newrelic/cloud/aws_link_account.py +88 -76
  18. pulumi_newrelic/cloud/azure_integrations.py +681 -587
  19. pulumi_newrelic/cloud/azure_link_account.py +129 -117
  20. pulumi_newrelic/cloud/gcp_integrations.py +436 -408
  21. pulumi_newrelic/cloud/gcp_link_account.py +71 -59
  22. pulumi_newrelic/cloud/oci_link_account.py +926 -0
  23. pulumi_newrelic/cloud/outputs.py +1678 -2317
  24. pulumi_newrelic/config/__init__.py +2 -1
  25. pulumi_newrelic/config/__init__.pyi +45 -0
  26. pulumi_newrelic/config/vars.py +22 -17
  27. pulumi_newrelic/data_partition_rule.py +129 -117
  28. pulumi_newrelic/entity_tags.py +153 -31
  29. pulumi_newrelic/events_to_metrics_rule.py +114 -102
  30. pulumi_newrelic/get_account.py +41 -29
  31. pulumi_newrelic/get_alert_channel.py +73 -28
  32. pulumi_newrelic/get_alert_policy.py +83 -34
  33. pulumi_newrelic/get_application.py +51 -39
  34. pulumi_newrelic/get_authentication_domain.py +111 -0
  35. pulumi_newrelic/get_cloud_account.py +43 -31
  36. pulumi_newrelic/get_entity.py +126 -121
  37. pulumi_newrelic/get_group.py +190 -0
  38. pulumi_newrelic/get_key_transaction.py +117 -38
  39. pulumi_newrelic/get_notification_destination.py +86 -36
  40. pulumi_newrelic/get_obfuscation_expression.py +47 -35
  41. pulumi_newrelic/get_service_level_alert_helper.py +237 -137
  42. pulumi_newrelic/get_test_grok_pattern.py +47 -32
  43. pulumi_newrelic/get_user.py +165 -0
  44. pulumi_newrelic/group.py +286 -0
  45. pulumi_newrelic/infra_alert_condition.py +400 -382
  46. pulumi_newrelic/insights/__init__.py +2 -1
  47. pulumi_newrelic/insights/_inputs.py +94 -23
  48. pulumi_newrelic/insights/event.py +56 -48
  49. pulumi_newrelic/insights/outputs.py +51 -18
  50. pulumi_newrelic/key_transaction.py +465 -0
  51. pulumi_newrelic/log_parsing_rule.py +169 -153
  52. pulumi_newrelic/monitor_downtime.py +914 -0
  53. pulumi_newrelic/notification_channel.py +560 -418
  54. pulumi_newrelic/notification_destination.py +379 -124
  55. pulumi_newrelic/nrql_alert_condition.py +945 -513
  56. pulumi_newrelic/nrql_drop_rule.py +121 -129
  57. pulumi_newrelic/obfuscation_expression.py +88 -76
  58. pulumi_newrelic/obfuscation_rule.py +123 -109
  59. pulumi_newrelic/one_dashboard.py +118 -108
  60. pulumi_newrelic/one_dashboard_json.py +77 -67
  61. pulumi_newrelic/one_dashboard_raw.py +214 -202
  62. pulumi_newrelic/outputs.py +5491 -2141
  63. pulumi_newrelic/pipeline_cloud_rule.py +335 -0
  64. pulumi_newrelic/plugins/__init__.py +2 -1
  65. pulumi_newrelic/plugins/_inputs.py +520 -90
  66. pulumi_newrelic/plugins/application_settings.py +463 -167
  67. pulumi_newrelic/plugins/outputs.py +337 -75
  68. pulumi_newrelic/plugins/workload.py +387 -151
  69. pulumi_newrelic/provider.py +156 -142
  70. pulumi_newrelic/pulumi-plugin.json +2 -1
  71. pulumi_newrelic/service_level.py +277 -255
  72. pulumi_newrelic/synthetics/__init__.py +2 -1
  73. pulumi_newrelic/synthetics/_inputs.py +275 -106
  74. pulumi_newrelic/synthetics/alert_condition.py +174 -160
  75. pulumi_newrelic/synthetics/broken_links_monitor.py +367 -207
  76. pulumi_newrelic/synthetics/cert_check_monitor.py +380 -218
  77. pulumi_newrelic/synthetics/get_private_location.py +51 -39
  78. pulumi_newrelic/synthetics/get_secure_credential.py +39 -27
  79. pulumi_newrelic/synthetics/monitor.py +668 -462
  80. pulumi_newrelic/synthetics/multi_location_alert_condition.py +219 -201
  81. pulumi_newrelic/synthetics/outputs.py +102 -85
  82. pulumi_newrelic/synthetics/private_location.py +120 -110
  83. pulumi_newrelic/synthetics/script_monitor.py +623 -375
  84. pulumi_newrelic/synthetics/secure_credential.py +99 -93
  85. pulumi_newrelic/synthetics/step_monitor.py +545 -201
  86. pulumi_newrelic/user.py +366 -0
  87. pulumi_newrelic/workflow.py +348 -312
  88. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/METADATA +8 -7
  89. pulumi_newrelic-5.58.0a1763707205.dist-info/RECORD +92 -0
  90. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/WHEEL +1 -1
  91. pulumi_newrelic-5.16.0a1698964311.dist-info/RECORD +0 -82
  92. {pulumi_newrelic-5.16.0a1698964311.dist-info → pulumi_newrelic-5.58.0a1763707205.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,17 @@
1
1
  # coding=utf-8
2
- # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
2
+ # *** WARNING: this file was generated by pulumi-language-python. ***
3
3
  # *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
 
5
- import copy
5
+ import builtins as _builtins
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
 
12
17
  __all__ = [
@@ -59,76 +64,76 @@ class GetServiceLevelAlertHelperResult:
59
64
  raise TypeError("Expected argument 'tolerated_budget_consumption' to be a float")
60
65
  pulumi.set(__self__, "tolerated_budget_consumption", tolerated_budget_consumption)
61
66
 
62
- @property
67
+ @_builtins.property
63
68
  @pulumi.getter(name="alertType")
64
- def alert_type(self) -> str:
69
+ def alert_type(self) -> _builtins.str:
65
70
  return pulumi.get(self, "alert_type")
66
71
 
67
- @property
72
+ @_builtins.property
68
73
  @pulumi.getter(name="customEvaluationPeriod")
69
- def custom_evaluation_period(self) -> Optional[int]:
74
+ def custom_evaluation_period(self) -> Optional[_builtins.int]:
70
75
  return pulumi.get(self, "custom_evaluation_period")
71
76
 
72
- @property
77
+ @_builtins.property
73
78
  @pulumi.getter(name="customToleratedBudgetConsumption")
74
- def custom_tolerated_budget_consumption(self) -> Optional[float]:
79
+ def custom_tolerated_budget_consumption(self) -> Optional[_builtins.float]:
75
80
  return pulumi.get(self, "custom_tolerated_budget_consumption")
76
81
 
77
- @property
82
+ @_builtins.property
78
83
  @pulumi.getter(name="evaluationPeriod")
79
- def evaluation_period(self) -> int:
84
+ def evaluation_period(self) -> _builtins.int:
80
85
  """
81
86
  (Computed) For non `custom` alert_type, this is the recommended for that type of alert. For `custom` alert_type it has the same value as `custom_evaluation_period`.
82
87
  """
83
88
  return pulumi.get(self, "evaluation_period")
84
89
 
85
- @property
90
+ @_builtins.property
86
91
  @pulumi.getter
87
- def id(self) -> str:
92
+ def id(self) -> _builtins.str:
88
93
  """
89
94
  The provider-assigned unique ID for this managed resource.
90
95
  """
91
96
  return pulumi.get(self, "id")
92
97
 
93
- @property
98
+ @_builtins.property
94
99
  @pulumi.getter(name="isBadEvents")
95
- def is_bad_events(self) -> Optional[bool]:
100
+ def is_bad_events(self) -> Optional[_builtins.bool]:
96
101
  return pulumi.get(self, "is_bad_events")
97
102
 
98
- @property
103
+ @_builtins.property
99
104
  @pulumi.getter
100
- def nrql(self) -> str:
105
+ def nrql(self) -> _builtins.str:
101
106
  """
102
107
  (Computed) The nrql query for the selected type of alert.
103
108
  """
104
109
  return pulumi.get(self, "nrql")
105
110
 
106
- @property
111
+ @_builtins.property
107
112
  @pulumi.getter(name="sliGuid")
108
- def sli_guid(self) -> str:
113
+ def sli_guid(self) -> _builtins.str:
109
114
  return pulumi.get(self, "sli_guid")
110
115
 
111
- @property
116
+ @_builtins.property
112
117
  @pulumi.getter(name="sloPeriod")
113
- def slo_period(self) -> int:
118
+ def slo_period(self) -> _builtins.int:
114
119
  return pulumi.get(self, "slo_period")
115
120
 
116
- @property
121
+ @_builtins.property
117
122
  @pulumi.getter(name="sloTarget")
118
- def slo_target(self) -> float:
123
+ def slo_target(self) -> _builtins.float:
119
124
  return pulumi.get(self, "slo_target")
120
125
 
121
- @property
126
+ @_builtins.property
122
127
  @pulumi.getter
123
- def threshold(self) -> float:
128
+ def threshold(self) -> _builtins.float:
124
129
  """
125
130
  (Computed) The computed threshold given the provided arguments.
126
131
  """
127
132
  return pulumi.get(self, "threshold")
128
133
 
129
- @property
134
+ @_builtins.property
130
135
  @pulumi.getter(name="toleratedBudgetConsumption")
131
- def tolerated_budget_consumption(self) -> float:
136
+ def tolerated_budget_consumption(self) -> _builtins.float:
132
137
  """
133
138
  (Computed) For non `custom` alert_type, this is the recommended for that type of alert. For `custom` alert_type it has the same value as `custom_tolerated_budget_consumption`.
134
139
  """
@@ -155,16 +160,16 @@ class AwaitableGetServiceLevelAlertHelperResult(GetServiceLevelAlertHelperResult
155
160
  tolerated_budget_consumption=self.tolerated_budget_consumption)
156
161
 
157
162
 
158
- def get_service_level_alert_helper(alert_type: Optional[str] = None,
159
- custom_evaluation_period: Optional[int] = None,
160
- custom_tolerated_budget_consumption: Optional[float] = None,
161
- is_bad_events: Optional[bool] = None,
162
- sli_guid: Optional[str] = None,
163
- slo_period: Optional[int] = None,
164
- slo_target: Optional[float] = None,
163
+ def get_service_level_alert_helper(alert_type: Optional[_builtins.str] = None,
164
+ custom_evaluation_period: Optional[_builtins.int] = None,
165
+ custom_tolerated_budget_consumption: Optional[_builtins.float] = None,
166
+ is_bad_events: Optional[_builtins.bool] = None,
167
+ sli_guid: Optional[_builtins.str] = None,
168
+ slo_period: Optional[_builtins.int] = None,
169
+ slo_target: Optional[_builtins.float] = None,
165
170
  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceLevelAlertHelperResult:
166
171
  """
167
- Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
172
+ Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn` or `slow_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
168
173
 
169
174
  ## Example Usage
170
175
 
@@ -178,73 +183,111 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
178
183
  foo_period = 28
179
184
  foo = newrelic.ServiceLevel("foo",
180
185
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
186
+ name="Latency",
181
187
  description="Proportion of requests that are served faster than a threshold.",
182
- events=newrelic.ServiceLevelEventsArgs(
183
- account_id=12345678,
184
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
185
- from_="Transaction",
186
- where="appName = 'Example application' AND (transactionType='Web')",
187
- ),
188
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
189
- from_="Transaction",
190
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
191
- ),
192
- ),
193
- objective=newrelic.ServiceLevelObjectiveArgs(
194
- target=foo_target,
195
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
196
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
197
- count=foo_period,
198
- unit="DAY",
199
- ),
200
- ),
201
- ))
188
+ events={
189
+ "account_id": "12345678",
190
+ "valid_events": {
191
+ "from_": "Transaction",
192
+ "where": "appName = 'Example application' AND (transactionType='Web')",
193
+ },
194
+ "bad_events": {
195
+ "from_": "Transaction",
196
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
197
+ },
198
+ },
199
+ objective={
200
+ "target": foo_target,
201
+ "time_window": {
202
+ "rolling": {
203
+ "count": foo_period,
204
+ "unit": "DAY",
205
+ },
206
+ },
207
+ })
202
208
  ```
203
209
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
204
210
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
205
211
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
206
212
 
213
+ Here is an example of a `slow_burn` alert.
214
+
215
+ ```python
216
+ import pulumi
217
+ import pulumi_newrelic as newrelic
218
+
219
+ foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
220
+ sli_guid=foo["sliGuid"],
221
+ slo_target=foo_target,
222
+ slo_period=foo_period,
223
+ is_bad_events=True)
224
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
225
+ account_id="12345678",
226
+ policy_id="67890",
227
+ type="static",
228
+ name="Slow burn alert",
229
+ enabled=True,
230
+ violation_time_limit_seconds=259200,
231
+ nrql={
232
+ "query": foo_slow_burn.nrql,
233
+ },
234
+ critical={
235
+ "operator": "above_or_equals",
236
+ "threshold": foo_slow_burn.threshold,
237
+ "threshold_duration": 900,
238
+ "threshold_occurrences": "at_least_once",
239
+ },
240
+ fill_option="none",
241
+ aggregation_window=foo_slow_burn.evaluation_period,
242
+ aggregation_method="event_flow",
243
+ aggregation_delay="120",
244
+ slide_by=900)
245
+ ```
246
+
247
+ Here is an example of a custom alert:
248
+
207
249
  ```python
208
250
  import pulumi
209
251
  import pulumi_newrelic as newrelic
210
252
 
211
253
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
212
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
213
- slo_target=local["foo_target"],
214
- slo_period=local["foo_period"],
215
- custom_tolerated_budget_consumption=5,
216
- custom_evaluation_period=90,
254
+ sli_guid=foo["sliGuid"],
255
+ slo_target=foo_target,
256
+ slo_period=foo_period,
257
+ custom_tolerated_budget_consumption=4,
258
+ custom_evaluation_period=5400,
217
259
  is_bad_events=True)
218
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
219
- account_id=12345678,
220
- policy_id=67890,
260
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
261
+ account_id="12345678",
262
+ policy_id="67890",
221
263
  type="static",
264
+ name="Custom burn alert",
222
265
  enabled=True,
223
266
  violation_time_limit_seconds=259200,
224
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
225
- query=foo_custom.nrql,
226
- ),
227
- critical=newrelic.NrqlAlertConditionCriticalArgs(
228
- operator="above_or_equals",
229
- threshold=foo_custom.threshold,
230
- threshold_duration=foo_custom.evaluation_period,
231
- threshold_occurrences="at_least_once",
232
- ),
267
+ nrql={
268
+ "query": foo_custom.nrql,
269
+ },
270
+ critical={
271
+ "operator": "above_or_equals",
272
+ "threshold": foo_custom.threshold,
273
+ "threshold_duration": 900,
274
+ "threshold_occurrences": "at_least_once",
275
+ },
233
276
  fill_option="none",
234
- aggregation_window=3600,
277
+ aggregation_window=foo_custom.evaluation_period,
235
278
  aggregation_method="event_flow",
236
279
  aggregation_delay="120",
237
280
  slide_by=60)
238
281
  ```
239
282
 
240
283
 
241
- :param str alert_type: The type of alert we want to set. Valid values are:
242
- :param int custom_evaluation_period: Aggregation window taken into consideration in minutes. Mandatory if `alert_type` is `custom`.
243
- :param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
244
- :param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
245
- :param str sli_guid: The guid of the sli we want to set the alert on.
246
- :param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
247
- :param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
284
+ :param _builtins.str alert_type: The type of alert we want to set. Valid values are:
285
+ :param _builtins.int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
286
+ :param _builtins.float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
287
+ :param _builtins.bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
288
+ :param _builtins.str sli_guid: The guid of the sli we want to set the alert on.
289
+ :param _builtins.int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
290
+ :param _builtins.float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
248
291
  """
249
292
  __args__ = dict()
250
293
  __args__['alertType'] = alert_type
@@ -270,19 +313,16 @@ def get_service_level_alert_helper(alert_type: Optional[str] = None,
270
313
  slo_target=pulumi.get(__ret__, 'slo_target'),
271
314
  threshold=pulumi.get(__ret__, 'threshold'),
272
315
  tolerated_budget_consumption=pulumi.get(__ret__, 'tolerated_budget_consumption'))
273
-
274
-
275
- @_utilities.lift_output_func(get_service_level_alert_helper)
276
- def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]] = None,
277
- custom_evaluation_period: Optional[pulumi.Input[Optional[int]]] = None,
278
- custom_tolerated_budget_consumption: Optional[pulumi.Input[Optional[float]]] = None,
279
- is_bad_events: Optional[pulumi.Input[Optional[bool]]] = None,
280
- sli_guid: Optional[pulumi.Input[str]] = None,
281
- slo_period: Optional[pulumi.Input[int]] = None,
282
- slo_target: Optional[pulumi.Input[float]] = None,
283
- opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
316
+ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[_builtins.str]] = None,
317
+ custom_evaluation_period: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
318
+ custom_tolerated_budget_consumption: Optional[pulumi.Input[Optional[_builtins.float]]] = None,
319
+ is_bad_events: Optional[pulumi.Input[Optional[_builtins.bool]]] = None,
320
+ sli_guid: Optional[pulumi.Input[_builtins.str]] = None,
321
+ slo_period: Optional[pulumi.Input[_builtins.int]] = None,
322
+ slo_target: Optional[pulumi.Input[_builtins.float]] = None,
323
+ opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServiceLevelAlertHelperResult]:
284
324
  """
285
- Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
325
+ Use this data source to obtain the necessary fields to set up alerts on your service levels. It can be used for a `custom` alert_type in order to set up an alert with custom tolerated budget consumption and custom evaluation period or for recommended ones like `fast_burn` or `slow_burn`. For more information check [the documentation](https://docs.newrelic.com/docs/service-level-management/alerts-slm/).
286
326
 
287
327
  ## Example Usage
288
328
 
@@ -296,72 +336,132 @@ def get_service_level_alert_helper_output(alert_type: Optional[pulumi.Input[str]
296
336
  foo_period = 28
297
337
  foo = newrelic.ServiceLevel("foo",
298
338
  guid="MXxBUE18QVBQTElDQVRJT058MQ",
339
+ name="Latency",
299
340
  description="Proportion of requests that are served faster than a threshold.",
300
- events=newrelic.ServiceLevelEventsArgs(
301
- account_id=12345678,
302
- valid_events=newrelic.ServiceLevelEventsValidEventsArgs(
303
- from_="Transaction",
304
- where="appName = 'Example application' AND (transactionType='Web')",
305
- ),
306
- bad_events=newrelic.ServiceLevelEventsBadEventsArgs(
307
- from_="Transaction",
308
- where="appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
309
- ),
310
- ),
311
- objective=newrelic.ServiceLevelObjectiveArgs(
312
- target=foo_target,
313
- time_window=newrelic.ServiceLevelObjectiveTimeWindowArgs(
314
- rolling=newrelic.ServiceLevelObjectiveTimeWindowRollingArgs(
315
- count=foo_period,
316
- unit="DAY",
317
- ),
318
- ),
319
- ))
341
+ events={
342
+ "account_id": "12345678",
343
+ "valid_events": {
344
+ "from_": "Transaction",
345
+ "where": "appName = 'Example application' AND (transactionType='Web')",
346
+ },
347
+ "bad_events": {
348
+ "from_": "Transaction",
349
+ "where": "appName = 'Example application' AND (transactionType= 'Web') AND duration > 0.1",
350
+ },
351
+ },
352
+ objective={
353
+ "target": foo_target,
354
+ "time_window": {
355
+ "rolling": {
356
+ "count": foo_period,
357
+ "unit": "DAY",
358
+ },
359
+ },
360
+ })
320
361
  ```
321
362
  Then use the helper to obtain the necessary fields to set up an alert on that Service Level.
322
363
  Note that the Service Level was set up using bad events, that's why `is_bad_events` is set to `true`.
323
364
  If the Service Level was configured with good events that would be unnecessary as the field defaults to `false`.
324
365
 
366
+ Here is an example of a `slow_burn` alert.
367
+
368
+ ```python
369
+ import pulumi
370
+ import pulumi_newrelic as newrelic
371
+
372
+ foo_slow_burn = newrelic.get_service_level_alert_helper(alert_type="slow_burn",
373
+ sli_guid=foo["sliGuid"],
374
+ slo_target=foo_target,
375
+ slo_period=foo_period,
376
+ is_bad_events=True)
377
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
378
+ account_id="12345678",
379
+ policy_id="67890",
380
+ type="static",
381
+ name="Slow burn alert",
382
+ enabled=True,
383
+ violation_time_limit_seconds=259200,
384
+ nrql={
385
+ "query": foo_slow_burn.nrql,
386
+ },
387
+ critical={
388
+ "operator": "above_or_equals",
389
+ "threshold": foo_slow_burn.threshold,
390
+ "threshold_duration": 900,
391
+ "threshold_occurrences": "at_least_once",
392
+ },
393
+ fill_option="none",
394
+ aggregation_window=foo_slow_burn.evaluation_period,
395
+ aggregation_method="event_flow",
396
+ aggregation_delay="120",
397
+ slide_by=900)
398
+ ```
399
+
400
+ Here is an example of a custom alert:
401
+
325
402
  ```python
326
403
  import pulumi
327
404
  import pulumi_newrelic as newrelic
328
405
 
329
406
  foo_custom = newrelic.get_service_level_alert_helper(alert_type="custom",
330
- sli_guid=newrelic_service_level["foo"]["sli_guid"],
331
- slo_target=local["foo_target"],
332
- slo_period=local["foo_period"],
333
- custom_tolerated_budget_consumption=5,
334
- custom_evaluation_period=90,
407
+ sli_guid=foo["sliGuid"],
408
+ slo_target=foo_target,
409
+ slo_period=foo_period,
410
+ custom_tolerated_budget_consumption=4,
411
+ custom_evaluation_period=5400,
335
412
  is_bad_events=True)
336
- your_condition = newrelic.NrqlAlertCondition("yourCondition",
337
- account_id=12345678,
338
- policy_id=67890,
413
+ your_condition = newrelic.NrqlAlertCondition("your_condition",
414
+ account_id="12345678",
415
+ policy_id="67890",
339
416
  type="static",
417
+ name="Custom burn alert",
340
418
  enabled=True,
341
419
  violation_time_limit_seconds=259200,
342
- nrql=newrelic.NrqlAlertConditionNrqlArgs(
343
- query=foo_custom.nrql,
344
- ),
345
- critical=newrelic.NrqlAlertConditionCriticalArgs(
346
- operator="above_or_equals",
347
- threshold=foo_custom.threshold,
348
- threshold_duration=foo_custom.evaluation_period,
349
- threshold_occurrences="at_least_once",
350
- ),
420
+ nrql={
421
+ "query": foo_custom.nrql,
422
+ },
423
+ critical={
424
+ "operator": "above_or_equals",
425
+ "threshold": foo_custom.threshold,
426
+ "threshold_duration": 900,
427
+ "threshold_occurrences": "at_least_once",
428
+ },
351
429
  fill_option="none",
352
- aggregation_window=3600,
430
+ aggregation_window=foo_custom.evaluation_period,
353
431
  aggregation_method="event_flow",
354
432
  aggregation_delay="120",
355
433
  slide_by=60)
356
434
  ```
357
435
 
358
436
 
359
- :param str alert_type: The type of alert we want to set. Valid values are:
360
- :param int custom_evaluation_period: Aggregation window taken into consideration in minutes. Mandatory if `alert_type` is `custom`.
361
- :param float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
362
- :param bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
363
- :param str sli_guid: The guid of the sli we want to set the alert on.
364
- :param int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
365
- :param float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
437
+ :param _builtins.str alert_type: The type of alert we want to set. Valid values are:
438
+ :param _builtins.int custom_evaluation_period: Aggregation window taken into consideration in seconds. Mandatory if `alert_type` is `custom`.
439
+ :param _builtins.float custom_tolerated_budget_consumption: How much budget you tolerate to consume during the custom evaluation period, valid values between `0` and `100`. Mandatory if `alert_type` is `custom`.
440
+ :param _builtins.bool is_bad_events: If the SLI is defined using bad events. Defaults to `false`
441
+ :param _builtins.str sli_guid: The guid of the sli we want to set the alert on.
442
+ :param _builtins.int slo_period: The time window of the Service Level Objective in days. Valid values are `1`, `7` and `28`.
443
+ :param _builtins.float slo_target: The target of the Service Level Objective, valid values between `0` and `100`.
366
444
  """
367
- ...
445
+ __args__ = dict()
446
+ __args__['alertType'] = alert_type
447
+ __args__['customEvaluationPeriod'] = custom_evaluation_period
448
+ __args__['customToleratedBudgetConsumption'] = custom_tolerated_budget_consumption
449
+ __args__['isBadEvents'] = is_bad_events
450
+ __args__['sliGuid'] = sli_guid
451
+ __args__['sloPeriod'] = slo_period
452
+ __args__['sloTarget'] = slo_target
453
+ opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
454
+ __ret__ = pulumi.runtime.invoke_output('newrelic:index/getServiceLevelAlertHelper:getServiceLevelAlertHelper', __args__, opts=opts, typ=GetServiceLevelAlertHelperResult)
455
+ return __ret__.apply(lambda __response__: GetServiceLevelAlertHelperResult(
456
+ alert_type=pulumi.get(__response__, 'alert_type'),
457
+ custom_evaluation_period=pulumi.get(__response__, 'custom_evaluation_period'),
458
+ custom_tolerated_budget_consumption=pulumi.get(__response__, 'custom_tolerated_budget_consumption'),
459
+ evaluation_period=pulumi.get(__response__, 'evaluation_period'),
460
+ id=pulumi.get(__response__, 'id'),
461
+ is_bad_events=pulumi.get(__response__, 'is_bad_events'),
462
+ nrql=pulumi.get(__response__, 'nrql'),
463
+ sli_guid=pulumi.get(__response__, 'sli_guid'),
464
+ slo_period=pulumi.get(__response__, 'slo_period'),
465
+ slo_target=pulumi.get(__response__, 'slo_target'),
466
+ threshold=pulumi.get(__response__, 'threshold'),
467
+ tolerated_budget_consumption=pulumi.get(__response__, 'tolerated_budget_consumption')))