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.
- pulumi_newrelic/__init__.py +9 -0
- pulumi_newrelic/_inputs.py +7153 -461
- pulumi_newrelic/_utilities.py +41 -5
- pulumi_newrelic/account_management.py +13 -4
- pulumi_newrelic/alert_channel.py +122 -101
- pulumi_newrelic/alert_condition.py +120 -109
- pulumi_newrelic/alert_muting_rule.py +130 -74
- pulumi_newrelic/alert_policy.py +88 -67
- pulumi_newrelic/alert_policy_channel.py +81 -68
- pulumi_newrelic/api_access_key.py +49 -52
- pulumi_newrelic/browser_application.py +79 -76
- pulumi_newrelic/cloud/_inputs.py +2527 -1082
- pulumi_newrelic/cloud/aws_govcloud_integrations.py +135 -130
- pulumi_newrelic/cloud/aws_govcloud_link_account.py +25 -18
- pulumi_newrelic/cloud/aws_integrations.py +300 -1324
- pulumi_newrelic/cloud/aws_link_account.py +25 -18
- pulumi_newrelic/cloud/azure_integrations.py +523 -481
- pulumi_newrelic/cloud/azure_link_account.py +36 -29
- pulumi_newrelic/cloud/gcp_integrations.py +343 -320
- pulumi_newrelic/cloud/gcp_link_account.py +25 -18
- pulumi_newrelic/cloud/outputs.py +327 -1072
- pulumi_newrelic/config/__init__.pyi +6 -1
- pulumi_newrelic/config/vars.py +7 -2
- pulumi_newrelic/data_partition_rule.py +23 -16
- pulumi_newrelic/entity_tags.py +36 -31
- pulumi_newrelic/events_to_metrics_rule.py +27 -20
- pulumi_newrelic/get_account.py +24 -12
- pulumi_newrelic/get_alert_channel.py +26 -13
- pulumi_newrelic/get_alert_policy.py +35 -12
- pulumi_newrelic/get_application.py +39 -27
- pulumi_newrelic/get_authentication_domain.py +17 -9
- pulumi_newrelic/get_cloud_account.py +26 -14
- pulumi_newrelic/get_entity.py +90 -85
- pulumi_newrelic/get_group.py +58 -9
- pulumi_newrelic/get_key_transaction.py +109 -30
- pulumi_newrelic/get_notification_destination.py +64 -14
- pulumi_newrelic/get_obfuscation_expression.py +36 -24
- pulumi_newrelic/get_service_level_alert_helper.py +135 -105
- pulumi_newrelic/get_test_grok_pattern.py +29 -14
- pulumi_newrelic/get_user.py +17 -5
- pulumi_newrelic/group.py +5 -132
- pulumi_newrelic/infra_alert_condition.py +157 -140
- pulumi_newrelic/insights/_inputs.py +43 -0
- pulumi_newrelic/insights/event.py +50 -43
- pulumi_newrelic/insights/outputs.py +5 -0
- pulumi_newrelic/key_transaction.py +464 -0
- pulumi_newrelic/log_parsing_rule.py +29 -18
- pulumi_newrelic/monitor_downtime.py +215 -203
- pulumi_newrelic/notification_channel.py +387 -326
- pulumi_newrelic/notification_destination.py +248 -118
- pulumi_newrelic/nrql_alert_condition.py +353 -246
- pulumi_newrelic/nrql_drop_rule.py +57 -30
- pulumi_newrelic/obfuscation_expression.py +25 -18
- pulumi_newrelic/obfuscation_rule.py +40 -31
- pulumi_newrelic/one_dashboard.py +31 -26
- pulumi_newrelic/one_dashboard_json.py +21 -16
- pulumi_newrelic/one_dashboard_raw.py +112 -101
- pulumi_newrelic/outputs.py +2446 -245
- pulumi_newrelic/plugins/_inputs.py +145 -10
- pulumi_newrelic/plugins/application_settings.py +29 -20
- pulumi_newrelic/plugins/outputs.py +15 -10
- pulumi_newrelic/plugins/workload.py +285 -54
- pulumi_newrelic/provider.py +27 -33
- pulumi_newrelic/pulumi-plugin.json +2 -1
- pulumi_newrelic/service_level.py +193 -180
- pulumi_newrelic/synthetics/_inputs.py +159 -2
- pulumi_newrelic/synthetics/alert_condition.py +91 -78
- pulumi_newrelic/synthetics/broken_links_monitor.py +220 -93
- pulumi_newrelic/synthetics/cert_check_monitor.py +223 -94
- pulumi_newrelic/synthetics/get_private_location.py +34 -22
- pulumi_newrelic/synthetics/get_secure_credential.py +24 -12
- pulumi_newrelic/synthetics/monitor.py +352 -179
- pulumi_newrelic/synthetics/multi_location_alert_condition.py +109 -96
- pulumi_newrelic/synthetics/outputs.py +7 -2
- pulumi_newrelic/synthetics/private_location.py +27 -18
- pulumi_newrelic/synthetics/script_monitor.py +321 -168
- pulumi_newrelic/synthetics/secure_credential.py +25 -20
- pulumi_newrelic/synthetics/step_monitor.py +409 -98
- pulumi_newrelic/user.py +13 -6
- pulumi_newrelic/workflow.py +215 -184
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/METADATA +7 -6
- pulumi_newrelic-5.39.0a1736834464.dist-info/RECORD +90 -0
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/WHEEL +1 -1
- pulumi_newrelic-5.20.0a1709643785.dist-info/RECORD +0 -89
- {pulumi_newrelic-5.20.0a1709643785.dist-info → pulumi_newrelic-5.39.0a1736834464.dist-info}/top_level.txt +0 -0
pulumi_newrelic/workflow.py
CHANGED
@@ -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[
|
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[
|
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[
|
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[
|
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[
|
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[
|
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[
|
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[
|
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[
|
387
|
-
destinations: Optional[pulumi.Input[Sequence[pulumi.Input[
|
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[
|
391
|
+
enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
|
391
392
|
enrichments_enabled: Optional[pulumi.Input[bool]] = None,
|
392
|
-
issues_filter: Optional[pulumi.Input[
|
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):
|
@@ -404,20 +405,22 @@ class Workflow(pulumi.CustomResource):
|
|
404
405
|
import pulumi_newrelic as newrelic
|
405
406
|
|
406
407
|
foo = newrelic.Workflow("foo",
|
408
|
+
name="workflow-example",
|
407
409
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
408
|
-
issues_filter=
|
409
|
-
name
|
410
|
-
type
|
411
|
-
predicates
|
412
|
-
attribute
|
413
|
-
operator
|
414
|
-
values
|
415
|
-
|
416
|
-
|
417
|
-
destinations=[
|
418
|
-
channel_id
|
419
|
-
|
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
|
+
}])
|
420
422
|
```
|
423
|
+
|
421
424
|
## Policy-Based Workflow Example
|
422
425
|
|
423
426
|
This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
|
@@ -427,43 +430,46 @@ class Workflow(pulumi.CustomResource):
|
|
427
430
|
import pulumi_newrelic as newrelic
|
428
431
|
|
429
432
|
# Create a policy to track
|
430
|
-
my_policy = newrelic.AlertPolicy("my-policy")
|
433
|
+
my_policy = newrelic.AlertPolicy("my-policy", name="my_policy")
|
431
434
|
# Create a reusable notification destination
|
432
435
|
webhook_destination = newrelic.NotificationDestination("webhook-destination",
|
436
|
+
name="destination-webhook",
|
433
437
|
type="WEBHOOK",
|
434
|
-
properties=[
|
435
|
-
key
|
436
|
-
value
|
437
|
-
|
438
|
-
auth_basic=
|
439
|
-
user
|
440
|
-
password
|
441
|
-
)
|
438
|
+
properties=[{
|
439
|
+
"key": "url",
|
440
|
+
"value": "https://example.com",
|
441
|
+
}],
|
442
|
+
auth_basic={
|
443
|
+
"user": "username",
|
444
|
+
"password": "password",
|
445
|
+
})
|
442
446
|
# Create a notification channel to use in the workflow
|
443
447
|
webhook_channel = newrelic.NotificationChannel("webhook-channel",
|
448
|
+
name="channel-webhook",
|
444
449
|
type="WEBHOOK",
|
445
450
|
destination_id=webhook_destination.id,
|
446
451
|
product="IINT",
|
447
|
-
properties=[
|
448
|
-
key
|
449
|
-
value
|
450
|
-
label
|
451
|
-
|
452
|
+
properties=[{
|
453
|
+
"key": "payload",
|
454
|
+
"value": "{}",
|
455
|
+
"label": "Payload Template",
|
456
|
+
}])
|
452
457
|
# A workflow that matches issues that include incidents triggered by the policy
|
453
458
|
workflow_example = newrelic.Workflow("workflow-example",
|
459
|
+
name="workflow-example",
|
454
460
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
455
|
-
issues_filter=
|
456
|
-
name
|
457
|
-
type
|
458
|
-
predicates
|
459
|
-
attribute
|
460
|
-
operator
|
461
|
-
values
|
462
|
-
|
463
|
-
|
464
|
-
destinations=[
|
465
|
-
channel_id
|
466
|
-
|
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
|
+
}])
|
467
473
|
```
|
468
474
|
|
469
475
|
### An example of a workflow with enrichments
|
@@ -473,27 +479,28 @@ class Workflow(pulumi.CustomResource):
|
|
473
479
|
import pulumi_newrelic as newrelic
|
474
480
|
|
475
481
|
workflow_example = newrelic.Workflow("workflow-example",
|
482
|
+
name="workflow-enrichment-example",
|
476
483
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
477
|
-
issues_filter=
|
478
|
-
name
|
479
|
-
type
|
480
|
-
predicates
|
481
|
-
attribute
|
482
|
-
operator
|
483
|
-
values
|
484
|
-
|
485
|
-
|
486
|
-
enrichments=
|
487
|
-
nrqls
|
488
|
-
name
|
489
|
-
configurations
|
490
|
-
query
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
destinations=[
|
495
|
-
channel_id
|
496
|
-
|
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
|
+
}])
|
497
504
|
```
|
498
505
|
|
499
506
|
### An example of a workflow with notification triggers
|
@@ -503,26 +510,36 @@ class Workflow(pulumi.CustomResource):
|
|
503
510
|
import pulumi_newrelic as newrelic
|
504
511
|
|
505
512
|
workflow_example = newrelic.Workflow("workflow-example",
|
513
|
+
name="workflow-enrichment-example",
|
506
514
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
507
|
-
issues_filter=
|
508
|
-
name
|
509
|
-
type
|
510
|
-
predicates
|
511
|
-
attribute
|
512
|
-
operator
|
513
|
-
values
|
514
|
-
|
515
|
-
|
516
|
-
destinations=[
|
517
|
-
channel_id
|
518
|
-
notification_triggers
|
519
|
-
|
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
|
+
}])
|
520
528
|
```
|
521
529
|
|
522
530
|
## Additional Information
|
523
531
|
|
524
532
|
More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
|
525
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
|
+
|
526
543
|
## v3.3 changes
|
527
544
|
|
528
545
|
In version v3.3 we renamed the following arguments:
|
@@ -536,24 +553,24 @@ class Workflow(pulumi.CustomResource):
|
|
536
553
|
|
537
554
|
Workflows can be imported using the `id`, e.g.
|
538
555
|
|
539
|
-
|
556
|
+
bash
|
540
557
|
|
541
558
|
```sh
|
542
559
|
$ pulumi import newrelic:index/workflow:Workflow foo <id>
|
543
560
|
```
|
544
561
|
|
545
|
-
|
562
|
+
You can find the workflow ID from the workflow table by clicking on ... at the end of the row and choosing `Copy workflow id to clipboard`.
|
546
563
|
|
547
564
|
:param str resource_name: The name of the resource.
|
548
565
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
549
|
-
:param pulumi.Input[
|
550
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
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.
|
551
568
|
:param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
|
552
569
|
these two are different flags, but they are functionally identical. Defaults to true.
|
553
570
|
:param pulumi.Input[bool] enabled: Whether workflow is enabled. Defaults to true.
|
554
|
-
:param pulumi.Input[
|
571
|
+
:param pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
|
555
572
|
:param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled. Defaults to true.
|
556
|
-
:param pulumi.Input[
|
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.
|
557
574
|
:param pulumi.Input[str] muting_rules_handling: How to handle muted issues. See Muting Rules below for details.
|
558
575
|
:param pulumi.Input[str] name: The name of the workflow.
|
559
576
|
"""
|
@@ -574,20 +591,22 @@ class Workflow(pulumi.CustomResource):
|
|
574
591
|
import pulumi_newrelic as newrelic
|
575
592
|
|
576
593
|
foo = newrelic.Workflow("foo",
|
594
|
+
name="workflow-example",
|
577
595
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
578
|
-
issues_filter=
|
579
|
-
name
|
580
|
-
type
|
581
|
-
predicates
|
582
|
-
attribute
|
583
|
-
operator
|
584
|
-
values
|
585
|
-
|
586
|
-
|
587
|
-
destinations=[
|
588
|
-
channel_id
|
589
|
-
|
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
|
+
}])
|
590
608
|
```
|
609
|
+
|
591
610
|
## Policy-Based Workflow Example
|
592
611
|
|
593
612
|
This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
|
@@ -597,43 +616,46 @@ class Workflow(pulumi.CustomResource):
|
|
597
616
|
import pulumi_newrelic as newrelic
|
598
617
|
|
599
618
|
# Create a policy to track
|
600
|
-
my_policy = newrelic.AlertPolicy("my-policy")
|
619
|
+
my_policy = newrelic.AlertPolicy("my-policy", name="my_policy")
|
601
620
|
# Create a reusable notification destination
|
602
621
|
webhook_destination = newrelic.NotificationDestination("webhook-destination",
|
622
|
+
name="destination-webhook",
|
603
623
|
type="WEBHOOK",
|
604
|
-
properties=[
|
605
|
-
key
|
606
|
-
value
|
607
|
-
|
608
|
-
auth_basic=
|
609
|
-
user
|
610
|
-
password
|
611
|
-
)
|
624
|
+
properties=[{
|
625
|
+
"key": "url",
|
626
|
+
"value": "https://example.com",
|
627
|
+
}],
|
628
|
+
auth_basic={
|
629
|
+
"user": "username",
|
630
|
+
"password": "password",
|
631
|
+
})
|
612
632
|
# Create a notification channel to use in the workflow
|
613
633
|
webhook_channel = newrelic.NotificationChannel("webhook-channel",
|
634
|
+
name="channel-webhook",
|
614
635
|
type="WEBHOOK",
|
615
636
|
destination_id=webhook_destination.id,
|
616
637
|
product="IINT",
|
617
|
-
properties=[
|
618
|
-
key
|
619
|
-
value
|
620
|
-
label
|
621
|
-
|
638
|
+
properties=[{
|
639
|
+
"key": "payload",
|
640
|
+
"value": "{}",
|
641
|
+
"label": "Payload Template",
|
642
|
+
}])
|
622
643
|
# A workflow that matches issues that include incidents triggered by the policy
|
623
644
|
workflow_example = newrelic.Workflow("workflow-example",
|
645
|
+
name="workflow-example",
|
624
646
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
625
|
-
issues_filter=
|
626
|
-
name
|
627
|
-
type
|
628
|
-
predicates
|
629
|
-
attribute
|
630
|
-
operator
|
631
|
-
values
|
632
|
-
|
633
|
-
|
634
|
-
destinations=[
|
635
|
-
channel_id
|
636
|
-
|
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
|
+
}])
|
637
659
|
```
|
638
660
|
|
639
661
|
### An example of a workflow with enrichments
|
@@ -643,27 +665,28 @@ class Workflow(pulumi.CustomResource):
|
|
643
665
|
import pulumi_newrelic as newrelic
|
644
666
|
|
645
667
|
workflow_example = newrelic.Workflow("workflow-example",
|
668
|
+
name="workflow-enrichment-example",
|
646
669
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
647
|
-
issues_filter=
|
648
|
-
name
|
649
|
-
type
|
650
|
-
predicates
|
651
|
-
attribute
|
652
|
-
operator
|
653
|
-
values
|
654
|
-
|
655
|
-
|
656
|
-
enrichments=
|
657
|
-
nrqls
|
658
|
-
name
|
659
|
-
configurations
|
660
|
-
query
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
destinations=[
|
665
|
-
channel_id
|
666
|
-
|
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
|
+
}])
|
667
690
|
```
|
668
691
|
|
669
692
|
### An example of a workflow with notification triggers
|
@@ -673,26 +696,36 @@ class Workflow(pulumi.CustomResource):
|
|
673
696
|
import pulumi_newrelic as newrelic
|
674
697
|
|
675
698
|
workflow_example = newrelic.Workflow("workflow-example",
|
699
|
+
name="workflow-enrichment-example",
|
676
700
|
muting_rules_handling="NOTIFY_ALL_ISSUES",
|
677
|
-
issues_filter=
|
678
|
-
name
|
679
|
-
type
|
680
|
-
predicates
|
681
|
-
attribute
|
682
|
-
operator
|
683
|
-
values
|
684
|
-
|
685
|
-
|
686
|
-
destinations=[
|
687
|
-
channel_id
|
688
|
-
notification_triggers
|
689
|
-
|
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
|
+
}])
|
690
714
|
```
|
691
715
|
|
692
716
|
## Additional Information
|
693
717
|
|
694
718
|
More details about the workflows can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/applied-intelligence/incident-workflows/incident-workflows/).
|
695
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
|
+
|
696
729
|
## v3.3 changes
|
697
730
|
|
698
731
|
In version v3.3 we renamed the following arguments:
|
@@ -706,13 +739,13 @@ class Workflow(pulumi.CustomResource):
|
|
706
739
|
|
707
740
|
Workflows can be imported using the `id`, e.g.
|
708
741
|
|
709
|
-
|
742
|
+
bash
|
710
743
|
|
711
744
|
```sh
|
712
745
|
$ pulumi import newrelic:index/workflow:Workflow foo <id>
|
713
746
|
```
|
714
747
|
|
715
|
-
|
748
|
+
You can find the workflow ID from the workflow table by clicking on ... at the end of the row and choosing `Copy workflow id to clipboard`.
|
716
749
|
|
717
750
|
:param str resource_name: The name of the resource.
|
718
751
|
:param WorkflowArgs args: The arguments to use to populate this resource's properties.
|
@@ -729,13 +762,13 @@ class Workflow(pulumi.CustomResource):
|
|
729
762
|
def _internal_init(__self__,
|
730
763
|
resource_name: str,
|
731
764
|
opts: Optional[pulumi.ResourceOptions] = None,
|
732
|
-
account_id: Optional[pulumi.Input[
|
733
|
-
destinations: Optional[pulumi.Input[Sequence[pulumi.Input[
|
765
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
766
|
+
destinations: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]]] = None,
|
734
767
|
destinations_enabled: Optional[pulumi.Input[bool]] = None,
|
735
768
|
enabled: Optional[pulumi.Input[bool]] = None,
|
736
|
-
enrichments: Optional[pulumi.Input[
|
769
|
+
enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
|
737
770
|
enrichments_enabled: Optional[pulumi.Input[bool]] = None,
|
738
|
-
issues_filter: Optional[pulumi.Input[
|
771
|
+
issues_filter: Optional[pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']]] = None,
|
739
772
|
muting_rules_handling: Optional[pulumi.Input[str]] = None,
|
740
773
|
name: Optional[pulumi.Input[str]] = None,
|
741
774
|
__props__=None):
|
@@ -775,14 +808,14 @@ class Workflow(pulumi.CustomResource):
|
|
775
808
|
def get(resource_name: str,
|
776
809
|
id: pulumi.Input[str],
|
777
810
|
opts: Optional[pulumi.ResourceOptions] = None,
|
778
|
-
account_id: Optional[pulumi.Input[
|
779
|
-
destinations: Optional[pulumi.Input[Sequence[pulumi.Input[
|
811
|
+
account_id: Optional[pulumi.Input[str]] = None,
|
812
|
+
destinations: Optional[pulumi.Input[Sequence[pulumi.Input[Union['WorkflowDestinationArgs', 'WorkflowDestinationArgsDict']]]]] = None,
|
780
813
|
destinations_enabled: Optional[pulumi.Input[bool]] = None,
|
781
814
|
enabled: Optional[pulumi.Input[bool]] = None,
|
782
|
-
enrichments: Optional[pulumi.Input[
|
815
|
+
enrichments: Optional[pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']]] = None,
|
783
816
|
enrichments_enabled: Optional[pulumi.Input[bool]] = None,
|
784
817
|
guid: Optional[pulumi.Input[str]] = None,
|
785
|
-
issues_filter: Optional[pulumi.Input[
|
818
|
+
issues_filter: Optional[pulumi.Input[Union['WorkflowIssuesFilterArgs', 'WorkflowIssuesFilterArgsDict']]] = None,
|
786
819
|
last_run: Optional[pulumi.Input[str]] = None,
|
787
820
|
muting_rules_handling: Optional[pulumi.Input[str]] = None,
|
788
821
|
name: Optional[pulumi.Input[str]] = None,
|
@@ -794,15 +827,15 @@ class Workflow(pulumi.CustomResource):
|
|
794
827
|
:param str resource_name: The unique name of the resulting resource.
|
795
828
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
796
829
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
797
|
-
:param pulumi.Input[
|
798
|
-
:param pulumi.Input[Sequence[pulumi.Input[
|
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.
|
799
832
|
:param pulumi.Input[bool] destinations_enabled: **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
|
800
833
|
these two are different flags, but they are functionally identical. Defaults to true.
|
801
834
|
:param pulumi.Input[bool] enabled: Whether workflow is enabled. Defaults to true.
|
802
|
-
:param pulumi.Input[
|
835
|
+
:param pulumi.Input[Union['WorkflowEnrichmentsArgs', 'WorkflowEnrichmentsArgsDict']] enrichments: Workflow's enrichments. See Nested enrichments blocks below for details.
|
803
836
|
:param pulumi.Input[bool] enrichments_enabled: Whether enrichments are enabled. Defaults to true.
|
804
837
|
:param pulumi.Input[str] guid: Workflow entity GUID
|
805
|
-
:param pulumi.Input[
|
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.
|
806
839
|
:param pulumi.Input[str] last_run: The last time notification was sent for this workflow.
|
807
840
|
:param pulumi.Input[str] muting_rules_handling: How to handle muted issues. See Muting Rules below for details.
|
808
841
|
:param pulumi.Input[str] name: The name of the workflow.
|
@@ -828,7 +861,7 @@ class Workflow(pulumi.CustomResource):
|
|
828
861
|
|
829
862
|
@property
|
830
863
|
@pulumi.getter(name="accountId")
|
831
|
-
def account_id(self) -> pulumi.Output[
|
864
|
+
def account_id(self) -> pulumi.Output[str]:
|
832
865
|
"""
|
833
866
|
Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
|
834
867
|
"""
|
@@ -844,14 +877,12 @@ class Workflow(pulumi.CustomResource):
|
|
844
877
|
|
845
878
|
@property
|
846
879
|
@pulumi.getter(name="destinationsEnabled")
|
880
|
+
@_utilities.deprecated("""Please use 'enabled' instead""")
|
847
881
|
def destinations_enabled(self) -> pulumi.Output[Optional[bool]]:
|
848
882
|
"""
|
849
883
|
**DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
|
850
884
|
these two are different flags, but they are functionally identical. Defaults to true.
|
851
885
|
"""
|
852
|
-
warnings.warn("""Please use 'enabled' instead""", DeprecationWarning)
|
853
|
-
pulumi.log.warn("""destinations_enabled is deprecated: Please use 'enabled' instead""")
|
854
|
-
|
855
886
|
return pulumi.get(self, "destinations_enabled")
|
856
887
|
|
857
888
|
@property
|