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 *
@@ -19,7 +24,7 @@ class WorkflowArgs:
19
24
  destinations: pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationArgs']]],
20
25
  issues_filter: pulumi.Input['WorkflowIssuesFilterArgs'],
21
26
  muting_rules_handling: pulumi.Input[str],
22
- account_id: Optional[pulumi.Input[int]] = None,
27
+ account_id: Optional[pulumi.Input[str]] = None,
23
28
  destinations_enabled: Optional[pulumi.Input[bool]] = None,
24
29
  enabled: Optional[pulumi.Input[bool]] = None,
25
30
  enrichments: Optional[pulumi.Input['WorkflowEnrichmentsArgs']] = None,
@@ -30,7 +35,7 @@ class WorkflowArgs:
30
35
  :param pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationArgs']]] destinations: Notification configuration. See Nested destination blocks below for details.
31
36
  :param pulumi.Input['WorkflowIssuesFilterArgs'] issues_filter: A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
32
37
  :param pulumi.Input[str] muting_rules_handling: How to handle muted issues. See Muting Rules below for details.
33
- :param pulumi.Input[int] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
38
+ :param pulumi.Input[str] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
34
39
  :param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
35
40
  these two are different flags, but they are functionally identical. Defaults to true.
36
41
  :param pulumi.Input[bool] enabled: Whether workflow is enabled. Defaults to true.
@@ -95,26 +100,24 @@ class WorkflowArgs:
95
100
 
96
101
  @property
97
102
  @pulumi.getter(name="accountId")
98
- def account_id(self) -> Optional[pulumi.Input[int]]:
103
+ def account_id(self) -> Optional[pulumi.Input[str]]:
99
104
  """
100
105
  Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
101
106
  """
102
107
  return pulumi.get(self, "account_id")
103
108
 
104
109
  @account_id.setter
105
- def account_id(self, value: Optional[pulumi.Input[int]]):
110
+ def account_id(self, value: Optional[pulumi.Input[str]]):
106
111
  pulumi.set(self, "account_id", value)
107
112
 
108
113
  @property
109
114
  @pulumi.getter(name="destinationsEnabled")
115
+ @_utilities.deprecated("""Please use 'enabled' instead""")
110
116
  def destinations_enabled(self) -> Optional[pulumi.Input[bool]]:
111
117
  """
112
118
  **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
113
119
  these two are different flags, but they are functionally identical. Defaults to true.
114
120
  """
115
- warnings.warn("""Please use 'enabled' instead""", DeprecationWarning)
116
- pulumi.log.warn("""destinations_enabled is deprecated: Please use 'enabled' instead""")
117
-
118
121
  return pulumi.get(self, "destinations_enabled")
119
122
 
120
123
  @destinations_enabled.setter
@@ -173,7 +176,7 @@ class WorkflowArgs:
173
176
  @pulumi.input_type
174
177
  class _WorkflowState:
175
178
  def __init__(__self__, *,
176
- account_id: Optional[pulumi.Input[int]] = None,
179
+ account_id: Optional[pulumi.Input[str]] = None,
177
180
  destinations: Optional[pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationArgs']]]] = None,
178
181
  destinations_enabled: Optional[pulumi.Input[bool]] = None,
179
182
  enabled: Optional[pulumi.Input[bool]] = None,
@@ -187,7 +190,7 @@ class _WorkflowState:
187
190
  workflow_id: Optional[pulumi.Input[str]] = None):
188
191
  """
189
192
  Input properties used for looking up and filtering Workflow resources.
190
- :param pulumi.Input[int] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
193
+ :param pulumi.Input[str] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
191
194
  :param pulumi.Input[Sequence[pulumi.Input['WorkflowDestinationArgs']]] destinations: Notification configuration. See Nested destination blocks below for details.
192
195
  :param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
193
196
  these two are different flags, but they are functionally identical. Defaults to true.
@@ -231,14 +234,14 @@ class _WorkflowState:
231
234
 
232
235
  @property
233
236
  @pulumi.getter(name="accountId")
234
- def account_id(self) -> Optional[pulumi.Input[int]]:
237
+ def account_id(self) -> Optional[pulumi.Input[str]]:
235
238
  """
236
239
  Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
237
240
  """
238
241
  return pulumi.get(self, "account_id")
239
242
 
240
243
  @account_id.setter
241
- def account_id(self, value: Optional[pulumi.Input[int]]):
244
+ def account_id(self, value: Optional[pulumi.Input[str]]):
242
245
  pulumi.set(self, "account_id", value)
243
246
 
244
247
  @property
@@ -255,14 +258,12 @@ class _WorkflowState:
255
258
 
256
259
  @property
257
260
  @pulumi.getter(name="destinationsEnabled")
261
+ @_utilities.deprecated("""Please use 'enabled' instead""")
258
262
  def destinations_enabled(self) -> Optional[pulumi.Input[bool]]:
259
263
  """
260
264
  **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
261
265
  these two are different flags, but they are functionally identical. Defaults to true.
262
266
  """
263
- warnings.warn("""Please use 'enabled' instead""", DeprecationWarning)
264
- pulumi.log.warn("""destinations_enabled is deprecated: Please use 'enabled' instead""")
265
-
266
267
  return pulumi.get(self, "destinations_enabled")
267
268
 
268
269
  @destinations_enabled.setter
@@ -383,13 +384,13 @@ class Workflow(pulumi.CustomResource):
383
384
  def __init__(__self__,
384
385
  resource_name: str,
385
386
  opts: Optional[pulumi.ResourceOptions] = None,
386
- account_id: Optional[pulumi.Input[int]] = None,
387
- destinations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationArgs']]]]] = None,
387
+ account_id: Optional[pulumi.Input[str]] = None,
388
+ destinations: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]]] = None,
388
389
  destinations_enabled: Optional[pulumi.Input[bool]] = None,
389
390
  enabled: Optional[pulumi.Input[bool]] = None,
390
- enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
391
+ enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
391
392
  enrichments_enabled: Optional[pulumi.Input[bool]] = None,
392
- issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
393
+ issues_filter: Optional[pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']]] = None,
393
394
  muting_rules_handling: Optional[pulumi.Input[str]] = None,
394
395
  name: Optional[pulumi.Input[str]] = None,
395
396
  __props__=None):
@@ -399,139 +400,146 @@ class Workflow(pulumi.CustomResource):
399
400
  ## Example Usage
400
401
 
401
402
  ##### Workflow
402
- <!--Start PulumiCodeChooser -->
403
403
  ```python
404
404
  import pulumi
405
405
  import pulumi_newrelic as newrelic
406
406
 
407
407
  foo = newrelic.Workflow("foo",
408
+ name="workflow-example",
408
409
  muting_rules_handling="NOTIFY_ALL_ISSUES",
409
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
410
- name="filter-name",
411
- type="FILTER",
412
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
413
- attribute="accumulations.tag.team",
414
- operator="EXACTLY_MATCHES",
415
- values=["growth"],
416
- )],
417
- ),
418
- destinations=[newrelic.WorkflowDestinationArgs(
419
- channel_id=newrelic_notification_channel["some_channel"]["id"],
420
- )])
410
+ issues_filter={
411
+ "name": "filter-name",
412
+ "type": "FILTER",
413
+ "predicates": [{
414
+ "attribute": "accumulations.tag.team",
415
+ "operator": "EXACTLY_MATCHES",
416
+ "values": ["growth"],
417
+ }],
418
+ },
419
+ destinations=[{
420
+ "channel_id": some_channel["id"],
421
+ }])
421
422
  ```
422
- <!--End PulumiCodeChooser -->
423
423
 
424
424
  ## Policy-Based Workflow Example
425
425
 
426
426
  This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
427
427
 
428
- <!--Start PulumiCodeChooser -->
429
428
  ```python
430
429
  import pulumi
431
430
  import pulumi_newrelic as newrelic
432
431
 
433
432
  # Create a policy to track
434
- my_policy = newrelic.AlertPolicy("my-policy")
433
+ my_policy = newrelic.AlertPolicy("my-policy", name="my_policy")
435
434
  # Create a reusable notification destination
436
435
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
436
+ name="destination-webhook",
437
437
  type="WEBHOOK",
438
- properties=[newrelic.NotificationDestinationPropertyArgs(
439
- key="url",
440
- value="https://example.com",
441
- )],
442
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
443
- user="username",
444
- password="password",
445
- ))
438
+ properties=[{
439
+ "key": "url",
440
+ "value": "https://example.com",
441
+ }],
442
+ auth_basic={
443
+ "user": "username",
444
+ "password": "password",
445
+ })
446
446
  # Create a notification channel to use in the workflow
447
447
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
448
+ name="channel-webhook",
448
449
  type="WEBHOOK",
449
450
  destination_id=webhook_destination.id,
450
451
  product="IINT",
451
- properties=[newrelic.NotificationChannelPropertyArgs(
452
- key="payload",
453
- value="{}",
454
- label="Payload Template",
455
- )])
452
+ properties=[{
453
+ "key": "payload",
454
+ "value": "{}",
455
+ "label": "Payload Template",
456
+ }])
456
457
  # A workflow that matches issues that include incidents triggered by the policy
457
458
  workflow_example = newrelic.Workflow("workflow-example",
459
+ name="workflow-example",
458
460
  muting_rules_handling="NOTIFY_ALL_ISSUES",
459
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
460
- name="Filter-name",
461
- type="FILTER",
462
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
463
- attribute="labels.policyIds",
464
- operator="EXACTLY_MATCHES",
465
- values=[my_policy.id],
466
- )],
467
- ),
468
- destinations=[newrelic.WorkflowDestinationArgs(
469
- channel_id=webhook_channel.id,
470
- )])
461
+ issues_filter={
462
+ "name": "Filter-name",
463
+ "type": "FILTER",
464
+ "predicates": [{
465
+ "attribute": "labels.policyIds",
466
+ "operator": "EXACTLY_MATCHES",
467
+ "values": [my_policy.id],
468
+ }],
469
+ },
470
+ destinations=[{
471
+ "channel_id": webhook_channel.id,
472
+ }])
471
473
  ```
472
- <!--End PulumiCodeChooser -->
473
474
 
474
475
  ### An example of a workflow with enrichments
475
476
 
476
- <!--Start PulumiCodeChooser -->
477
477
  ```python
478
478
  import pulumi
479
479
  import pulumi_newrelic as newrelic
480
480
 
481
481
  workflow_example = newrelic.Workflow("workflow-example",
482
+ name="workflow-enrichment-example",
482
483
  muting_rules_handling="NOTIFY_ALL_ISSUES",
483
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
484
- name="Filter-name",
485
- type="FILTER",
486
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
487
- attribute="accumulations.tag.team",
488
- operator="EXACTLY_MATCHES",
489
- values=["my_team"],
490
- )],
491
- ),
492
- enrichments=newrelic.WorkflowEnrichmentsArgs(
493
- nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
494
- name="Log Count",
495
- configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
496
- query="SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
497
- )],
498
- )],
499
- ),
500
- destinations=[newrelic.WorkflowDestinationArgs(
501
- channel_id=newrelic_notification_channel["webhook-channel"]["id"],
502
- )])
484
+ issues_filter={
485
+ "name": "Filter-name",
486
+ "type": "FILTER",
487
+ "predicates": [{
488
+ "attribute": "accumulations.tag.team",
489
+ "operator": "EXACTLY_MATCHES",
490
+ "values": ["my_team"],
491
+ }],
492
+ },
493
+ enrichments={
494
+ "nrqls": [{
495
+ "name": "Log Count",
496
+ "configurations": [{
497
+ "query": "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
498
+ }],
499
+ }],
500
+ },
501
+ destinations=[{
502
+ "channel_id": webhook_channel["id"],
503
+ }])
503
504
  ```
504
- <!--End PulumiCodeChooser -->
505
505
 
506
506
  ### An example of a workflow with notification triggers
507
507
 
508
- <!--Start PulumiCodeChooser -->
509
508
  ```python
510
509
  import pulumi
511
510
  import pulumi_newrelic as newrelic
512
511
 
513
512
  workflow_example = newrelic.Workflow("workflow-example",
513
+ name="workflow-enrichment-example",
514
514
  muting_rules_handling="NOTIFY_ALL_ISSUES",
515
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
516
- name="Filter-name",
517
- type="FILTER",
518
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
519
- attribute="accumulations.tag.team",
520
- operator="EXACTLY_MATCHES",
521
- values=["my_team"],
522
- )],
523
- ),
524
- destinations=[newrelic.WorkflowDestinationArgs(
525
- channel_id=newrelic_notification_channel["webhook-channel"]["id"],
526
- notification_triggers=["ACTIVATED"],
527
- )])
515
+ issues_filter={
516
+ "name": "Filter-name",
517
+ "type": "FILTER",
518
+ "predicates": [{
519
+ "attribute": "accumulations.tag.team",
520
+ "operator": "EXACTLY_MATCHES",
521
+ "values": ["my_team"],
522
+ }],
523
+ },
524
+ destinations=[{
525
+ "channel_id": webhook_channel["id"],
526
+ "notification_triggers": ["ACTIVATED"],
527
+ }])
528
528
  ```
529
- <!--End PulumiCodeChooser -->
530
529
 
531
530
  ## Additional Information
532
531
 
533
532
  More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
534
533
 
534
+ ### Moving from Legacy Alert Policy Channels to Workflows
535
+ As described in the documentation of this resource, mapping alert channels (created using `NotificationDestination` and `NotificationChannel`) to policies can be performed using the `Workflow` resource, which is an alternative to the legacy resource `AlertPolicyChannel` (which consumes alert channels created using the legacy resource `AlertChannel`).
536
+
537
+ Both of the legacy resources mentioned above, `AlertChannel` and `AlertPolicyChannel` are **deprecated** and will be **removed in a future major release**, as stated in the documentation of both of these resources.
538
+
539
+ If you're currently using `AlertChannel` and `AlertPolicyChannel` to manage alert channels linked to policies, we **strongly recommend** migrating to these workflows and notifications-based resources at the earliest.
540
+
541
+ Please refer to the examples in this page, or this example for illustrations on setting up channels and workflows with these resources.
542
+
535
543
  ## v3.3 changes
536
544
 
537
545
  In version v3.3 we renamed the following arguments:
@@ -555,14 +563,14 @@ class Workflow(pulumi.CustomResource):
555
563
 
556
564
  :param str resource_name: The name of the resource.
557
565
  :param pulumi.ResourceOptions opts: Options for the resource.
558
- :param pulumi.Input[int] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
559
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationArgs']]]] destinations: Notification configuration. See Nested destination blocks below for details.
566
+ :param pulumi.Input[str] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
567
+ :param pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]] destinations: Notification configuration. See Nested destination blocks below for details.
560
568
  :param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
561
569
  these two are different flags, but they are functionally identical. Defaults to true.
562
570
  :param pulumi.Input[bool] enabled: Whether workflow is enabled. Defaults to true.
563
- :param pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
571
+ :param pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
564
572
  :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled. Defaults to true.
565
- :param pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']] issues_filter: A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
573
+ :param pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']] issues_filter: A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
566
574
  :param pulumi.Input[str] muting_rules_handling: How to handle muted issues. See Muting Rules below for details.
567
575
  :param pulumi.Input[str] name: The name of the workflow.
568
576
  """
@@ -578,139 +586,146 @@ class Workflow(pulumi.CustomResource):
578
586
  ## Example Usage
579
587
 
580
588
  ##### Workflow
581
- <!--Start PulumiCodeChooser -->
582
589
  ```python
583
590
  import pulumi
584
591
  import pulumi_newrelic as newrelic
585
592
 
586
593
  foo = newrelic.Workflow("foo",
594
+ name="workflow-example",
587
595
  muting_rules_handling="NOTIFY_ALL_ISSUES",
588
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
589
- name="filter-name",
590
- type="FILTER",
591
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
592
- attribute="accumulations.tag.team",
593
- operator="EXACTLY_MATCHES",
594
- values=["growth"],
595
- )],
596
- ),
597
- destinations=[newrelic.WorkflowDestinationArgs(
598
- channel_id=newrelic_notification_channel["some_channel"]["id"],
599
- )])
596
+ issues_filter={
597
+ "name": "filter-name",
598
+ "type": "FILTER",
599
+ "predicates": [{
600
+ "attribute": "accumulations.tag.team",
601
+ "operator": "EXACTLY_MATCHES",
602
+ "values": ["growth"],
603
+ }],
604
+ },
605
+ destinations=[{
606
+ "channel_id": some_channel["id"],
607
+ }])
600
608
  ```
601
- <!--End PulumiCodeChooser -->
602
609
 
603
610
  ## Policy-Based Workflow Example
604
611
 
605
612
  This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
606
613
 
607
- <!--Start PulumiCodeChooser -->
608
614
  ```python
609
615
  import pulumi
610
616
  import pulumi_newrelic as newrelic
611
617
 
612
618
  # Create a policy to track
613
- my_policy = newrelic.AlertPolicy("my-policy")
619
+ my_policy = newrelic.AlertPolicy("my-policy", name="my_policy")
614
620
  # Create a reusable notification destination
615
621
  webhook_destination = newrelic.NotificationDestination("webhook-destination",
622
+ name="destination-webhook",
616
623
  type="WEBHOOK",
617
- properties=[newrelic.NotificationDestinationPropertyArgs(
618
- key="url",
619
- value="https://example.com",
620
- )],
621
- auth_basic=newrelic.NotificationDestinationAuthBasicArgs(
622
- user="username",
623
- password="password",
624
- ))
624
+ properties=[{
625
+ "key": "url",
626
+ "value": "https://example.com",
627
+ }],
628
+ auth_basic={
629
+ "user": "username",
630
+ "password": "password",
631
+ })
625
632
  # Create a notification channel to use in the workflow
626
633
  webhook_channel = newrelic.NotificationChannel("webhook-channel",
634
+ name="channel-webhook",
627
635
  type="WEBHOOK",
628
636
  destination_id=webhook_destination.id,
629
637
  product="IINT",
630
- properties=[newrelic.NotificationChannelPropertyArgs(
631
- key="payload",
632
- value="{}",
633
- label="Payload Template",
634
- )])
638
+ properties=[{
639
+ "key": "payload",
640
+ "value": "{}",
641
+ "label": "Payload Template",
642
+ }])
635
643
  # A workflow that matches issues that include incidents triggered by the policy
636
644
  workflow_example = newrelic.Workflow("workflow-example",
645
+ name="workflow-example",
637
646
  muting_rules_handling="NOTIFY_ALL_ISSUES",
638
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
639
- name="Filter-name",
640
- type="FILTER",
641
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
642
- attribute="labels.policyIds",
643
- operator="EXACTLY_MATCHES",
644
- values=[my_policy.id],
645
- )],
646
- ),
647
- destinations=[newrelic.WorkflowDestinationArgs(
648
- channel_id=webhook_channel.id,
649
- )])
647
+ issues_filter={
648
+ "name": "Filter-name",
649
+ "type": "FILTER",
650
+ "predicates": [{
651
+ "attribute": "labels.policyIds",
652
+ "operator": "EXACTLY_MATCHES",
653
+ "values": [my_policy.id],
654
+ }],
655
+ },
656
+ destinations=[{
657
+ "channel_id": webhook_channel.id,
658
+ }])
650
659
  ```
651
- <!--End PulumiCodeChooser -->
652
660
 
653
661
  ### An example of a workflow with enrichments
654
662
 
655
- <!--Start PulumiCodeChooser -->
656
663
  ```python
657
664
  import pulumi
658
665
  import pulumi_newrelic as newrelic
659
666
 
660
667
  workflow_example = newrelic.Workflow("workflow-example",
668
+ name="workflow-enrichment-example",
661
669
  muting_rules_handling="NOTIFY_ALL_ISSUES",
662
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
663
- name="Filter-name",
664
- type="FILTER",
665
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
666
- attribute="accumulations.tag.team",
667
- operator="EXACTLY_MATCHES",
668
- values=["my_team"],
669
- )],
670
- ),
671
- enrichments=newrelic.WorkflowEnrichmentsArgs(
672
- nrqls=[newrelic.WorkflowEnrichmentsNrqlArgs(
673
- name="Log Count",
674
- configurations=[newrelic.WorkflowEnrichmentsNrqlConfigurationArgs(
675
- query="SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
676
- )],
677
- )],
678
- ),
679
- destinations=[newrelic.WorkflowDestinationArgs(
680
- channel_id=newrelic_notification_channel["webhook-channel"]["id"],
681
- )])
670
+ issues_filter={
671
+ "name": "Filter-name",
672
+ "type": "FILTER",
673
+ "predicates": [{
674
+ "attribute": "accumulations.tag.team",
675
+ "operator": "EXACTLY_MATCHES",
676
+ "values": ["my_team"],
677
+ }],
678
+ },
679
+ enrichments={
680
+ "nrqls": [{
681
+ "name": "Log Count",
682
+ "configurations": [{
683
+ "query": "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
684
+ }],
685
+ }],
686
+ },
687
+ destinations=[{
688
+ "channel_id": webhook_channel["id"],
689
+ }])
682
690
  ```
683
- <!--End PulumiCodeChooser -->
684
691
 
685
692
  ### An example of a workflow with notification triggers
686
693
 
687
- <!--Start PulumiCodeChooser -->
688
694
  ```python
689
695
  import pulumi
690
696
  import pulumi_newrelic as newrelic
691
697
 
692
698
  workflow_example = newrelic.Workflow("workflow-example",
699
+ name="workflow-enrichment-example",
693
700
  muting_rules_handling="NOTIFY_ALL_ISSUES",
694
- issues_filter=newrelic.WorkflowIssuesFilterArgs(
695
- name="Filter-name",
696
- type="FILTER",
697
- predicates=[newrelic.WorkflowIssuesFilterPredicateArgs(
698
- attribute="accumulations.tag.team",
699
- operator="EXACTLY_MATCHES",
700
- values=["my_team"],
701
- )],
702
- ),
703
- destinations=[newrelic.WorkflowDestinationArgs(
704
- channel_id=newrelic_notification_channel["webhook-channel"]["id"],
705
- notification_triggers=["ACTIVATED"],
706
- )])
701
+ issues_filter={
702
+ "name": "Filter-name",
703
+ "type": "FILTER",
704
+ "predicates": [{
705
+ "attribute": "accumulations.tag.team",
706
+ "operator": "EXACTLY_MATCHES",
707
+ "values": ["my_team"],
708
+ }],
709
+ },
710
+ destinations=[{
711
+ "channel_id": webhook_channel["id"],
712
+ "notification_triggers": ["ACTIVATED"],
713
+ }])
707
714
  ```
708
- <!--End PulumiCodeChooser -->
709
715
 
710
716
  ## Additional Information
711
717
 
712
718
  More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
713
719
 
720
+ ### Moving from Legacy Alert Policy Channels to Workflows
721
+ As described in the documentation of this resource, mapping alert channels (created using `NotificationDestination` and `NotificationChannel`) to policies can be performed using the `Workflow` resource, which is an alternative to the legacy resource `AlertPolicyChannel` (which consumes alert channels created using the legacy resource `AlertChannel`).
722
+
723
+ Both of the legacy resources mentioned above, `AlertChannel` and `AlertPolicyChannel` are **deprecated** and will be **removed in a future major release**, as stated in the documentation of both of these resources.
724
+
725
+ If you're currently using `AlertChannel` and `AlertPolicyChannel` to manage alert channels linked to policies, we **strongly recommend** migrating to these workflows and notifications-based resources at the earliest.
726
+
727
+ Please refer to the examples in this page, or this example for illustrations on setting up channels and workflows with these resources.
728
+
714
729
  ## v3.3 changes
715
730
 
716
731
  In version v3.3 we renamed the following arguments:
@@ -747,13 +762,13 @@ class Workflow(pulumi.CustomResource):
747
762
  def _internal_init(__self__,
748
763
  resource_name: str,
749
764
  opts: Optional[pulumi.ResourceOptions] = None,
750
- account_id: Optional[pulumi.Input[int]] = None,
751
- destinations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationArgs']]]]] = None,
765
+ account_id: Optional[pulumi.Input[str]] = None,
766
+ destinations: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]]] = None,
752
767
  destinations_enabled: Optional[pulumi.Input[bool]] = None,
753
768
  enabled: Optional[pulumi.Input[bool]] = None,
754
- enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
769
+ enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
755
770
  enrichments_enabled: Optional[pulumi.Input[bool]] = None,
756
- issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
771
+ issues_filter: Optional[pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']]] = None,
757
772
  muting_rules_handling: Optional[pulumi.Input[str]] = None,
758
773
  name: Optional[pulumi.Input[str]] = None,
759
774
  __props__=None):
@@ -793,14 +808,14 @@ class Workflow(pulumi.CustomResource):
793
808
  def get(resource_name: str,
794
809
  id: pulumi.Input[str],
795
810
  opts: Optional[pulumi.ResourceOptions] = None,
796
- account_id: Optional[pulumi.Input[int]] = None,
797
- destinations: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationArgs']]]]] = None,
811
+ account_id: Optional[pulumi.Input[str]] = None,
812
+ destinations: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]]] = None,
798
813
  destinations_enabled: Optional[pulumi.Input[bool]] = None,
799
814
  enabled: Optional[pulumi.Input[bool]] = None,
800
- enrichments: Optional[pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']]] = None,
815
+ enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
801
816
  enrichments_enabled: Optional[pulumi.Input[bool]] = None,
802
817
  guid: Optional[pulumi.Input[str]] = None,
803
- issues_filter: Optional[pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']]] = None,
818
+ issues_filter: Optional[pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']]] = None,
804
819
  last_run: Optional[pulumi.Input[str]] = None,
805
820
  muting_rules_handling: Optional[pulumi.Input[str]] = None,
806
821
  name: Optional[pulumi.Input[str]] = None,
@@ -812,15 +827,15 @@ class Workflow(pulumi.CustomResource):
812
827
  :param str resource_name: The unique name of the resulting resource.
813
828
  :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
814
829
  :param pulumi.ResourceOptions opts: Options for the resource.
815
- :param pulumi.Input[int] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
816
- :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['WorkflowDestinationArgs']]]] destinations: Notification configuration. See Nested destination blocks below for details.
830
+ :param pulumi.Input[str] account_id: Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
831
+ :param pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]] destinations: Notification configuration. See Nested destination blocks below for details.
817
832
  :param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
818
833
  these two are different flags, but they are functionally identical. Defaults to true.
819
834
  :param pulumi.Input[bool] enabled: Whether workflow is enabled. Defaults to true.
820
- :param pulumi.Input[pulumi.InputType['WorkflowEnrichmentsArgs']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
835
+ :param pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
821
836
  :param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled. Defaults to true.
822
837
  :param pulumi.Input[str] guid: Workflow entity GUID
823
- :param pulumi.Input[pulumi.InputType['WorkflowIssuesFilterArgs']] issues_filter: A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
838
+ :param pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']] issues_filter: A filter used to identify issues handled by this workflow. See Nested issues_filter blocks below for details.
824
839
  :param pulumi.Input[str] last_run: The last time notification was sent for this workflow.
825
840
  :param pulumi.Input[str] muting_rules_handling: How to handle muted issues. See Muting Rules below for details.
826
841
  :param pulumi.Input[str] name: The name of the workflow.
@@ -846,7 +861,7 @@ class Workflow(pulumi.CustomResource):
846
861
 
847
862
  @property
848
863
  @pulumi.getter(name="accountId")
849
- def account_id(self) -> pulumi.Output[int]:
864
+ def account_id(self) -> pulumi.Output[str]:
850
865
  """
851
866
  Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
852
867
  """
@@ -862,14 +877,12 @@ class Workflow(pulumi.CustomResource):
862
877
 
863
878
  @property
864
879
  @pulumi.getter(name="destinationsEnabled")
880
+ @_utilities.deprecated("""Please use 'enabled' instead""")
865
881
  def destinations_enabled(self) -> pulumi.Output[Optional[bool]]:
866
882
  """
867
883
  **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
868
884
  these two are different flags, but they are functionally identical. Defaults to true.
869
885
  """
870
- warnings.warn("""Please use 'enabled' instead""", DeprecationWarning)
871
- pulumi.log.warn("""destinations_enabled is deprecated: Please use 'enabled' instead""")
872
-
873
886
  return pulumi.get(self, "destinations_enabled")
874
887
 
875
888
  @property