pulumi-newrelic 5.21.0a1710157101__py3-none-any.whl → 5.39.0a1736834464__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
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 +11 -6
  5. pulumi_newrelic/alert_channel.py +116 -127
  6. pulumi_newrelic/alert_condition.py +116 -129
  7. pulumi_newrelic/alert_muting_rule.py +128 -76
  8. pulumi_newrelic/alert_policy.py +78 -75
  9. pulumi_newrelic/alert_policy_channel.py +77 -68
  10. pulumi_newrelic/api_access_key.py +45 -28
  11. pulumi_newrelic/browser_application.py +77 -78
  12. pulumi_newrelic/cloud/_inputs.py +2527 -1082
  13. pulumi_newrelic/cloud/aws_govcloud_integrations.py +133 -128
  14. pulumi_newrelic/cloud/aws_govcloud_link_account.py +23 -20
  15. pulumi_newrelic/cloud/aws_integrations.py +298 -1326
  16. pulumi_newrelic/cloud/aws_link_account.py +23 -20
  17. pulumi_newrelic/cloud/azure_integrations.py +521 -483
  18. pulumi_newrelic/cloud/azure_link_account.py +34 -31
  19. pulumi_newrelic/cloud/gcp_integrations.py +341 -322
  20. pulumi_newrelic/cloud/gcp_link_account.py +23 -20
  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 +19 -18
  25. pulumi_newrelic/entity_tags.py +32 -31
  26. pulumi_newrelic/events_to_metrics_rule.py +23 -20
  27. pulumi_newrelic/get_account.py +24 -16
  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 -31
  31. pulumi_newrelic/get_authentication_domain.py +17 -13
  32. pulumi_newrelic/get_cloud_account.py +26 -18
  33. pulumi_newrelic/get_entity.py +90 -147
  34. pulumi_newrelic/get_group.py +58 -13
  35. pulumi_newrelic/get_key_transaction.py +109 -34
  36. pulumi_newrelic/get_notification_destination.py +64 -14
  37. pulumi_newrelic/get_obfuscation_expression.py +36 -28
  38. pulumi_newrelic/get_service_level_alert_helper.py +135 -117
  39. pulumi_newrelic/get_test_grok_pattern.py +29 -18
  40. pulumi_newrelic/get_user.py +17 -9
  41. pulumi_newrelic/group.py +5 -146
  42. pulumi_newrelic/infra_alert_condition.py +160 -167
  43. pulumi_newrelic/insights/_inputs.py +43 -0
  44. pulumi_newrelic/insights/event.py +48 -47
  45. pulumi_newrelic/insights/outputs.py +5 -0
  46. pulumi_newrelic/key_transaction.py +464 -0
  47. pulumi_newrelic/log_parsing_rule.py +25 -24
  48. pulumi_newrelic/monitor_downtime.py +211 -225
  49. pulumi_newrelic/notification_channel.py +381 -366
  50. pulumi_newrelic/notification_destination.py +192 -54
  51. pulumi_newrelic/nrql_alert_condition.py +345 -262
  52. pulumi_newrelic/nrql_drop_rule.py +31 -30
  53. pulumi_newrelic/obfuscation_expression.py +23 -20
  54. pulumi_newrelic/obfuscation_rule.py +38 -33
  55. pulumi_newrelic/one_dashboard.py +29 -24
  56. pulumi_newrelic/one_dashboard_json.py +19 -14
  57. pulumi_newrelic/one_dashboard_raw.py +110 -105
  58. pulumi_newrelic/outputs.py +2446 -245
  59. pulumi_newrelic/plugins/_inputs.py +145 -10
  60. pulumi_newrelic/plugins/application_settings.py +25 -36
  61. pulumi_newrelic/plugins/outputs.py +15 -10
  62. pulumi_newrelic/plugins/workload.py +215 -92
  63. pulumi_newrelic/provider.py +27 -33
  64. pulumi_newrelic/pulumi-plugin.json +2 -1
  65. pulumi_newrelic/service_level.py +185 -186
  66. pulumi_newrelic/synthetics/_inputs.py +159 -2
  67. pulumi_newrelic/synthetics/alert_condition.py +87 -98
  68. pulumi_newrelic/synthetics/broken_links_monitor.py +216 -99
  69. pulumi_newrelic/synthetics/cert_check_monitor.py +219 -100
  70. pulumi_newrelic/synthetics/get_private_location.py +34 -30
  71. pulumi_newrelic/synthetics/get_secure_credential.py +24 -16
  72. pulumi_newrelic/synthetics/monitor.py +348 -193
  73. pulumi_newrelic/synthetics/multi_location_alert_condition.py +105 -100
  74. pulumi_newrelic/synthetics/outputs.py +7 -2
  75. pulumi_newrelic/synthetics/private_location.py +25 -20
  76. pulumi_newrelic/synthetics/script_monitor.py +317 -182
  77. pulumi_newrelic/synthetics/secure_credential.py +23 -22
  78. pulumi_newrelic/synthetics/step_monitor.py +405 -100
  79. pulumi_newrelic/user.py +13 -10
  80. pulumi_newrelic/workflow.py +209 -196
  81. {pulumi_newrelic-5.21.0a1710157101.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.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
  84. pulumi_newrelic-5.21.0a1710157101.dist-info/RECORD +0 -89
  85. {pulumi_newrelic-5.21.0a1710157101.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/top_level.txt +0 -0
@@ -4,9 +4,14 @@
4
4
 
5
5
  import copy
6
6
  import warnings
7
+ import sys
7
8
  import pulumi
8
9
  import pulumi.runtime
9
10
  from typing import Any, Mapping, Optional, Sequence, Union, overload
11
+ if sys.version_info >= (3, 11):
12
+ from typing import NotRequired, TypedDict, TypeAlias
13
+ else:
14
+ from typing_extensions import NotRequired, TypedDict, TypeAlias
10
15
  from . import _utilities
11
16
  from . import outputs
12
17
  from ._inputs import *
@@ -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
  """
@@ -286,23 +291,22 @@ class NotificationChannel(pulumi.CustomResource):
286
291
  ## Example Usage
287
292
 
288
293
  ##### [Webhook](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#webhook)
289
- <!--Start PulumiCodeChooser -->
290
294
  ```python
291
295
  import pulumi
292
296
  import pulumi_newrelic as newrelic
293
297
 
294
298
  foo = newrelic.NotificationChannel("foo",
295
- account_id=12345678,
299
+ account_id="12345678",
300
+ name="webhook-example",
301
+ type="WEBHOOK",
296
302
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
297
303
  product="IINT",
298
- properties=[newrelic.NotificationChannelPropertyArgs(
299
- key="payload",
300
- label="Payload Template",
301
- value="name: {{ foo }}",
302
- )],
303
- type="WEBHOOK")
304
+ properties=[{
305
+ "key": "payload",
306
+ "value": "name: {{ foo }}",
307
+ "label": "Payload Template",
308
+ }])
304
309
  ```
305
- <!--End PulumiCodeChooser -->
306
310
  See additional examples.
307
311
 
308
312
  ## Additional Examples
@@ -312,231 +316,235 @@ class NotificationChannel(pulumi.CustomResource):
312
316
  ##### [ServiceNow](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#servicenow)
313
317
  To see the properties’ keys for your account, check ServiceNow incidents table.
314
318
 
315
- <!--Start PulumiCodeChooser -->
316
319
  ```python
317
320
  import pulumi
318
321
  import pulumi_newrelic as newrelic
319
322
 
320
323
  foo = newrelic.NotificationChannel("foo",
321
- account_id=12345678,
324
+ account_id="12345678",
325
+ name="servicenow-incident-example",
326
+ type="SERVICENOW_INCIDENTS",
322
327
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
323
328
  product="IINT",
324
329
  properties=[
325
- newrelic.NotificationChannelPropertyArgs(
326
- key="description",
327
- value="General description",
328
- ),
329
- newrelic.NotificationChannelPropertyArgs(
330
- key="short_description",
331
- value="Short description",
332
- ),
333
- ],
334
- 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")
335
351
  ```
336
- <!--End PulumiCodeChooser -->
337
352
 
338
353
  ##### [Email](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#email)
339
- <!--Start PulumiCodeChooser -->
340
354
  ```python
341
355
  import pulumi
342
356
  import pulumi_newrelic as newrelic
343
357
 
344
358
  foo = newrelic.NotificationChannel("foo",
345
- account_id=12345678,
359
+ account_id="12345678",
360
+ name="email-example",
361
+ type="EMAIL",
346
362
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
347
363
  product="IINT",
348
364
  properties=[
349
- newrelic.NotificationChannelPropertyArgs(
350
- key="subject",
351
- value="New Subject Title",
352
- ),
353
- newrelic.NotificationChannelPropertyArgs(
354
- key="customDetailsEmail",
355
- value="issue id - {{issueId}}",
356
- ),
357
- ],
358
- type="EMAIL")
365
+ {
366
+ "key": "subject",
367
+ "value": "New Subject Title",
368
+ },
369
+ {
370
+ "key": "customDetailsEmail",
371
+ "value": "issue id - {{issueId}}",
372
+ },
373
+ ])
359
374
  ```
360
- <!--End PulumiCodeChooser -->
361
375
 
362
376
  ##### [Jira Classic](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#jira)
363
- <!--Start PulumiCodeChooser -->
364
377
  ```python
365
378
  import pulumi
366
379
  import pulumi_newrelic as newrelic
367
380
 
368
381
  foo = newrelic.NotificationChannel("foo",
369
- account_id=12345678,
382
+ account_id="12345678",
383
+ name="jira-example",
384
+ type="JIRA_CLASSIC",
370
385
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
371
386
  product="ERROR_TRACKING",
372
387
  properties=[
373
- newrelic.NotificationChannelPropertyArgs(
374
- key="project",
375
- value="10000",
376
- ),
377
- newrelic.NotificationChannelPropertyArgs(
378
- key="issuetype",
379
- value="10004",
380
- ),
381
- newrelic.NotificationChannelPropertyArgs(
382
- key="description",
383
- value="Issue ID: {{ issueId }}",
384
- ),
385
- newrelic.NotificationChannelPropertyArgs(
386
- key="summary",
387
- value="{{ annotations.title.[0] }}",
388
- ),
389
- ],
390
- 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
+ ])
391
407
  ```
392
- <!--End PulumiCodeChooser -->
393
408
 
394
409
  ##### [PagerDuty with account integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
395
- <!--Start PulumiCodeChooser -->
396
410
  ```python
397
411
  import pulumi
398
412
  import pulumi_newrelic as newrelic
399
413
 
400
414
  foo = newrelic.NotificationChannel("foo",
401
- account_id=12345678,
415
+ account_id="12345678",
416
+ name="pagerduty-account-example",
417
+ type="PAGERDUTY_ACCOUNT_INTEGRATION",
402
418
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
403
419
  product="IINT",
404
420
  properties=[
405
- newrelic.NotificationChannelPropertyArgs(
406
- key="summary",
407
- value="General summary",
408
- ),
409
- newrelic.NotificationChannelPropertyArgs(
410
- key="service",
411
- label="Service Name",
412
- value="PTQK3FM",
413
- ),
414
- newrelic.NotificationChannelPropertyArgs(
415
- key="email",
416
- value="example@email.com",
417
- ),
418
- newrelic.NotificationChannelPropertyArgs(
419
- key="customDetails",
420
- value=\"\"\" {
421
- "id":{{json issueId}},
422
- "IssueURL":{{json issuePageUrl}},
423
- "NewRelic priority":{{json priority}},
424
- "Total Incidents":{{json totalIncidents}},
425
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
426
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
427
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
428
- "isCorrelated":{{json isCorrelated}},
429
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
430
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
431
- "Workflow Name":{{json workflowName}}
432
- }
433
-
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
+ }
434
449
  \"\"\",
435
- ),
436
- ],
437
- type="PAGERDUTY_ACCOUNT_INTEGRATION")
450
+ },
451
+ ])
438
452
  ```
439
- <!--End PulumiCodeChooser -->
440
453
 
441
454
  ##### [PagerDuty with service integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
442
- <!--Start PulumiCodeChooser -->
443
455
  ```python
444
456
  import pulumi
445
457
  import pulumi_newrelic as newrelic
446
458
 
447
459
  foo = newrelic.NotificationChannel("foo",
448
- account_id=12345678,
460
+ account_id="12345678",
461
+ name="pagerduty-account-example",
462
+ type="PAGERDUTY_SERVICE_INTEGRATION",
449
463
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
450
464
  product="IINT",
451
465
  properties=[
452
- newrelic.NotificationChannelPropertyArgs(
453
- key="summary",
454
- value="General summary",
455
- ),
456
- newrelic.NotificationChannelPropertyArgs(
457
- key="customDetails",
458
- value=\"\"\" {
459
- "id":{{json issueId}},
460
- "IssueURL":{{json issuePageUrl}},
461
- "NewRelic priority":{{json priority}},
462
- "Total Incidents":{{json totalIncidents}},
463
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
464
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
465
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
466
- "isCorrelated":{{json isCorrelated}},
467
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
468
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
469
- "Workflow Name":{{json workflowName}}
470
- }
471
-
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
+ }
472
485
  \"\"\",
473
- ),
474
- ],
475
- type="PAGERDUTY_SERVICE_INTEGRATION")
486
+ },
487
+ ])
476
488
  ```
477
- <!--End PulumiCodeChooser -->
478
489
 
479
490
  #### Mobile Push
480
- <!--Start PulumiCodeChooser -->
481
491
  ```python
482
492
  import pulumi
483
493
  import pulumi_newrelic as newrelic
484
494
 
485
495
  foo = newrelic.NotificationChannel("foo",
486
- account_id=12345678,
496
+ account_id="12345678",
497
+ name="mobile-push-example",
498
+ type="MOBILE_PUSH",
487
499
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
488
- product="IINT",
489
- type="MOBILE_PUSH")
500
+ product="IINT")
490
501
  ```
491
- <!--End PulumiCodeChooser -->
492
502
 
493
503
  #### [AWS Event Bridge](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#eventBridge)
494
- <!--Start PulumiCodeChooser -->
495
504
  ```python
496
505
  import pulumi
497
506
  import pulumi_newrelic as newrelic
498
507
 
499
508
  foo = newrelic.NotificationChannel("foo",
500
- account_id=12345678,
509
+ account_id="12345678",
510
+ name="event-bridge-example",
511
+ type="EVENT_BRIDGE",
501
512
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
502
513
  product="IINT",
503
514
  properties=[
504
- newrelic.NotificationChannelPropertyArgs(
505
- key="eventSource",
506
- value="aws.partner/mydomain/myaccountid/name",
507
- ),
508
- newrelic.NotificationChannelPropertyArgs(
509
- key="eventContent",
510
- value="{ id: {{ json issueId }} }",
511
- ),
512
- ],
513
- 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
+ ])
514
524
  ```
515
- <!--End PulumiCodeChooser -->
516
525
 
517
526
  #### [SLACK](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#slack)
518
- <!--Start PulumiCodeChooser -->
519
527
  ```python
520
528
  import pulumi
521
529
  import pulumi_newrelic as newrelic
522
530
 
523
531
  foo = newrelic.NotificationChannel("foo",
524
- account_id=12345678,
532
+ account_id="12345678",
533
+ name="slack-example",
534
+ type="SLACK",
525
535
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
526
536
  product="IINT",
527
537
  properties=[
528
- newrelic.NotificationChannelPropertyArgs(
529
- key="channelId",
530
- value="123456",
531
- ),
532
- newrelic.NotificationChannelPropertyArgs(
533
- key="customDetailsSlack",
534
- value="issue id - {{issueId}}",
535
- ),
536
- ],
537
- type="SLACK")
538
+ {
539
+ "key": "channelId",
540
+ "value": "123456",
541
+ },
542
+ {
543
+ "key": "customDetailsSlack",
544
+ "value": "issue id - {{issueId}}",
545
+ },
546
+ ])
538
547
  ```
539
- <!--End PulumiCodeChooser -->
540
548
 
541
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.
542
550
 
@@ -545,49 +553,51 @@ class NotificationChannel(pulumi.CustomResource):
545
553
  Create a destination resource and reference that destination to the channel resource:
546
554
 
547
555
  ### Create a destination
548
- <!--Start PulumiCodeChooser -->
549
556
  ```python
550
557
  import pulumi
551
558
  import pulumi_newrelic as newrelic
552
559
 
553
560
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
554
- account_id=12345678,
555
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
556
- password="password",
557
- user="username",
558
- ),
559
- properties=[newrelic.NotificationDestinationPropertyArgs(
560
- key="url",
561
- value="https://webhook.mywebhook.com",
562
- )],
563
- 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
+ })
564
572
  ```
565
- <!--End PulumiCodeChooser -->
566
573
 
567
574
  ### Create a channel
568
- <!--Start PulumiCodeChooser -->
569
575
  ```python
570
576
  import pulumi
571
577
  import pulumi_newrelic as newrelic
572
578
 
573
579
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
574
- account_id=12345678,
580
+ account_id="12345678",
581
+ name="channel-webhook",
575
582
  type="WEBHOOK",
576
- destination_id=newrelic_notification_destination["webhook-destination"]["id"],
583
+ destination_id=webhook_destination["id"],
577
584
  product="IINT",
578
- properties=[newrelic.NotificationChannelPropertyArgs(
579
- key="payload",
580
- value="{name: foo}",
581
- label="Payload Template",
582
- )])
585
+ properties=[{
586
+ "key": "payload",
587
+ "value": "{name: foo}",
588
+ "label": "Payload Template",
589
+ }])
583
590
  ```
584
- <!--End PulumiCodeChooser -->
585
591
 
586
592
  ## Additional Information
587
593
 
588
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.
589
599
 
590
- > **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.
591
601
 
592
602
  ## Import
593
603
 
@@ -603,13 +613,13 @@ class NotificationChannel(pulumi.CustomResource):
603
613
 
604
614
  :param str resource_name: The name of the resource.
605
615
  :param pulumi.ResourceOptions opts: Options for the resource.
606
- :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.
607
617
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
608
618
  :param pulumi.Input[str] destination_id: The id of the destination.
609
619
  :param pulumi.Input[str] name: The name of the channel.
610
620
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
611
- :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.
612
- :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`.
613
623
  """
614
624
  ...
615
625
  @overload
@@ -625,23 +635,22 @@ class NotificationChannel(pulumi.CustomResource):
625
635
  ## Example Usage
626
636
 
627
637
  ##### [Webhook](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#webhook)
628
- <!--Start PulumiCodeChooser -->
629
638
  ```python
630
639
  import pulumi
631
640
  import pulumi_newrelic as newrelic
632
641
 
633
642
  foo = newrelic.NotificationChannel("foo",
634
- account_id=12345678,
643
+ account_id="12345678",
644
+ name="webhook-example",
645
+ type="WEBHOOK",
635
646
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
636
647
  product="IINT",
637
- properties=[newrelic.NotificationChannelPropertyArgs(
638
- key="payload",
639
- label="Payload Template",
640
- value="name: {{ foo }}",
641
- )],
642
- type="WEBHOOK")
648
+ properties=[{
649
+ "key": "payload",
650
+ "value": "name: {{ foo }}",
651
+ "label": "Payload Template",
652
+ }])
643
653
  ```
644
- <!--End PulumiCodeChooser -->
645
654
  See additional examples.
646
655
 
647
656
  ## Additional Examples
@@ -651,231 +660,235 @@ class NotificationChannel(pulumi.CustomResource):
651
660
  ##### [ServiceNow](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#servicenow)
652
661
  To see the properties’ keys for your account, check ServiceNow incidents table.
653
662
 
654
- <!--Start PulumiCodeChooser -->
655
663
  ```python
656
664
  import pulumi
657
665
  import pulumi_newrelic as newrelic
658
666
 
659
667
  foo = newrelic.NotificationChannel("foo",
660
- account_id=12345678,
668
+ account_id="12345678",
669
+ name="servicenow-incident-example",
670
+ type="SERVICENOW_INCIDENTS",
661
671
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
662
672
  product="IINT",
663
673
  properties=[
664
- newrelic.NotificationChannelPropertyArgs(
665
- key="description",
666
- value="General description",
667
- ),
668
- newrelic.NotificationChannelPropertyArgs(
669
- key="short_description",
670
- value="Short description",
671
- ),
672
- ],
673
- 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")
674
695
  ```
675
- <!--End PulumiCodeChooser -->
676
696
 
677
697
  ##### [Email](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#email)
678
- <!--Start PulumiCodeChooser -->
679
698
  ```python
680
699
  import pulumi
681
700
  import pulumi_newrelic as newrelic
682
701
 
683
702
  foo = newrelic.NotificationChannel("foo",
684
- account_id=12345678,
703
+ account_id="12345678",
704
+ name="email-example",
705
+ type="EMAIL",
685
706
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
686
707
  product="IINT",
687
708
  properties=[
688
- newrelic.NotificationChannelPropertyArgs(
689
- key="subject",
690
- value="New Subject Title",
691
- ),
692
- newrelic.NotificationChannelPropertyArgs(
693
- key="customDetailsEmail",
694
- value="issue id - {{issueId}}",
695
- ),
696
- ],
697
- type="EMAIL")
709
+ {
710
+ "key": "subject",
711
+ "value": "New Subject Title",
712
+ },
713
+ {
714
+ "key": "customDetailsEmail",
715
+ "value": "issue id - {{issueId}}",
716
+ },
717
+ ])
698
718
  ```
699
- <!--End PulumiCodeChooser -->
700
719
 
701
720
  ##### [Jira Classic](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#jira)
702
- <!--Start PulumiCodeChooser -->
703
721
  ```python
704
722
  import pulumi
705
723
  import pulumi_newrelic as newrelic
706
724
 
707
725
  foo = newrelic.NotificationChannel("foo",
708
- account_id=12345678,
726
+ account_id="12345678",
727
+ name="jira-example",
728
+ type="JIRA_CLASSIC",
709
729
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
710
730
  product="ERROR_TRACKING",
711
731
  properties=[
712
- newrelic.NotificationChannelPropertyArgs(
713
- key="project",
714
- value="10000",
715
- ),
716
- newrelic.NotificationChannelPropertyArgs(
717
- key="issuetype",
718
- value="10004",
719
- ),
720
- newrelic.NotificationChannelPropertyArgs(
721
- key="description",
722
- value="Issue ID: {{ issueId }}",
723
- ),
724
- newrelic.NotificationChannelPropertyArgs(
725
- key="summary",
726
- value="{{ annotations.title.[0] }}",
727
- ),
728
- ],
729
- 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
+ ])
730
751
  ```
731
- <!--End PulumiCodeChooser -->
732
752
 
733
753
  ##### [PagerDuty with account integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
734
- <!--Start PulumiCodeChooser -->
735
754
  ```python
736
755
  import pulumi
737
756
  import pulumi_newrelic as newrelic
738
757
 
739
758
  foo = newrelic.NotificationChannel("foo",
740
- account_id=12345678,
759
+ account_id="12345678",
760
+ name="pagerduty-account-example",
761
+ type="PAGERDUTY_ACCOUNT_INTEGRATION",
741
762
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
742
763
  product="IINT",
743
764
  properties=[
744
- newrelic.NotificationChannelPropertyArgs(
745
- key="summary",
746
- value="General summary",
747
- ),
748
- newrelic.NotificationChannelPropertyArgs(
749
- key="service",
750
- label="Service Name",
751
- value="PTQK3FM",
752
- ),
753
- newrelic.NotificationChannelPropertyArgs(
754
- key="email",
755
- value="example@email.com",
756
- ),
757
- newrelic.NotificationChannelPropertyArgs(
758
- key="customDetails",
759
- value=\"\"\" {
760
- "id":{{json issueId}},
761
- "IssueURL":{{json issuePageUrl}},
762
- "NewRelic priority":{{json priority}},
763
- "Total Incidents":{{json totalIncidents}},
764
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
765
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
766
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
767
- "isCorrelated":{{json isCorrelated}},
768
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
769
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
770
- "Workflow Name":{{json workflowName}}
771
- }
772
-
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
+ }
773
793
  \"\"\",
774
- ),
775
- ],
776
- type="PAGERDUTY_ACCOUNT_INTEGRATION")
794
+ },
795
+ ])
777
796
  ```
778
- <!--End PulumiCodeChooser -->
779
797
 
780
798
  ##### [PagerDuty with service integration](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#pagerduty)
781
- <!--Start PulumiCodeChooser -->
782
799
  ```python
783
800
  import pulumi
784
801
  import pulumi_newrelic as newrelic
785
802
 
786
803
  foo = newrelic.NotificationChannel("foo",
787
- account_id=12345678,
804
+ account_id="12345678",
805
+ name="pagerduty-account-example",
806
+ type="PAGERDUTY_SERVICE_INTEGRATION",
788
807
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
789
808
  product="IINT",
790
809
  properties=[
791
- newrelic.NotificationChannelPropertyArgs(
792
- key="summary",
793
- value="General summary",
794
- ),
795
- newrelic.NotificationChannelPropertyArgs(
796
- key="customDetails",
797
- value=\"\"\" {
798
- "id":{{json issueId}},
799
- "IssueURL":{{json issuePageUrl}},
800
- "NewRelic priority":{{json priority}},
801
- "Total Incidents":{{json totalIncidents}},
802
- "Impacted Entities":"{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
803
- "Runbook":"{{#each accumulations.runbookUrl}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
804
- "Description":"{{#each annotations.description}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
805
- "isCorrelated":{{json isCorrelated}},
806
- "Alert Policy Names":"{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
807
- "Alert Condition Names":"{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
808
- "Workflow Name":{{json workflowName}}
809
- }
810
-
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
+ }
811
829
  \"\"\",
812
- ),
813
- ],
814
- type="PAGERDUTY_SERVICE_INTEGRATION")
830
+ },
831
+ ])
815
832
  ```
816
- <!--End PulumiCodeChooser -->
817
833
 
818
834
  #### Mobile Push
819
- <!--Start PulumiCodeChooser -->
820
835
  ```python
821
836
  import pulumi
822
837
  import pulumi_newrelic as newrelic
823
838
 
824
839
  foo = newrelic.NotificationChannel("foo",
825
- account_id=12345678,
840
+ account_id="12345678",
841
+ name="mobile-push-example",
842
+ type="MOBILE_PUSH",
826
843
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
827
- product="IINT",
828
- type="MOBILE_PUSH")
844
+ product="IINT")
829
845
  ```
830
- <!--End PulumiCodeChooser -->
831
846
 
832
847
  #### [AWS Event Bridge](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#eventBridge)
833
- <!--Start PulumiCodeChooser -->
834
848
  ```python
835
849
  import pulumi
836
850
  import pulumi_newrelic as newrelic
837
851
 
838
852
  foo = newrelic.NotificationChannel("foo",
839
- account_id=12345678,
853
+ account_id="12345678",
854
+ name="event-bridge-example",
855
+ type="EVENT_BRIDGE",
840
856
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
841
857
  product="IINT",
842
858
  properties=[
843
- newrelic.NotificationChannelPropertyArgs(
844
- key="eventSource",
845
- value="aws.partner/mydomain/myaccountid/name",
846
- ),
847
- newrelic.NotificationChannelPropertyArgs(
848
- key="eventContent",
849
- value="{ id: {{ json issueId }} }",
850
- ),
851
- ],
852
- 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
+ ])
853
868
  ```
854
- <!--End PulumiCodeChooser -->
855
869
 
856
870
  #### [SLACK](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-notifications-channels/#slack)
857
- <!--Start PulumiCodeChooser -->
858
871
  ```python
859
872
  import pulumi
860
873
  import pulumi_newrelic as newrelic
861
874
 
862
875
  foo = newrelic.NotificationChannel("foo",
863
- account_id=12345678,
876
+ account_id="12345678",
877
+ name="slack-example",
878
+ type="SLACK",
864
879
  destination_id="00b6bd1d-ac06-4d3d-bd72-49551e70f7a8",
865
880
  product="IINT",
866
881
  properties=[
867
- newrelic.NotificationChannelPropertyArgs(
868
- key="channelId",
869
- value="123456",
870
- ),
871
- newrelic.NotificationChannelPropertyArgs(
872
- key="customDetailsSlack",
873
- value="issue id - {{issueId}}",
874
- ),
875
- ],
876
- type="SLACK")
882
+ {
883
+ "key": "channelId",
884
+ "value": "123456",
885
+ },
886
+ {
887
+ "key": "customDetailsSlack",
888
+ "value": "issue id - {{issueId}}",
889
+ },
890
+ ])
877
891
  ```
878
- <!--End PulumiCodeChooser -->
879
892
 
880
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.
881
894
 
@@ -884,49 +897,51 @@ class NotificationChannel(pulumi.CustomResource):
884
897
  Create a destination resource and reference that destination to the channel resource:
885
898
 
886
899
  ### Create a destination
887
- <!--Start PulumiCodeChooser -->
888
900
  ```python
889
901
  import pulumi
890
902
  import pulumi_newrelic as newrelic
891
903
 
892
904
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
893
- account_id=12345678,
894
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
895
- password="password",
896
- user="username",
897
- ),
898
- properties=[newrelic.NotificationDestinationPropertyArgs(
899
- key="url",
900
- value="https://webhook.mywebhook.com",
901
- )],
902
- 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
+ })
903
916
  ```
904
- <!--End PulumiCodeChooser -->
905
917
 
906
918
  ### Create a channel
907
- <!--Start PulumiCodeChooser -->
908
919
  ```python
909
920
  import pulumi
910
921
  import pulumi_newrelic as newrelic
911
922
 
912
923
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
913
- account_id=12345678,
924
+ account_id="12345678",
925
+ name="channel-webhook",
914
926
  type="WEBHOOK",
915
- destination_id=newrelic_notification_destination["webhook-destination"]["id"],
927
+ destination_id=webhook_destination["id"],
916
928
  product="IINT",
917
- properties=[newrelic.NotificationChannelPropertyArgs(
918
- key="payload",
919
- value="{name: foo}",
920
- label="Payload Template",
921
- )])
929
+ properties=[{
930
+ "key": "payload",
931
+ "value": "{name: foo}",
932
+ "label": "Payload Template",
933
+ }])
922
934
  ```
923
- <!--End PulumiCodeChooser -->
924
935
 
925
936
  ## Additional Information
926
937
 
927
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.
928
943
 
929
- > **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.
930
945
 
931
946
  ## Import
932
947
 
@@ -955,12 +970,12 @@ class NotificationChannel(pulumi.CustomResource):
955
970
  def _internal_init(__self__,
956
971
  resource_name: str,
957
972
  opts: Optional[pulumi.ResourceOptions] = None,
958
- account_id: Optional[pulumi.Input[int]] = None,
973
+ account_id: Optional[pulumi.Input[str]] = None,
959
974
  active: Optional[pulumi.Input[bool]] = None,
960
975
  destination_id: Optional[pulumi.Input[str]] = None,
961
976
  name: Optional[pulumi.Input[str]] = None,
962
977
  product: Optional[pulumi.Input[str]] = None,
963
- properties: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]]] = None,
978
+ properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]]] = None,
964
979
  type: Optional[pulumi.Input[str]] = None,
965
980
  __props__=None):
966
981
  opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
@@ -997,12 +1012,12 @@ class NotificationChannel(pulumi.CustomResource):
997
1012
  def get(resource_name: str,
998
1013
  id: pulumi.Input[str],
999
1014
  opts: Optional[pulumi.ResourceOptions] = None,
1000
- account_id: Optional[pulumi.Input[int]] = None,
1015
+ account_id: Optional[pulumi.Input[str]] = None,
1001
1016
  active: Optional[pulumi.Input[bool]] = None,
1002
1017
  destination_id: Optional[pulumi.Input[str]] = None,
1003
1018
  name: Optional[pulumi.Input[str]] = None,
1004
1019
  product: Optional[pulumi.Input[str]] = None,
1005
- properties: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['NotificationChannelPropertyArgs']]]]] = None,
1020
+ properties: Optional[pulumi.Input[Sequence[pulumi.Input[Union['NotificationChannelPropertyArgs', 'NotificationChannelPropertyArgsDict']]]]] = None,
1006
1021
  status: Optional[pulumi.Input[str]] = None,
1007
1022
  type: Optional[pulumi.Input[str]] = None) -> 'NotificationChannel':
1008
1023
  """
@@ -1012,14 +1027,14 @@ class NotificationChannel(pulumi.CustomResource):
1012
1027
  :param str resource_name: The unique name of the resulting resource.
1013
1028
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
1014
1029
  :param pulumi.ResourceOptions opts: Options for the resource.
1015
- :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.
1016
1031
  :param pulumi.Input[bool] active: Indicates whether the channel is active.
1017
1032
  :param pulumi.Input[str] destination_id: The id of the destination.
1018
1033
  :param pulumi.Input[str] name: The name of the channel.
1019
1034
  :param pulumi.Input[str] product: The type of product. One of: `DISCUSSIONS`, `ERROR_TRACKING` or `IINT` (workflows).
1020
- :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.
1021
1036
  :param pulumi.Input[str] status: The status of the channel.
1022
- :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`.
1023
1038
  """
1024
1039
  opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
1025
1040
 
@@ -1037,7 +1052,7 @@ class NotificationChannel(pulumi.CustomResource):
1037
1052
 
1038
1053
  @property
1039
1054
  @pulumi.getter(name="accountId")
1040
- def account_id(self) -> pulumi.Output[int]:
1055
+ def account_id(self) -> pulumi.Output[str]:
1041
1056
  """
1042
1057
  Determines the New Relic account where the notification channel will be created. Defaults to the account associated with the API key used.
1043
1058
  """
@@ -1095,7 +1110,7 @@ class NotificationChannel(pulumi.CustomResource):
1095
1110
  @pulumi.getter
1096
1111
  def type(self) -> pulumi.Output[str]:
1097
1112
  """
1098
- 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`.
1099
1114
  """
1100
1115
  return pulumi.get(self, "type")
1101
1116