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 *
@@ -20,7 +25,7 @@ class NotificationChannelArgs:
20
25
  product: pulumi.Input[str],
21
26
  properties: pulumi.Input[Sequence[pulumi.Input['NotificationChannelPropertyArgs']]],
22
27
  type: pulumi.Input[str],
23
- account_id: Optional[pulumi.Input[int]] = None,
28
+ account_id: Optional[pulumi.Input[str]] = None,
24
29
  active: Optional[pulumi.Input[bool]] = None,
25
30
  name: Optional[pulumi.Input[str]] = None):
26
31
  """
@@ -28,8 +33,8 @@ class NotificationChannelArgs:
28
33
  :param pulumi.Input[str] destination_id: The id of the destination.
29
34
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
30
35
  :param pulumi.Input[Sequence[pulumi.Input['NotificationChannelPropertyArgs']]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
31
- :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
32
- :param pulumi.Input[int] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
36
+ :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
37
+ :param pulumi.Input[str] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
33
38
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
34
39
  :param pulumi.Input[str] name: The name of the channel.
35
40
  """
@@ -84,7 +89,7 @@ class NotificationChannelArgs:
84
89
  @pulumi.getter
85
90
  def type(self) -> pulumi.Input[str]:
86
91
  """
87
- The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
92
+ The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
88
93
  """
89
94
  return pulumi.get(self, "type")
90
95
 
@@ -94,14 +99,14 @@ class NotificationChannelArgs:
94
99
 
95
100
  @property
96
101
  @pulumi.getter(name="accountId")
97
- def account_id(self) -> Optional[pulumi.Input[int]]:
102
+ def account_id(self) -> Optional[pulumi.Input[str]]:
98
103
  """
99
104
  Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
100
105
  """
101
106
  return pulumi.get(self, "account_id")
102
107
 
103
108
  @account_id.setter
104
- def account_id(self, value: Optional[pulumi.Input[int]]):
109
+ def account_id(self, value: Optional[pulumi.Input[str]]):
105
110
  pulumi.set(self, "account_id", value)
106
111
 
107
112
  @property
@@ -132,7 +137,7 @@ class NotificationChannelArgs:
132
137
  @pulumi.input_type
133
138
  class _NotificationChannelState:
134
139
  def __init__(__self__, *,
135
- account_id: Optional[pulumi.Input[int]] = None,
140
+ account_id: Optional[pulumi.Input[str]] = None,
136
141
  active: Optional[pulumi.Input[bool]] = None,
137
142
  destination_id: Optional[pulumi.Input[str]] = None,
138
143
  name: Optional[pulumi.Input[str]] = None,
@@ -142,14 +147,14 @@ class _NotificationChannelState:
142
147
  type: Optional[pulumi.Input[str]] = None):
143
148
  """
144
149
  Input properties used for looking up and filtering NotificationChannel resources.
145
- :param pulumi.Input[int] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
150
+ :param pulumi.Input[str] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
146
151
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
147
152
  :param pulumi.Input[str] destination_id: The id of the destination.
148
153
  :param pulumi.Input[str] name: The name of the channel.
149
154
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
150
155
  :param pulumi.Input[Sequence[pulumi.Input['NotificationChannelPropertyArgs']]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
151
156
  :param pulumi.Input[str] status: The status of the channel.
152
- :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
157
+ :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
153
158
  """
154
159
  if account_id is not None:
155
160
  pulumi.set(__self__, "account_id", account_id)
@@ -170,14 +175,14 @@ class _NotificationChannelState:
170
175
 
171
176
  @property
172
177
  @pulumi.getter(name="accountId")
173
- def account_id(self) -> Optional[pulumi.Input[int]]:
178
+ def account_id(self) -> Optional[pulumi.Input[str]]:
174
179
  """
175
180
  Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
176
181
  """
177
182
  return pulumi.get(self, "account_id")
178
183
 
179
184
  @account_id.setter
180
- def account_id(self, value: Optional[pulumi.Input[int]]):
185
+ def account_id(self, value: Optional[pulumi.Input[str]]):
181
186
  pulumi.set(self, "account_id", value)
182
187
 
183
188
  @property
@@ -256,7 +261,7 @@ class _NotificationChannelState:
256
261
  @pulumi.getter
257
262
  def type(self) -> Optional[pulumi.Input[str]]:
258
263
  """
259
- The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
264
+ The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
260
265
  """
261
266
  return pulumi.get(self, "type")
262
267
 
@@ -270,12 +275,12 @@ class NotificationChannel(pulumi.CustomResource):
270
275
  def __init__(__self__,
271
276
  resource_name: str,
272
277
  opts: Optional[pulumi.ResourceOptions] = None,
273
- account_id: Optional[pulumi.Input[int]] = None,
278
+ account_id: Optional[pulumi.Input[str]] = None,
274
279
  active: Optional[pulumi.Input[bool]] = None,
275
280
  destination_id: Optional[pulumi.Input[str]] = None,
276
281
  name: Optional[pulumi.Input[str]] = None,
277
282
  product: Optional[pulumi.Input[str]] = None,
278
- properties: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]]] = None,
283
+ properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]]] = None,
279
284
  type: Optional[pulumi.Input[str]] = None,
280
285
  __props__=None):
281
286
  """
@@ -291,17 +296,19 @@ class NotificationChannel(pulumi.CustomResource):
291
296
  import pulumi_newrelic as newrelic
292
297
 
293
298
  foo = newrelic.NotificationChannel("foo",
294
- account_id=12345678,
299
+ account_id="12345678",
300
+ name="webhook-example",
301
+ type="WEBHOOK",
295
302
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
296
303
  product="IINT",
297
- properties=[newrelic.NotificationChannelPropertyArgs(
298
- key="payload",
299
- label="Payload Template",
300
- value="name: {{ foo }}",
301
- )],
302
- type="WEBHOOK")
304
+ properties=[{
305
+ "key": "payload",
306
+ "value": "name: {{ foo }}",
307
+ "label": "Payload Template",
308
+ }])
303
309
  ```
304
310
  See additional examples.
311
+
305
312
  ## Additional Examples
306
313
 
307
314
  > **NOTE:** We support all properties. The mentioned properties are just an example.
@@ -314,20 +321,33 @@ class NotificationChannel(pulumi.CustomResource):
314
321
  import pulumi_newrelic as newrelic
315
322
 
316
323
  foo = newrelic.NotificationChannel("foo",
317
- account_id=12345678,
324
+ account_id="12345678",
325
+ name="servicenow-incident-example",
326
+ type="SERVICENOW_INCIDENTS",
318
327
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
319
328
  product="IINT",
320
329
  properties=[
321
- newrelic.NotificationChannelPropertyArgs(
322
- key="description",
323
- value="General description",
324
- ),
325
- newrelic.NotificationChannelPropertyArgs(
326
- key="short_description",
327
- value="Short description",
328
- ),
329
- ],
330
- type="SERVICENOW_INCIDENTS")
330
+ {
331
+ "key": "description",
332
+ "value": "General description",
333
+ },
334
+ {
335
+ "key": "short_description",
336
+ "value": "Short description",
337
+ },
338
+ ])
339
+ ```
340
+ ##### [ServiceNowApp](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#servicenowapp)
341
+ ```python
342
+ import pulumi
343
+ import pulumi_newrelic as newrelic
344
+
345
+ foo = newrelic.NotificationChannel("foo",
346
+ account_id="12345678",
347
+ name="servicenow-app-example",
348
+ type="SERVICE_NOW_APP",
349
+ destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
350
+ product="IINT")
331
351
  ```
332
352
 
333
353
  ##### [Email](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#email)
@@ -336,20 +356,21 @@ class NotificationChannel(pulumi.CustomResource):
336
356
  import pulumi_newrelic as newrelic
337
357
 
338
358
  foo = newrelic.NotificationChannel("foo",
339
- account_id=12345678,
359
+ account_id="12345678",
360
+ name="email-example",
361
+ type="EMAIL",
340
362
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
341
363
  product="IINT",
342
364
  properties=[
343
- newrelic.NotificationChannelPropertyArgs(
344
- key="subject",
345
- value="New Subject Title",
346
- ),
347
- newrelic.NotificationChannelPropertyArgs(
348
- key="customDetailsEmail",
349
- value="issue id - {{issueId}}",
350
- ),
351
- ],
352
- type="EMAIL")
365
+ {
366
+ "key": "subject",
367
+ "value": "New Subject Title",
368
+ },
369
+ {
370
+ "key": "customDetailsEmail",
371
+ "value": "issue id - {{issueId}}",
372
+ },
373
+ ])
353
374
  ```
354
375
 
355
376
  ##### [Jira Classic](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#jira)
@@ -358,28 +379,31 @@ class NotificationChannel(pulumi.CustomResource):
358
379
  import pulumi_newrelic as newrelic
359
380
 
360
381
  foo = newrelic.NotificationChannel("foo",
361
- account_id=12345678,
382
+ account_id="12345678",
383
+ name="jira-example",
384
+ type="JIRA_CLASSIC",
362
385
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
363
386
  product="ERROR_TRACKING",
364
387
  properties=[
365
- newrelic.NotificationChannelPropertyArgs(
366
- key="project",
367
- value="10000",
368
- ),
369
- newrelic.NotificationChannelPropertyArgs(
370
- key="issuetype",
371
- value="10004",
372
- ),
373
- newrelic.NotificationChannelPropertyArgs(
374
- key="description",
375
- value="Issue ID: {{ issueId }}",
376
- ),
377
- newrelic.NotificationChannelPropertyArgs(
378
- key="summary",
379
- value="{{ annotations.title.[0] }}",
380
- ),
381
- ],
382
- type="JIRA_CLASSIC")
388
+ {
389
+ "key": "project",
390
+ "value": "10000",
391
+ "label": "Project-Name",
392
+ },
393
+ {
394
+ "key": "issuetype",
395
+ "value": "10004",
396
+ "label": "Bug",
397
+ },
398
+ {
399
+ "key": "description",
400
+ "value": "Issue ID: {{ issueId }}",
401
+ },
402
+ {
403
+ "key": "summary",
404
+ "value": "{{ annotations.title.[0] }}",
405
+ },
406
+ ])
383
407
  ```
384
408
 
385
409
  ##### [PagerDuty with account integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
@@ -388,43 +412,43 @@ class NotificationChannel(pulumi.CustomResource):
388
412
  import pulumi_newrelic as newrelic
389
413
 
390
414
  foo = newrelic.NotificationChannel("foo",
391
- account_id=12345678,
415
+ account_id="12345678",
416
+ name="pagerduty-account-example",
417
+ type="PAGERDUTY_ACCOUNT_INTEGRATION",
392
418
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
393
419
  product="IINT",
394
420
  properties=[
395
- newrelic.NotificationChannelPropertyArgs(
396
- key="summary",
397
- value="General summary",
398
- ),
399
- newrelic.NotificationChannelPropertyArgs(
400
- key="service",
401
- label="Service Name",
402
- value="PTQK3FM",
403
- ),
404
- newrelic.NotificationChannelPropertyArgs(
405
- key="email",
406
- value="example@email.com",
407
- ),
408
- newrelic.NotificationChannelPropertyArgs(
409
- key="customDetails",
410
- value=\"\"\" {
411
- "id":{{json issueId}},
412
- "IssueURL":{{json issuePageUrl}},
413
- "NewRelic priority":{{json priority}},
414
- "Total Incidents":{{json totalIncidents}},
415
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
416
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
417
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
418
- "isCorrelated":{{json isCorrelated}},
419
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
420
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
421
- "Workflow Name":{{json workflowName}}
422
- }
423
-
421
+ {
422
+ "key": "summary",
423
+ "value": "General summary",
424
+ },
425
+ {
426
+ "key": "service",
427
+ "label": "Service Name",
428
+ "value": "PTQK3FM",
429
+ },
430
+ {
431
+ "key": "email",
432
+ "value": "example@email.com",
433
+ },
434
+ {
435
+ "key": "customDetails",
436
+ "value": \"\"\"{
437
+ "id":{{json issueId}},
438
+ "IssueURL":{{json issuePageUrl}},
439
+ "NewRelic priority":{{json priority}},
440
+ "Total Incidents":{{json totalIncidents}},
441
+ "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
442
+ "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
443
+ "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
444
+ "isCorrelated":{{json isCorrelated}},
445
+ "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
446
+ "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
447
+ "Workflow Name":{{json workflowName}}
448
+ }
424
449
  \"\"\",
425
- ),
426
- ],
427
- type="PAGERDUTY_ACCOUNT_INTEGRATION")
450
+ },
451
+ ])
428
452
  ```
429
453
 
430
454
  ##### [PagerDuty with service integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
@@ -433,34 +457,34 @@ class NotificationChannel(pulumi.CustomResource):
433
457
  import pulumi_newrelic as newrelic
434
458
 
435
459
  foo = newrelic.NotificationChannel("foo",
436
- account_id=12345678,
460
+ account_id="12345678",
461
+ name="pagerduty-account-example",
462
+ type="PAGERDUTY_SERVICE_INTEGRATION",
437
463
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
438
464
  product="IINT",
439
465
  properties=[
440
- newrelic.NotificationChannelPropertyArgs(
441
- key="summary",
442
- value="General summary",
443
- ),
444
- newrelic.NotificationChannelPropertyArgs(
445
- key="customDetails",
446
- value=\"\"\" {
447
- "id":{{json issueId}},
448
- "IssueURL":{{json issuePageUrl}},
449
- "NewRelic priority":{{json priority}},
450
- "Total Incidents":{{json totalIncidents}},
451
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
452
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
453
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
454
- "isCorrelated":{{json isCorrelated}},
455
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
456
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
457
- "Workflow Name":{{json workflowName}}
458
- }
459
-
466
+ {
467
+ "key": "summary",
468
+ "value": "General summary",
469
+ },
470
+ {
471
+ "key": "customDetails",
472
+ "value": \"\"\"{
473
+ "id":{{json issueId}},
474
+ "IssueURL":{{json issuePageUrl}},
475
+ "NewRelic priority":{{json priority}},
476
+ "Total Incidents":{{json totalIncidents}},
477
+ "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
478
+ "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
479
+ "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
480
+ "isCorrelated":{{json isCorrelated}},
481
+ "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
482
+ "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
483
+ "Workflow Name":{{json workflowName}}
484
+ }
460
485
  \"\"\",
461
- ),
462
- ],
463
- type="PAGERDUTY_SERVICE_INTEGRATION")
486
+ },
487
+ ])
464
488
  ```
465
489
 
466
490
  #### Mobile Push
@@ -469,10 +493,11 @@ class NotificationChannel(pulumi.CustomResource):
469
493
  import pulumi_newrelic as newrelic
470
494
 
471
495
  foo = newrelic.NotificationChannel("foo",
472
- account_id=12345678,
496
+ account_id="12345678",
497
+ name="mobile-push-example",
498
+ type="MOBILE_PUSH",
473
499
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
474
- product="IINT",
475
- type="MOBILE_PUSH")
500
+ product="IINT")
476
501
  ```
477
502
 
478
503
  #### [AWS Event Bridge](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#eventBridge)
@@ -481,20 +506,21 @@ class NotificationChannel(pulumi.CustomResource):
481
506
  import pulumi_newrelic as newrelic
482
507
 
483
508
  foo = newrelic.NotificationChannel("foo",
484
- account_id=12345678,
509
+ account_id="12345678",
510
+ name="event-bridge-example",
511
+ type="EVENT_BRIDGE",
485
512
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
486
513
  product="IINT",
487
514
  properties=[
488
- newrelic.NotificationChannelPropertyArgs(
489
- key="eventSource",
490
- value="aws.partner/mydomain/myaccountid/name",
491
- ),
492
- newrelic.NotificationChannelPropertyArgs(
493
- key="eventContent",
494
- value="{ id: {{ json issueId }} }",
495
- ),
496
- ],
497
- type="EVENT_BRIDGE")
515
+ {
516
+ "key": "eventSource",
517
+ "value": "aws.partner/mydomain/myaccountid/name",
518
+ },
519
+ {
520
+ "key": "eventContent",
521
+ "value": "{ id: {{ json issueId }} }",
522
+ },
523
+ ])
498
524
  ```
499
525
 
500
526
  #### [SLACK](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#slack)
@@ -503,20 +529,21 @@ class NotificationChannel(pulumi.CustomResource):
503
529
  import pulumi_newrelic as newrelic
504
530
 
505
531
  foo = newrelic.NotificationChannel("foo",
506
- account_id=12345678,
532
+ account_id="12345678",
533
+ name="slack-example",
534
+ type="SLACK",
507
535
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
508
536
  product="IINT",
509
537
  properties=[
510
- newrelic.NotificationChannelPropertyArgs(
511
- key="channelId",
512
- value="123456",
513
- ),
514
- newrelic.NotificationChannelPropertyArgs(
515
- key="customDetailsSlack",
516
- value="issue id - {{issueId}}",
517
- ),
518
- ],
519
- type="SLACK")
538
+ {
539
+ "key": "channelId",
540
+ "value": "123456",
541
+ },
542
+ {
543
+ "key": "customDetailsSlack",
544
+ "value": "issue id - {{issueId}}",
545
+ },
546
+ ])
520
547
  ```
521
548
 
522
549
  > **NOTE:** Sensitive data such as channel API keys, service keys, etc are not returned from the underlying API for security reasons and may not be set in state when importing.
@@ -531,16 +558,17 @@ class NotificationChannel(pulumi.CustomResource):
531
558
  import pulumi_newrelic as newrelic
532
559
 
533
560
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
534
- account_id=12345678,
535
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
536
- password="password",
537
- user="username",
538
- ),
539
- properties=[newrelic.NotificationDestinationPropertyArgs(
540
- key="url",
541
- value="https://webhook.mywebhook.com",
542
- )],
543
- type="WEBHOOK")
561
+ account_id="12345678",
562
+ name="destination-webhook",
563
+ type="WEBHOOK",
564
+ properties=[{
565
+ "key": "url",
566
+ "value": "https://webhook.mywebhook.com",
567
+ }],
568
+ auth_basic={
569
+ "user": "username",
570
+ "password": "password",
571
+ })
544
572
  ```
545
573
 
546
574
  ### Create a channel
@@ -549,30 +577,35 @@ class NotificationChannel(pulumi.CustomResource):
549
577
  import pulumi_newrelic as newrelic
550
578
 
551
579
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
552
- account_id=12345678,
580
+ account_id="12345678",
581
+ name="channel-webhook",
553
582
  type="WEBHOOK",
554
- destination_id=newrelic_notification_destination["webhook-destination"]["id"],
583
+ destination_id=webhook_destination["id"],
555
584
  product="IINT",
556
- properties=[newrelic.NotificationChannelPropertyArgs(
557
- key="payload",
558
- value="{name: foo}",
559
- label="Payload Template",
560
- )])
585
+ properties=[{
586
+ "key": "payload",
587
+ "value": "{name: foo}",
588
+ "label": "Payload Template",
589
+ }])
561
590
  ```
562
591
 
563
592
  ## Additional Information
564
593
 
565
594
  More details about the channels API can be found [here](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels).
595
+ ### Moving from Legacy Alert Channels to Notification Channels
596
+ As described in the documentation of this resource, channels can be created and managed using `NotificationDestination` and `NotificationChannel`. A combination of these resources is an alternative to the legacy resource `AlertChannel`, which is **deprecated** and will be **removed in a future major release**, as stated in the documentation of the resource.
597
+
598
+ If you're currently using `AlertChannel` to manage channels, we **strongly recommend** migrating to these notifications-based resources at the earliest.
566
599
 
567
- > **NOTE:** `AlertChannel` are legacy resources.
600
+ Please refer to the examples in this page, or this example for illustrations on setting up channels with these resources.
568
601
 
569
602
  ## Import
570
603
 
571
604
  Channels can only be used by a single workflow, therefore importing them is not particularly useful, because in the UI channels are created upon workflow creation.
572
605
 
573
- Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
606
+ Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
574
607
 
575
- That being said, importing is possible using -
608
+ That being said, importing is possible using -
576
609
 
577
610
  ```sh
578
611
  $ pulumi import newrelic:index/notificationChannel:NotificationChannel foo <destination_id>
@@ -580,13 +613,13 @@ class NotificationChannel(pulumi.CustomResource):
580
613
 
581
614
  :param str resource_name: The name of the resource.
582
615
  :param pulumi.ResourceOptions opts: Options for the resource.
583
- :param pulumi.Input[int] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
616
+ :param pulumi.Input[str] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
584
617
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
585
618
  :param pulumi.Input[str] destination_id: The id of the destination.
586
619
  :param pulumi.Input[str] name: The name of the channel.
587
620
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
588
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
589
- :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
621
+ :param pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
622
+ :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
590
623
  """
591
624
  ...
592
625
  @overload
@@ -607,17 +640,19 @@ class NotificationChannel(pulumi.CustomResource):
607
640
  import pulumi_newrelic as newrelic
608
641
 
609
642
  foo = newrelic.NotificationChannel("foo",
610
- account_id=12345678,
643
+ account_id="12345678",
644
+ name="webhook-example",
645
+ type="WEBHOOK",
611
646
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
612
647
  product="IINT",
613
- properties=[newrelic.NotificationChannelPropertyArgs(
614
- key="payload",
615
- label="Payload Template",
616
- value="name: {{ foo }}",
617
- )],
618
- type="WEBHOOK")
648
+ properties=[{
649
+ "key": "payload",
650
+ "value": "name: {{ foo }}",
651
+ "label": "Payload Template",
652
+ }])
619
653
  ```
620
654
  See additional examples.
655
+
621
656
  ## Additional Examples
622
657
 
623
658
  > **NOTE:** We support all properties. The mentioned properties are just an example.
@@ -630,20 +665,33 @@ class NotificationChannel(pulumi.CustomResource):
630
665
  import pulumi_newrelic as newrelic
631
666
 
632
667
  foo = newrelic.NotificationChannel("foo",
633
- account_id=12345678,
668
+ account_id="12345678",
669
+ name="servicenow-incident-example",
670
+ type="SERVICENOW_INCIDENTS",
634
671
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
635
672
  product="IINT",
636
673
  properties=[
637
- newrelic.NotificationChannelPropertyArgs(
638
- key="description",
639
- value="General description",
640
- ),
641
- newrelic.NotificationChannelPropertyArgs(
642
- key="short_description",
643
- value="Short description",
644
- ),
645
- ],
646
- type="SERVICENOW_INCIDENTS")
674
+ {
675
+ "key": "description",
676
+ "value": "General description",
677
+ },
678
+ {
679
+ "key": "short_description",
680
+ "value": "Short description",
681
+ },
682
+ ])
683
+ ```
684
+ ##### [ServiceNowApp](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#servicenowapp)
685
+ ```python
686
+ import pulumi
687
+ import pulumi_newrelic as newrelic
688
+
689
+ foo = newrelic.NotificationChannel("foo",
690
+ account_id="12345678",
691
+ name="servicenow-app-example",
692
+ type="SERVICE_NOW_APP",
693
+ destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
694
+ product="IINT")
647
695
  ```
648
696
 
649
697
  ##### [Email](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#email)
@@ -652,20 +700,21 @@ class NotificationChannel(pulumi.CustomResource):
652
700
  import pulumi_newrelic as newrelic
653
701
 
654
702
  foo = newrelic.NotificationChannel("foo",
655
- account_id=12345678,
703
+ account_id="12345678",
704
+ name="email-example",
705
+ type="EMAIL",
656
706
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
657
707
  product="IINT",
658
708
  properties=[
659
- newrelic.NotificationChannelPropertyArgs(
660
- key="subject",
661
- value="New Subject Title",
662
- ),
663
- newrelic.NotificationChannelPropertyArgs(
664
- key="customDetailsEmail",
665
- value="issue id - {{issueId}}",
666
- ),
667
- ],
668
- type="EMAIL")
709
+ {
710
+ "key": "subject",
711
+ "value": "New Subject Title",
712
+ },
713
+ {
714
+ "key": "customDetailsEmail",
715
+ "value": "issue id - {{issueId}}",
716
+ },
717
+ ])
669
718
  ```
670
719
 
671
720
  ##### [Jira Classic](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#jira)
@@ -674,28 +723,31 @@ class NotificationChannel(pulumi.CustomResource):
674
723
  import pulumi_newrelic as newrelic
675
724
 
676
725
  foo = newrelic.NotificationChannel("foo",
677
- account_id=12345678,
726
+ account_id="12345678",
727
+ name="jira-example",
728
+ type="JIRA_CLASSIC",
678
729
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
679
730
  product="ERROR_TRACKING",
680
731
  properties=[
681
- newrelic.NotificationChannelPropertyArgs(
682
- key="project",
683
- value="10000",
684
- ),
685
- newrelic.NotificationChannelPropertyArgs(
686
- key="issuetype",
687
- value="10004",
688
- ),
689
- newrelic.NotificationChannelPropertyArgs(
690
- key="description",
691
- value="Issue ID: {{ issueId }}",
692
- ),
693
- newrelic.NotificationChannelPropertyArgs(
694
- key="summary",
695
- value="{{ annotations.title.[0] }}",
696
- ),
697
- ],
698
- type="JIRA_CLASSIC")
732
+ {
733
+ "key": "project",
734
+ "value": "10000",
735
+ "label": "Project-Name",
736
+ },
737
+ {
738
+ "key": "issuetype",
739
+ "value": "10004",
740
+ "label": "Bug",
741
+ },
742
+ {
743
+ "key": "description",
744
+ "value": "Issue ID: {{ issueId }}",
745
+ },
746
+ {
747
+ "key": "summary",
748
+ "value": "{{ annotations.title.[0] }}",
749
+ },
750
+ ])
699
751
  ```
700
752
 
701
753
  ##### [PagerDuty with account integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
@@ -704,43 +756,43 @@ class NotificationChannel(pulumi.CustomResource):
704
756
  import pulumi_newrelic as newrelic
705
757
 
706
758
  foo = newrelic.NotificationChannel("foo",
707
- account_id=12345678,
759
+ account_id="12345678",
760
+ name="pagerduty-account-example",
761
+ type="PAGERDUTY_ACCOUNT_INTEGRATION",
708
762
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
709
763
  product="IINT",
710
764
  properties=[
711
- newrelic.NotificationChannelPropertyArgs(
712
- key="summary",
713
- value="General summary",
714
- ),
715
- newrelic.NotificationChannelPropertyArgs(
716
- key="service",
717
- label="Service Name",
718
- value="PTQK3FM",
719
- ),
720
- newrelic.NotificationChannelPropertyArgs(
721
- key="email",
722
- value="example@email.com",
723
- ),
724
- newrelic.NotificationChannelPropertyArgs(
725
- key="customDetails",
726
- value=\"\"\" {
727
- "id":{{json issueId}},
728
- "IssueURL":{{json issuePageUrl}},
729
- "NewRelic priority":{{json priority}},
730
- "Total Incidents":{{json totalIncidents}},
731
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
732
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
733
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
734
- "isCorrelated":{{json isCorrelated}},
735
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
736
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
737
- "Workflow Name":{{json workflowName}}
738
- }
739
-
765
+ {
766
+ "key": "summary",
767
+ "value": "General summary",
768
+ },
769
+ {
770
+ "key": "service",
771
+ "label": "Service Name",
772
+ "value": "PTQK3FM",
773
+ },
774
+ {
775
+ "key": "email",
776
+ "value": "example@email.com",
777
+ },
778
+ {
779
+ "key": "customDetails",
780
+ "value": \"\"\"{
781
+ "id":{{json issueId}},
782
+ "IssueURL":{{json issuePageUrl}},
783
+ "NewRelic priority":{{json priority}},
784
+ "Total Incidents":{{json totalIncidents}},
785
+ "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
786
+ "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
787
+ "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
788
+ "isCorrelated":{{json isCorrelated}},
789
+ "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
790
+ "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
791
+ "Workflow Name":{{json workflowName}}
792
+ }
740
793
  \"\"\",
741
- ),
742
- ],
743
- type="PAGERDUTY_ACCOUNT_INTEGRATION")
794
+ },
795
+ ])
744
796
  ```
745
797
 
746
798
  ##### [PagerDuty with service integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
@@ -749,34 +801,34 @@ class NotificationChannel(pulumi.CustomResource):
749
801
  import pulumi_newrelic as newrelic
750
802
 
751
803
  foo = newrelic.NotificationChannel("foo",
752
- account_id=12345678,
804
+ account_id="12345678",
805
+ name="pagerduty-account-example",
806
+ type="PAGERDUTY_SERVICE_INTEGRATION",
753
807
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
754
808
  product="IINT",
755
809
  properties=[
756
- newrelic.NotificationChannelPropertyArgs(
757
- key="summary",
758
- value="General summary",
759
- ),
760
- newrelic.NotificationChannelPropertyArgs(
761
- key="customDetails",
762
- value=\"\"\" {
763
- "id":{{json issueId}},
764
- "IssueURL":{{json issuePageUrl}},
765
- "NewRelic priority":{{json priority}},
766
- "Total Incidents":{{json totalIncidents}},
767
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
768
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
769
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
770
- "isCorrelated":{{json isCorrelated}},
771
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
772
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
773
- "Workflow Name":{{json workflowName}}
774
- }
775
-
810
+ {
811
+ "key": "summary",
812
+ "value": "General summary",
813
+ },
814
+ {
815
+ "key": "customDetails",
816
+ "value": \"\"\"{
817
+ "id":{{json issueId}},
818
+ "IssueURL":{{json issuePageUrl}},
819
+ "NewRelic priority":{{json priority}},
820
+ "Total Incidents":{{json totalIncidents}},
821
+ "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
822
+ "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
823
+ "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
824
+ "isCorrelated":{{json isCorrelated}},
825
+ "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
826
+ "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
827
+ "Workflow Name":{{json workflowName}}
828
+ }
776
829
  \"\"\",
777
- ),
778
- ],
779
- type="PAGERDUTY_SERVICE_INTEGRATION")
830
+ },
831
+ ])
780
832
  ```
781
833
 
782
834
  #### Mobile Push
@@ -785,10 +837,11 @@ class NotificationChannel(pulumi.CustomResource):
785
837
  import pulumi_newrelic as newrelic
786
838
 
787
839
  foo = newrelic.NotificationChannel("foo",
788
- account_id=12345678,
840
+ account_id="12345678",
841
+ name="mobile-push-example",
842
+ type="MOBILE_PUSH",
789
843
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
790
- product="IINT",
791
- type="MOBILE_PUSH")
844
+ product="IINT")
792
845
  ```
793
846
 
794
847
  #### [AWS Event Bridge](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#eventBridge)
@@ -797,20 +850,21 @@ class NotificationChannel(pulumi.CustomResource):
797
850
  import pulumi_newrelic as newrelic
798
851
 
799
852
  foo = newrelic.NotificationChannel("foo",
800
- account_id=12345678,
853
+ account_id="12345678",
854
+ name="event-bridge-example",
855
+ type="EVENT_BRIDGE",
801
856
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
802
857
  product="IINT",
803
858
  properties=[
804
- newrelic.NotificationChannelPropertyArgs(
805
- key="eventSource",
806
- value="aws.partner/mydomain/myaccountid/name",
807
- ),
808
- newrelic.NotificationChannelPropertyArgs(
809
- key="eventContent",
810
- value="{ id: {{ json issueId }} }",
811
- ),
812
- ],
813
- type="EVENT_BRIDGE")
859
+ {
860
+ "key": "eventSource",
861
+ "value": "aws.partner/mydomain/myaccountid/name",
862
+ },
863
+ {
864
+ "key": "eventContent",
865
+ "value": "{ id: {{ json issueId }} }",
866
+ },
867
+ ])
814
868
  ```
815
869
 
816
870
  #### [SLACK](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#slack)
@@ -819,20 +873,21 @@ class NotificationChannel(pulumi.CustomResource):
819
873
  import pulumi_newrelic as newrelic
820
874
 
821
875
  foo = newrelic.NotificationChannel("foo",
822
- account_id=12345678,
876
+ account_id="12345678",
877
+ name="slack-example",
878
+ type="SLACK",
823
879
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
824
880
  product="IINT",
825
881
  properties=[
826
- newrelic.NotificationChannelPropertyArgs(
827
- key="channelId",
828
- value="123456",
829
- ),
830
- newrelic.NotificationChannelPropertyArgs(
831
- key="customDetailsSlack",
832
- value="issue id - {{issueId}}",
833
- ),
834
- ],
835
- type="SLACK")
882
+ {
883
+ "key": "channelId",
884
+ "value": "123456",
885
+ },
886
+ {
887
+ "key": "customDetailsSlack",
888
+ "value": "issue id - {{issueId}}",
889
+ },
890
+ ])
836
891
  ```
837
892
 
838
893
  > **NOTE:** Sensitive data such as channel API keys, service keys, etc are not returned from the underlying API for security reasons and may not be set in state when importing.
@@ -847,16 +902,17 @@ class NotificationChannel(pulumi.CustomResource):
847
902
  import pulumi_newrelic as newrelic
848
903
 
849
904
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
850
- account_id=12345678,
851
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
852
- password="password",
853
- user="username",
854
- ),
855
- properties=[newrelic.NotificationDestinationPropertyArgs(
856
- key="url",
857
- value="https://webhook.mywebhook.com",
858
- )],
859
- type="WEBHOOK")
905
+ account_id="12345678",
906
+ name="destination-webhook",
907
+ type="WEBHOOK",
908
+ properties=[{
909
+ "key": "url",
910
+ "value": "https://webhook.mywebhook.com",
911
+ }],
912
+ auth_basic={
913
+ "user": "username",
914
+ "password": "password",
915
+ })
860
916
  ```
861
917
 
862
918
  ### Create a channel
@@ -865,30 +921,35 @@ class NotificationChannel(pulumi.CustomResource):
865
921
  import pulumi_newrelic as newrelic
866
922
 
867
923
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
868
- account_id=12345678,
924
+ account_id="12345678",
925
+ name="channel-webhook",
869
926
  type="WEBHOOK",
870
- destination_id=newrelic_notification_destination["webhook-destination"]["id"],
927
+ destination_id=webhook_destination["id"],
871
928
  product="IINT",
872
- properties=[newrelic.NotificationChannelPropertyArgs(
873
- key="payload",
874
- value="{name: foo}",
875
- label="Payload Template",
876
- )])
929
+ properties=[{
930
+ "key": "payload",
931
+ "value": "{name: foo}",
932
+ "label": "Payload Template",
933
+ }])
877
934
  ```
878
935
 
879
936
  ## Additional Information
880
937
 
881
938
  More details about the channels API can be found [here](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels).
939
+ ### Moving from Legacy Alert Channels to Notification Channels
940
+ As described in the documentation of this resource, channels can be created and managed using `NotificationDestination` and `NotificationChannel`. A combination of these resources is an alternative to the legacy resource `AlertChannel`, which is **deprecated** and will be **removed in a future major release**, as stated in the documentation of the resource.
941
+
942
+ If you're currently using `AlertChannel` to manage channels, we **strongly recommend** migrating to these notifications-based resources at the earliest.
882
943
 
883
- > **NOTE:** `AlertChannel` are legacy resources.
944
+ Please refer to the examples in this page, or this example for illustrations on setting up channels with these resources.
884
945
 
885
946
  ## Import
886
947
 
887
948
  Channels can only be used by a single workflow, therefore importing them is not particularly useful, because in the UI channels are created upon workflow creation.
888
949
 
889
- Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
950
+ Additionally, the channel id isn't available via the UI, and you'd need to look it up with the `channels` query in the NerdGraph API.
890
951
 
891
- That being said, importing is possible using -
952
+ That being said, importing is possible using -
892
953
 
893
954
  ```sh
894
955
  $ pulumi import newrelic:index/notificationChannel:NotificationChannel foo <destination_id>
@@ -909,12 +970,12 @@ class NotificationChannel(pulumi.CustomResource):
909
970
  def _internal_init(__self__,
910
971
  resource_name: str,
911
972
  opts: Optional[pulumi.ResourceOptions] = None,
912
- account_id: Optional[pulumi.Input[int]] = None,
973
+ account_id: Optional[pulumi.Input[str]] = None,
913
974
  active: Optional[pulumi.Input[bool]] = None,
914
975
  destination_id: Optional[pulumi.Input[str]] = None,
915
976
  name: Optional[pulumi.Input[str]] = None,
916
977
  product: Optional[pulumi.Input[str]] = None,
917
- properties: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]]] = None,
978
+ properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]]] = None,
918
979
  type: Optional[pulumi.Input[str]] = None,
919
980
  __props__=None):
920
981
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
@@ -951,12 +1012,12 @@ class NotificationChannel(pulumi.CustomResource):
951
1012
  def get(resource_name: str,
952
1013
  id: pulumi.Input[str],
953
1014
  opts: Optional[pulumi.ResourceOptions] = None,
954
- account_id: Optional[pulumi.Input[int]] = None,
1015
+ account_id: Optional[pulumi.Input[str]] = None,
955
1016
  active: Optional[pulumi.Input[bool]] = None,
956
1017
  destination_id: Optional[pulumi.Input[str]] = None,
957
1018
  name: Optional[pulumi.Input[str]] = None,
958
1019
  product: Optional[pulumi.Input[str]] = None,
959
- properties: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]]] = None,
1020
+ properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]]] = None,
960
1021
  status: Optional[pulumi.Input[str]] = None,
961
1022
  type: Optional[pulumi.Input[str]] = None) -> 'NotificationChannel':
962
1023
  """
@@ -966,14 +1027,14 @@ class NotificationChannel(pulumi.CustomResource):
966
1027
  :param str resource_name: The unique name of the resulting resource.
967
1028
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
968
1029
  :param pulumi.ResourceOptions opts: Options for the resource.
969
- :param pulumi.Input[int] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
1030
+ :param pulumi.Input[str] account_id: Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
970
1031
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
971
1032
  :param pulumi.Input[str] destination_id: The id of the destination.
972
1033
  :param pulumi.Input[str] name: The name of the channel.
973
1034
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
974
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
1035
+ :param pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]] properties: A nested block that describes a notification channel property. See Nested property blocks below for details.
975
1036
  :param pulumi.Input[str] status: The status of the channel.
976
- :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
1037
+ :param pulumi.Input[str] type: The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
977
1038
  """
978
1039
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
979
1040
 
@@ -991,7 +1052,7 @@ class NotificationChannel(pulumi.CustomResource):
991
1052
 
992
1053
  @property
993
1054
  @pulumi.getter(name="accountId")
994
- def account_id(self) -> pulumi.Output[int]:
1055
+ def account_id(self) -> pulumi.Output[str]:
995
1056
  """
996
1057
  Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
997
1058
  """
@@ -1049,7 +1110,7 @@ class NotificationChannel(pulumi.CustomResource):
1049
1110
  @pulumi.getter
1050
1111
  def type(self) -> pulumi.Output[str]:
1051
1112
  """
1052
- The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
1113
+ The type of channel. One of: `EMAIL`, `SERVICENOW_INCIDENTS`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA_CLASSIC`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `SLACK` and `SLACK_COLLABORATION`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`.
1053
1114
  """
1054
1115
  return pulumi.get(self, "type")
1055
1116