@pulumi/newrelic 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/alertChannel.d.ts +2 -1
  2. package/alertChannel.js +22 -22
  3. package/alertChannel.js.map +1 -1
  4. package/alertCondition.d.ts +8 -7
  5. package/alertCondition.js +22 -22
  6. package/alertCondition.js.map +1 -1
  7. package/alertMutingRule.d.ts +5 -4
  8. package/alertMutingRule.js +22 -22
  9. package/alertMutingRule.js.map +1 -1
  10. package/alertPolicy.js +20 -20
  11. package/alertPolicy.js.map +1 -1
  12. package/alertPolicyChannel.js +22 -22
  13. package/alertPolicyChannel.js.map +1 -1
  14. package/apiAccessKey.js +24 -22
  15. package/apiAccessKey.js.map +1 -1
  16. package/cloud/awsGovcloudIntegrations.d.ts +2 -1
  17. package/cloud/awsGovcloudIntegrations.js +22 -22
  18. package/cloud/awsGovcloudIntegrations.js.map +1 -1
  19. package/cloud/awsGovcloudLinkAccount.js +26 -24
  20. package/cloud/awsGovcloudLinkAccount.js.map +1 -1
  21. package/cloud/awsIntegrations.d.ts +2 -1
  22. package/cloud/awsIntegrations.js +22 -22
  23. package/cloud/awsIntegrations.js.map +1 -1
  24. package/cloud/awsLinkAccount.js +22 -22
  25. package/cloud/awsLinkAccount.js.map +1 -1
  26. package/cloud/azureIntegrations.d.ts +89 -64
  27. package/cloud/azureIntegrations.js +26 -22
  28. package/cloud/azureIntegrations.js.map +1 -1
  29. package/cloud/azureLinkAccount.js +25 -23
  30. package/cloud/azureLinkAccount.js.map +1 -1
  31. package/cloud/gcpIntegrations.d.ts +14 -1
  32. package/cloud/gcpIntegrations.js +24 -22
  33. package/cloud/gcpIntegrations.js.map +1 -1
  34. package/cloud/gcpLinkAccount.js +21 -21
  35. package/cloud/gcpLinkAccount.js.map +1 -1
  36. package/cloud/index.d.ts +24 -8
  37. package/cloud/index.js +25 -40
  38. package/cloud/index.js.map +1 -1
  39. package/entityTags.d.ts +2 -32
  40. package/entityTags.js +22 -53
  41. package/entityTags.js.map +1 -1
  42. package/eventsToMetricsRule.js +22 -22
  43. package/eventsToMetricsRule.js.map +1 -1
  44. package/getAlertChannel.d.ts +1 -1
  45. package/getAlertChannel.js.map +1 -1
  46. package/getEntity.d.ts +14 -4
  47. package/getEntity.js +1 -1
  48. package/getEntity.js.map +1 -1
  49. package/getObfuscationExpression.d.ts +65 -0
  50. package/getObfuscationExpression.js +48 -0
  51. package/getObfuscationExpression.js.map +1 -0
  52. package/index.d.ts +87 -26
  53. package/index.js +92 -81
  54. package/index.js.map +1 -1
  55. package/infraAlertCondition.d.ts +11 -10
  56. package/infraAlertCondition.js +22 -22
  57. package/infraAlertCondition.js.map +1 -1
  58. package/insights/event.d.ts +2 -1
  59. package/insights/event.js +17 -17
  60. package/insights/event.js.map +1 -1
  61. package/insights/index.d.ts +3 -1
  62. package/insights/index.js +4 -19
  63. package/insights/index.js.map +1 -1
  64. package/notificationChannel.d.ts +68 -13
  65. package/notificationChannel.js +88 -34
  66. package/notificationChannel.js.map +1 -1
  67. package/notificationDestination.d.ts +2 -1
  68. package/notificationDestination.js +22 -22
  69. package/notificationDestination.js.map +1 -1
  70. package/nrqlAlertCondition.d.ts +22 -21
  71. package/nrqlAlertCondition.js +27 -27
  72. package/nrqlAlertCondition.js.map +1 -1
  73. package/nrqlDropRule.js +22 -22
  74. package/nrqlDropRule.js.map +1 -1
  75. package/obfuscationExpression.d.ts +108 -0
  76. package/obfuscationExpression.js +82 -0
  77. package/obfuscationExpression.js.map +1 -0
  78. package/obfuscationRule.d.ts +143 -0
  79. package/obfuscationRule.js +101 -0
  80. package/obfuscationRule.js.map +1 -0
  81. package/oneDashboard.d.ts +113 -3
  82. package/oneDashboard.js +123 -24
  83. package/oneDashboard.js.map +1 -1
  84. package/oneDashboardJson.d.ts +3 -15
  85. package/oneDashboardJson.js +22 -34
  86. package/oneDashboardJson.js.map +1 -1
  87. package/oneDashboardRaw.d.ts +4 -1
  88. package/oneDashboardRaw.js +24 -22
  89. package/oneDashboardRaw.js.map +1 -1
  90. package/package.json +2 -2
  91. package/package.json.dev +2 -2
  92. package/plugins/applicationSettings.js +22 -22
  93. package/plugins/applicationSettings.js.map +1 -1
  94. package/plugins/index.d.ts +6 -2
  95. package/plugins/index.js +7 -22
  96. package/plugins/index.js.map +1 -1
  97. package/plugins/workload.d.ts +120 -2
  98. package/plugins/workload.js +110 -23
  99. package/plugins/workload.js.map +1 -1
  100. package/provider.d.ts +3 -3
  101. package/provider.js +19 -14
  102. package/provider.js.map +1 -1
  103. package/serviceLevel.d.ts +2 -1
  104. package/serviceLevel.js +22 -22
  105. package/serviceLevel.js.map +1 -1
  106. package/synthetics/alertCondition.js +22 -22
  107. package/synthetics/alertCondition.js.map +1 -1
  108. package/synthetics/brokenLinksMonitor.d.ts +9 -8
  109. package/synthetics/brokenLinksMonitor.js +26 -26
  110. package/synthetics/brokenLinksMonitor.js.map +1 -1
  111. package/synthetics/certCheckMonitor.d.ts +6 -5
  112. package/synthetics/certCheckMonitor.js +26 -26
  113. package/synthetics/certCheckMonitor.js.map +1 -1
  114. package/synthetics/getPrivateLocation.d.ts +35 -0
  115. package/synthetics/getPrivateLocation.js +27 -0
  116. package/synthetics/getPrivateLocation.js.map +1 -1
  117. package/synthetics/getSecureCredential.d.ts +1 -0
  118. package/synthetics/getSecureCredential.js.map +1 -1
  119. package/synthetics/index.d.ts +33 -11
  120. package/synthetics/index.js +34 -45
  121. package/synthetics/index.js.map +1 -1
  122. package/synthetics/monitor.d.ts +29 -33
  123. package/synthetics/monitor.js +40 -45
  124. package/synthetics/monitor.js.map +1 -1
  125. package/synthetics/multiLocationAlertCondition.d.ts +2 -1
  126. package/synthetics/multiLocationAlertCondition.js +22 -22
  127. package/synthetics/multiLocationAlertCondition.js.map +1 -1
  128. package/synthetics/privateLocation.d.ts +7 -8
  129. package/synthetics/privateLocation.js +24 -25
  130. package/synthetics/privateLocation.js.map +1 -1
  131. package/synthetics/scriptMonitor.d.ts +15 -21
  132. package/synthetics/scriptMonitor.js +32 -39
  133. package/synthetics/scriptMonitor.js.map +1 -1
  134. package/synthetics/secureCredential.js +25 -23
  135. package/synthetics/secureCredential.js.map +1 -1
  136. package/synthetics/stepMonitor.d.ts +6 -5
  137. package/synthetics/stepMonitor.js +26 -26
  138. package/synthetics/stepMonitor.js.map +1 -1
  139. package/types/index.js.map +1 -1
  140. package/types/input.d.ts +288 -72
  141. package/types/output.d.ts +282 -72
  142. package/utilities.js +13 -1
  143. package/utilities.js.map +1 -1
  144. package/workflow.d.ts +99 -112
  145. package/workflow.js +82 -105
  146. package/workflow.js.map +1 -1
package/utilities.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
3
3
  // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.resourceOptsDefaults = exports.getVersion = exports.getEnvNumber = exports.getEnvBoolean = exports.getEnv = void 0;
5
+ exports.lazyLoad = exports.resourceOptsDefaults = exports.getVersion = exports.getEnvNumber = exports.getEnvBoolean = exports.getEnv = void 0;
6
6
  function getEnv(...vars) {
7
7
  for (const v of vars) {
8
8
  const value = process.env[v];
@@ -54,4 +54,16 @@ function resourceOptsDefaults() {
54
54
  return { version: getVersion() };
55
55
  }
56
56
  exports.resourceOptsDefaults = resourceOptsDefaults;
57
+ /** @internal */
58
+ function lazyLoad(exports, props, loadModule) {
59
+ for (let property of props) {
60
+ Object.defineProperty(exports, property, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return loadModule()[property];
64
+ },
65
+ });
66
+ }
67
+ }
68
+ exports.lazyLoad = lazyLoad;
57
69
  //# sourceMappingURL=utilities.js.map
package/utilities.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../utilities.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AA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i/pulumi";
2
- import { input as inputs, output as outputs } from "./types";
2
+ import * as inputs from "./types/input";
3
+ import * as outputs from "./types/output";
3
4
  /**
4
- * Use this resource to create and manage New Relic workflow.
5
+ * Use this resource to create and manage New Relic workflows.
5
6
  *
6
7
  * ## Example Usage
7
8
  *
@@ -11,130 +12,97 @@ import { input as inputs, output as outputs } from "./types";
11
12
  * import * as newrelic from "@pulumi/newrelic";
12
13
  *
13
14
  * const foo = new newrelic.Workflow("foo", {
14
- * accountId: 12345678,
15
- * destinations: [
16
- * {
17
- * channelId: "20d86999-169c-461a-9c16-3cf330f4b3aa",
18
- * },
19
- * {
20
- * channelId: "e6af0870-cabb-453f-bf0d-fb2b6a14e05c",
21
- * },
22
- * ],
23
- * destinationsEnabled: true,
24
- * enabled: true,
25
- * enrichments: {
26
- * nrqls: [
27
- * {
28
- * configurations: [{
29
- * query: "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
30
- * }],
31
- * name: "Log",
32
- * },
33
- * {
34
- * configurations: [{
35
- * query: "SELECT count(*) FROM Metric WHERE metricName = 'myMetric'",
36
- * }],
37
- * name: "Metric",
38
- * },
39
- * ],
40
- * },
41
- * enrichmentsEnabled: true,
15
+ * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
42
16
  * issuesFilter: {
43
17
  * name: "filter-name",
18
+ * type: "FILTER",
44
19
  * predicates: [{
45
- * attribute: "accumulations.sources",
20
+ * attribute: "accumulations.tag.team",
46
21
  * operator: "EXACTLY_MATCHES",
47
- * values: [
48
- * "newrelic",
49
- * "pagerduty",
50
- * ],
22
+ * values: ["growth"],
51
23
  * }],
52
- * type: "FILTER",
53
24
  * },
54
- * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
25
+ * destinations: [{
26
+ * channelId: newrelic_notification_channel.some_channel.id,
27
+ * }],
55
28
  * });
56
29
  * ```
57
- * ## Full Scenario Example
30
+ * ## Policy-Based Workflow Example
58
31
  *
59
- * Create a destination resource and reference that destination to the channel resource. Then create a workflow and reference the channel resource to it.
32
+ * This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
60
33
  *
61
- * ### Create a policy
62
- * ```typescript
63
- * import * as pulumi from "@pulumi/pulumi";
64
- * import * as newrelic from "@pulumi/newrelic";
65
- *
66
- * const collector_policy = new newrelic.AlertPolicy("collector-policy", {});
67
- * ```
68
- *
69
- * ### Create a destination
70
34
  * ```typescript
71
35
  * import * as pulumi from "@pulumi/pulumi";
72
36
  * import * as newrelic from "@pulumi/newrelic";
73
37
  *
38
+ * // Create a policy to track
39
+ * const my_policy = new newrelic.AlertPolicy("my-policy", {});
40
+ * // Create a reusable notification destination
74
41
  * const webhook_destination = new newrelic.NotificationDestination("webhook-destination", {
75
- * accountId: 12345678,
76
- * authBasic: {
77
- * password: "password",
78
- * user: "username",
79
- * },
42
+ * type: "WEBHOOK",
80
43
  * properties: [{
81
44
  * key: "url",
82
- * value: "https://webhook.mywebhook.com",
45
+ * value: "https://example.com",
83
46
  * }],
84
- * type: "WEBHOOK",
47
+ * authBasic: {
48
+ * user: "username",
49
+ * password: "password",
50
+ * },
85
51
  * });
86
- * ```
87
- *
88
- * ### Create a channel
89
- * ```typescript
90
- * import * as pulumi from "@pulumi/pulumi";
91
- * import * as newrelic from "@pulumi/newrelic";
92
- *
52
+ * // Create a notification channel to use in the workflow
93
53
  * const webhook_channel = new newrelic.NotificationChannel("webhook-channel", {
94
- * accountId: 12345678,
95
54
  * type: "WEBHOOK",
96
- * destinationId: newrelic_notification_destination["webhook-destination"].id,
55
+ * destinationId: webhook_destination.id,
97
56
  * product: "IINT",
98
57
  * properties: [{
99
58
  * key: "payload",
100
- * value: "{name: {{ variable }} }",
59
+ * value: "{}",
101
60
  * label: "Payload Template",
102
61
  * }],
103
62
  * });
63
+ * // A workflow that matches issues that include incidents triggered by the policy
64
+ * const workflow_example = new newrelic.Workflow("workflow-example", {
65
+ * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
66
+ * issuesFilter: {
67
+ * name: "Filter-name",
68
+ * type: "FILTER",
69
+ * predicates: [{
70
+ * attribute: "labels.policyIds",
71
+ * operator: "EXACTLY_MATCHES",
72
+ * values: [my_policy.id],
73
+ * }],
74
+ * },
75
+ * destinations: [{
76
+ * channelId: webhook_channel.id,
77
+ * }],
78
+ * });
104
79
  * ```
105
80
  *
106
- * ### Create a workflow
81
+ * ### An example of a workflow with enrichments
82
+ *
107
83
  * ```typescript
108
84
  * import * as pulumi from "@pulumi/pulumi";
109
85
  * import * as newrelic from "@pulumi/newrelic";
110
86
  *
111
87
  * const workflow_example = new newrelic.Workflow("workflow-example", {
112
- * accountId: 12345678,
113
88
  * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
89
+ * issuesFilter: {
90
+ * name: "Filter-name",
91
+ * type: "FILTER",
92
+ * predicates: [{
93
+ * attribute: "accumulations.tag.team",
94
+ * operator: "EXACTLY_MATCHES",
95
+ * values: ["my_team"],
96
+ * }],
97
+ * },
114
98
  * enrichments: {
115
99
  * nrqls: [{
116
- * name: "Log count",
100
+ * name: "Log Count",
117
101
  * configurations: [{
118
102
  * query: `SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago`,
119
103
  * }],
120
104
  * }],
121
105
  * },
122
- * issuesFilter: {
123
- * name: "Filter-name",
124
- * type: "FILTER",
125
- * predicates: [
126
- * {
127
- * attribute: "accumulations.policyName",
128
- * operator: "EXACTLY_MATCHES",
129
- * values: ["my_policy"],
130
- * },
131
- * {
132
- * attribute: "accumulations.sources",
133
- * operator: "EXACTLY_MATCHES",
134
- * values: ["newrelic"],
135
- * },
136
- * ],
137
- * },
138
106
  * destinations: [{
139
107
  * channelId: newrelic_notification_channel["webhook-channel"].id,
140
108
  * }],
@@ -153,6 +121,16 @@ import { input as inputs, output as outputs } from "./types";
153
121
  * - `destinationConfiguration` changed to `destination`.
154
122
  * - `predicates` changed to `predicate`.
155
123
  * - Enrichment's `configurations` changed to `configuration`.
124
+ *
125
+ * ## Import
126
+ *
127
+ * Workflows can be imported using the `id`, e.g. bash
128
+ *
129
+ * ```sh
130
+ * $ pulumi import newrelic:index/workflow:Workflow foo <id>
131
+ * ```
132
+ *
133
+ * 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`.
156
134
  */
157
135
  export declare class Workflow extends pulumi.CustomResource {
158
136
  /**
@@ -171,31 +149,34 @@ export declare class Workflow extends pulumi.CustomResource {
171
149
  */
172
150
  static isInstance(obj: any): obj is Workflow;
173
151
  /**
174
- * Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
152
+ * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
175
153
  */
176
- readonly accountId: pulumi.Output<number | undefined>;
154
+ readonly accountId: pulumi.Output<number>;
177
155
  /**
178
- * A nested block that contains a channel id.
156
+ * Notification configuration. See Nested destination blocks below for details.
179
157
  */
180
158
  readonly destinations: pulumi.Output<outputs.WorkflowDestination[]>;
181
159
  /**
182
- * Whether destinations are enabled..
160
+ * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
161
+ * these two are different flags, but they are functionally identical. Defaults to true.
162
+ *
163
+ * @deprecated Please use 'enabled' instead
183
164
  */
184
165
  readonly destinationsEnabled: pulumi.Output<boolean | undefined>;
185
166
  /**
186
- * Whether workflow is enabled.
167
+ * Whether workflow is enabled. Defaults to true.
187
168
  */
188
169
  readonly enabled: pulumi.Output<boolean | undefined>;
189
170
  /**
190
- * A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
171
+ * Workflow's enrichments. See Nested enrichments blocks below for details.
191
172
  */
192
173
  readonly enrichments: pulumi.Output<outputs.WorkflowEnrichments | undefined>;
193
174
  /**
194
- * Whether enrichments are enabled..
175
+ * Whether enrichments are enabled. Defaults to true.
195
176
  */
196
177
  readonly enrichmentsEnabled: pulumi.Output<boolean | undefined>;
197
178
  /**
198
- * The issues filter. See Nested issuesFilter blocks below for details.
179
+ * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details.
199
180
  */
200
181
  readonly issuesFilter: pulumi.Output<outputs.WorkflowIssuesFilter>;
201
182
  /**
@@ -203,11 +184,11 @@ export declare class Workflow extends pulumi.CustomResource {
203
184
  */
204
185
  readonly lastRun: pulumi.Output<string>;
205
186
  /**
206
- * Which muting rule handling this workflow has.
187
+ * How to handle muted issues. See Muting Rules below for details.
207
188
  */
208
189
  readonly mutingRulesHandling: pulumi.Output<string>;
209
190
  /**
210
- * A nrql enrichment name.
191
+ * A nrql enrichment name. This name can be used in your notification templates (see notificationChannel documentation)
211
192
  */
212
193
  readonly name: pulumi.Output<string>;
213
194
  /**
@@ -228,31 +209,34 @@ export declare class Workflow extends pulumi.CustomResource {
228
209
  */
229
210
  export interface WorkflowState {
230
211
  /**
231
- * Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
212
+ * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
232
213
  */
233
214
  accountId?: pulumi.Input<number>;
234
215
  /**
235
- * A nested block that contains a channel id.
216
+ * Notification configuration. See Nested destination blocks below for details.
236
217
  */
237
218
  destinations?: pulumi.Input<pulumi.Input<inputs.WorkflowDestination>[]>;
238
219
  /**
239
- * Whether destinations are enabled..
220
+ * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
221
+ * these two are different flags, but they are functionally identical. Defaults to true.
222
+ *
223
+ * @deprecated Please use 'enabled' instead
240
224
  */
241
225
  destinationsEnabled?: pulumi.Input<boolean>;
242
226
  /**
243
- * Whether workflow is enabled.
227
+ * Whether workflow is enabled. Defaults to true.
244
228
  */
245
229
  enabled?: pulumi.Input<boolean>;
246
230
  /**
247
- * A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
231
+ * Workflow's enrichments. See Nested enrichments blocks below for details.
248
232
  */
249
233
  enrichments?: pulumi.Input<inputs.WorkflowEnrichments>;
250
234
  /**
251
- * Whether enrichments are enabled..
235
+ * Whether enrichments are enabled. Defaults to true.
252
236
  */
253
237
  enrichmentsEnabled?: pulumi.Input<boolean>;
254
238
  /**
255
- * The issues filter. See Nested issuesFilter blocks below for details.
239
+ * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details.
256
240
  */
257
241
  issuesFilter?: pulumi.Input<inputs.WorkflowIssuesFilter>;
258
242
  /**
@@ -260,11 +244,11 @@ export interface WorkflowState {
260
244
  */
261
245
  lastRun?: pulumi.Input<string>;
262
246
  /**
263
- * Which muting rule handling this workflow has.
247
+ * How to handle muted issues. See Muting Rules below for details.
264
248
  */
265
249
  mutingRulesHandling?: pulumi.Input<string>;
266
250
  /**
267
- * A nrql enrichment name.
251
+ * A nrql enrichment name. This name can be used in your notification templates (see notificationChannel documentation)
268
252
  */
269
253
  name?: pulumi.Input<string>;
270
254
  /**
@@ -277,39 +261,42 @@ export interface WorkflowState {
277
261
  */
278
262
  export interface WorkflowArgs {
279
263
  /**
280
- * Determines the New Relic account where the workflow will be created. Defaults to the account associated with the API key used.
264
+ * Determines the New Relic account in which the workflow is created. Defaults to the account defined in the provider section.
281
265
  */
282
266
  accountId?: pulumi.Input<number>;
283
267
  /**
284
- * A nested block that contains a channel id.
268
+ * Notification configuration. See Nested destination blocks below for details.
285
269
  */
286
270
  destinations: pulumi.Input<pulumi.Input<inputs.WorkflowDestination>[]>;
287
271
  /**
288
- * Whether destinations are enabled..
272
+ * **DEPRECATED** Whether destinations are enabled. Please use `enabled` instead:
273
+ * these two are different flags, but they are functionally identical. Defaults to true.
274
+ *
275
+ * @deprecated Please use 'enabled' instead
289
276
  */
290
277
  destinationsEnabled?: pulumi.Input<boolean>;
291
278
  /**
292
- * Whether workflow is enabled.
279
+ * Whether workflow is enabled. Defaults to true.
293
280
  */
294
281
  enabled?: pulumi.Input<boolean>;
295
282
  /**
296
- * A nested block that describes a workflow's enrichments. See Nested enrichments blocks below for details.
283
+ * Workflow's enrichments. See Nested enrichments blocks below for details.
297
284
  */
298
285
  enrichments?: pulumi.Input<inputs.WorkflowEnrichments>;
299
286
  /**
300
- * Whether enrichments are enabled..
287
+ * Whether enrichments are enabled. Defaults to true.
301
288
  */
302
289
  enrichmentsEnabled?: pulumi.Input<boolean>;
303
290
  /**
304
- * The issues filter. See Nested issuesFilter blocks below for details.
291
+ * A filter used to identify issues handled by this workflow. See Nested issuesFilter blocks below for details.
305
292
  */
306
293
  issuesFilter: pulumi.Input<inputs.WorkflowIssuesFilter>;
307
294
  /**
308
- * Which muting rule handling this workflow has.
295
+ * How to handle muted issues. See Muting Rules below for details.
309
296
  */
310
297
  mutingRulesHandling: pulumi.Input<string>;
311
298
  /**
312
- * A nrql enrichment name.
299
+ * A nrql enrichment name. This name can be used in your notification templates (see notificationChannel documentation)
313
300
  */
314
301
  name?: pulumi.Input<string>;
315
302
  }
package/workflow.js CHANGED
@@ -6,7 +6,7 @@ exports.Workflow = void 0;
6
6
  const pulumi = require("@pulumi/pulumi");
7
7
  const utilities = require("./utilities");
8
8
  /**
9
- * Use this resource to create and manage New Relic workflow.
9
+ * Use this resource to create and manage New Relic workflows.
10
10
  *
11
11
  * ## Example Usage
12
12
  *
@@ -16,130 +16,97 @@ const utilities = require("./utilities");
16
16
  * import * as newrelic from "@pulumi/newrelic";
17
17
  *
18
18
  * const foo = new newrelic.Workflow("foo", {
19
- * accountId: 12345678,
20
- * destinations: [
21
- * {
22
- * channelId: "20d86999-169c-461a-9c16-3cf330f4b3aa",
23
- * },
24
- * {
25
- * channelId: "e6af0870-cabb-453f-bf0d-fb2b6a14e05c",
26
- * },
27
- * ],
28
- * destinationsEnabled: true,
29
- * enabled: true,
30
- * enrichments: {
31
- * nrqls: [
32
- * {
33
- * configurations: [{
34
- * query: "SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago",
35
- * }],
36
- * name: "Log",
37
- * },
38
- * {
39
- * configurations: [{
40
- * query: "SELECT count(*) FROM Metric WHERE metricName = 'myMetric'",
41
- * }],
42
- * name: "Metric",
43
- * },
44
- * ],
45
- * },
46
- * enrichmentsEnabled: true,
19
+ * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
47
20
  * issuesFilter: {
48
21
  * name: "filter-name",
22
+ * type: "FILTER",
49
23
  * predicates: [{
50
- * attribute: "accumulations.sources",
24
+ * attribute: "accumulations.tag.team",
51
25
  * operator: "EXACTLY_MATCHES",
52
- * values: [
53
- * "newrelic",
54
- * "pagerduty",
55
- * ],
26
+ * values: ["growth"],
56
27
  * }],
57
- * type: "FILTER",
58
28
  * },
59
- * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
29
+ * destinations: [{
30
+ * channelId: newrelic_notification_channel.some_channel.id,
31
+ * }],
60
32
  * });
61
33
  * ```
62
- * ## Full Scenario Example
63
- *
64
- * Create a destination resource and reference that destination to the channel resource. Then create a workflow and reference the channel resource to it.
65
- *
66
- * ### Create a policy
67
- * ```typescript
68
- * import * as pulumi from "@pulumi/pulumi";
69
- * import * as newrelic from "@pulumi/newrelic";
34
+ * ## Policy-Based Workflow Example
70
35
  *
71
- * const collector_policy = new newrelic.AlertPolicy("collector-policy", {});
72
- * ```
36
+ * This scenario describes one of most common ways of using workflows by defining a set of policies the workflow handles
73
37
  *
74
- * ### Create a destination
75
38
  * ```typescript
76
39
  * import * as pulumi from "@pulumi/pulumi";
77
40
  * import * as newrelic from "@pulumi/newrelic";
78
41
  *
42
+ * // Create a policy to track
43
+ * const my_policy = new newrelic.AlertPolicy("my-policy", {});
44
+ * // Create a reusable notification destination
79
45
  * const webhook_destination = new newrelic.NotificationDestination("webhook-destination", {
80
- * accountId: 12345678,
81
- * authBasic: {
82
- * password: "password",
83
- * user: "username",
84
- * },
46
+ * type: "WEBHOOK",
85
47
  * properties: [{
86
48
  * key: "url",
87
- * value: "https://webhook.mywebhook.com",
49
+ * value: "https://example.com",
88
50
  * }],
89
- * type: "WEBHOOK",
51
+ * authBasic: {
52
+ * user: "username",
53
+ * password: "password",
54
+ * },
90
55
  * });
91
- * ```
92
- *
93
- * ### Create a channel
94
- * ```typescript
95
- * import * as pulumi from "@pulumi/pulumi";
96
- * import * as newrelic from "@pulumi/newrelic";
97
- *
56
+ * // Create a notification channel to use in the workflow
98
57
  * const webhook_channel = new newrelic.NotificationChannel("webhook-channel", {
99
- * accountId: 12345678,
100
58
  * type: "WEBHOOK",
101
- * destinationId: newrelic_notification_destination["webhook-destination"].id,
59
+ * destinationId: webhook_destination.id,
102
60
  * product: "IINT",
103
61
  * properties: [{
104
62
  * key: "payload",
105
- * value: "{name: {{ variable }} }",
63
+ * value: "{}",
106
64
  * label: "Payload Template",
107
65
  * }],
108
66
  * });
67
+ * // A workflow that matches issues that include incidents triggered by the policy
68
+ * const workflow_example = new newrelic.Workflow("workflow-example", {
69
+ * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
70
+ * issuesFilter: {
71
+ * name: "Filter-name",
72
+ * type: "FILTER",
73
+ * predicates: [{
74
+ * attribute: "labels.policyIds",
75
+ * operator: "EXACTLY_MATCHES",
76
+ * values: [my_policy.id],
77
+ * }],
78
+ * },
79
+ * destinations: [{
80
+ * channelId: webhook_channel.id,
81
+ * }],
82
+ * });
109
83
  * ```
110
84
  *
111
- * ### Create a workflow
85
+ * ### An example of a workflow with enrichments
86
+ *
112
87
  * ```typescript
113
88
  * import * as pulumi from "@pulumi/pulumi";
114
89
  * import * as newrelic from "@pulumi/newrelic";
115
90
  *
116
91
  * const workflow_example = new newrelic.Workflow("workflow-example", {
117
- * accountId: 12345678,
118
92
  * mutingRulesHandling: "NOTIFY_ALL_ISSUES",
93
+ * issuesFilter: {
94
+ * name: "Filter-name",
95
+ * type: "FILTER",
96
+ * predicates: [{
97
+ * attribute: "accumulations.tag.team",
98
+ * operator: "EXACTLY_MATCHES",
99
+ * values: ["my_team"],
100
+ * }],
101
+ * },
119
102
  * enrichments: {
120
103
  * nrqls: [{
121
- * name: "Log count",
104
+ * name: "Log Count",
122
105
  * configurations: [{
123
106
  * query: `SELECT count(*) FROM Log WHERE message like '%error%' since 10 minutes ago`,
124
107
  * }],
125
108
  * }],
126
109
  * },
127
- * issuesFilter: {
128
- * name: "Filter-name",
129
- * type: "FILTER",
130
- * predicates: [
131
- * {
132
- * attribute: "accumulations.policyName",
133
- * operator: "EXACTLY_MATCHES",
134
- * values: ["my_policy"],
135
- * },
136
- * {
137
- * attribute: "accumulations.sources",
138
- * operator: "EXACTLY_MATCHES",
139
- * values: ["newrelic"],
140
- * },
141
- * ],
142
- * },
143
110
  * destinations: [{
144
111
  * channelId: newrelic_notification_channel["webhook-channel"].id,
145
112
  * }],
@@ -158,8 +125,40 @@ const utilities = require("./utilities");
158
125
  * - `destinationConfiguration` changed to `destination`.
159
126
  * - `predicates` changed to `predicate`.
160
127
  * - Enrichment's `configurations` changed to `configuration`.
128
+ *
129
+ * ## Import
130
+ *
131
+ * Workflows can be imported using the `id`, e.g. bash
132
+ *
133
+ * ```sh
134
+ * $ pulumi import newrelic:index/workflow:Workflow foo <id>
135
+ * ```
136
+ *
137
+ * 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`.
161
138
  */
162
139
  class Workflow extends pulumi.CustomResource {
140
+ /**
141
+ * Get an existing Workflow resource's state with the given name, ID, and optional extra
142
+ * properties used to qualify the lookup.
143
+ *
144
+ * @param name The _unique_ name of the resulting resource.
145
+ * @param id The _unique_ provider ID of the resource to lookup.
146
+ * @param state Any extra arguments used during the lookup.
147
+ * @param opts Optional settings to control the behavior of the CustomResource.
148
+ */
149
+ static get(name, id, state, opts) {
150
+ return new Workflow(name, state, Object.assign(Object.assign({}, opts), { id: id }));
151
+ }
152
+ /**
153
+ * Returns true if the given object is an instance of Workflow. This is designed to work even
154
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
155
+ */
156
+ static isInstance(obj) {
157
+ if (obj === undefined || obj === null) {
158
+ return false;
159
+ }
160
+ return obj['__pulumiType'] === Workflow.__pulumiType;
161
+ }
163
162
  constructor(name, argsOrState, opts) {
164
163
  let resourceInputs = {};
165
164
  opts = opts || {};
@@ -203,28 +202,6 @@ class Workflow extends pulumi.CustomResource {
203
202
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
204
203
  super(Workflow.__pulumiType, name, resourceInputs, opts);
205
204
  }
206
- /**
207
- * Get an existing Workflow resource's state with the given name, ID, and optional extra
208
- * properties used to qualify the lookup.
209
- *
210
- * @param name The _unique_ name of the resulting resource.
211
- * @param id The _unique_ provider ID of the resource to lookup.
212
- * @param state Any extra arguments used during the lookup.
213
- * @param opts Optional settings to control the behavior of the CustomResource.
214
- */
215
- static get(name, id, state, opts) {
216
- return new Workflow(name, state, Object.assign(Object.assign({}, opts), { id: id }));
217
- }
218
- /**
219
- * Returns true if the given object is an instance of Workflow. This is designed to work even
220
- * when multiple copies of the Pulumi SDK have been loaded into the same process.
221
- */
222
- static isInstance(obj) {
223
- if (obj === undefined || obj === null) {
224
- return false;
225
- }
226
- return obj['__pulumiType'] === Workflow.__pulumiType;
227
- }
228
205
  }
229
206
  exports.Workflow = Workflow;
230
207
  /** @internal */