@pulumi/newrelic 5.79.5 → 5.80.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.
- package/getTeamsHierarchyLevels.d.ts +66 -0
- package/getTeamsHierarchyLevels.d.ts.map +1 -0
- package/getTeamsHierarchyLevels.js +89 -0
- package/getTeamsHierarchyLevels.js.map +1 -0
- package/index.d.ts +15 -0
- package/index.d.ts.map +1 -1
- package/index.js +24 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/scorecard.d.ts +251 -0
- package/scorecard.d.ts.map +1 -0
- package/scorecard.js +220 -0
- package/scorecard.js.map +1 -0
- package/scorecardRule.d.ts +292 -0
- package/scorecardRule.d.ts.map +1 -0
- package/scorecardRule.js +243 -0
- package/scorecardRule.js.map +1 -0
- package/team.d.ts +458 -0
- package/team.d.ts.map +1 -0
- package/team.js +356 -0
- package/team.js.map +1 -0
- package/teamsOrganizationSettings.d.ts +207 -0
- package/teamsOrganizationSettings.d.ts.map +1 -0
- package/teamsOrganizationSettings.js +188 -0
- package/teamsOrganizationSettings.js.map +1 -0
- package/types/input.d.ts +102 -0
- package/types/input.d.ts.map +1 -1
- package/types/output.d.ts +112 -0
- package/types/output.d.ts.map +1 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
import * as inputs from "./types/input";
|
|
3
|
+
import * as outputs from "./types/output";
|
|
4
|
+
/**
|
|
5
|
+
* Use this resource to create, update, and delete [New Relic Scorecard Rules](https://docs.newrelic.com/docs/service-architecture-intelligence/scorecards/getting-started/).
|
|
6
|
+
*
|
|
7
|
+
* A Scorecard Rule is a NRQL-based check that evaluates a binary score (0 = fail, 1 = pass) for each entity in your account on a recurring schedule. Rules are **independent entities** — they exist outside any scorecard and are attached to a `newrelic.Scorecard` via that scorecard's `ruleIds` attribute.
|
|
8
|
+
*
|
|
9
|
+
* > **CONSTRAINT: One rule per scorecard.** Each rule can only belong to **one scorecard at a time**. The New Relic API enforces this at the collection level. If you attempt to attach a rule that is already assigned to another scorecard, the apply will fail. To reassign a rule: remove its GUID from the current scorecard's `ruleIds`, apply that change, then add it to the new scorecard.
|
|
10
|
+
*
|
|
11
|
+
* ## Example Usage
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
15
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
16
|
+
*
|
|
17
|
+
* const alertCoverage = new newrelic.ScorecardRule("alert_coverage", {
|
|
18
|
+
* name: "APM alert coverage",
|
|
19
|
+
* description: "All APM services must have alerts configured",
|
|
20
|
+
* enabled: true,
|
|
21
|
+
* runInterval: 1440,
|
|
22
|
+
* nrqlEngine: {
|
|
23
|
+
* accounts: [accountId],
|
|
24
|
+
* query: "SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
25
|
+
* },
|
|
26
|
+
* tags: [{
|
|
27
|
+
* key: "team",
|
|
28
|
+
* values: ["platform"],
|
|
29
|
+
* }],
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* See additional examples below.
|
|
34
|
+
*
|
|
35
|
+
* ## Progress Level Relationship
|
|
36
|
+
*
|
|
37
|
+
* The `progressLevel` field links a rule to a tier in the parent scorecard's `progressLevels` block. The value must exactly match one of those tier IDs.
|
|
38
|
+
*
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
41
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
42
|
+
*
|
|
43
|
+
* const alertConfigured = new newrelic.ScorecardRule("alert_configured", {
|
|
44
|
+
* name: "Alerts configured",
|
|
45
|
+
* enabled: true,
|
|
46
|
+
* runInterval: 1440,
|
|
47
|
+
* progressLevel: "foundation",
|
|
48
|
+
* nrqlEngine: {
|
|
49
|
+
* accounts: [accountId],
|
|
50
|
+
* query: "SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
51
|
+
* },
|
|
52
|
+
* });
|
|
53
|
+
* const lowLatency = new newrelic.ScorecardRule("low_latency", {
|
|
54
|
+
* name: "P95 latency below 500ms",
|
|
55
|
+
* enabled: true,
|
|
56
|
+
* runInterval: 60,
|
|
57
|
+
* progressLevel: "excellence",
|
|
58
|
+
* nrqlEngine: {
|
|
59
|
+
* accounts: [accountId],
|
|
60
|
+
* query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
61
|
+
* },
|
|
62
|
+
* });
|
|
63
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
64
|
+
* name: "Engineering Standards",
|
|
65
|
+
* progressLevels: [
|
|
66
|
+
* {
|
|
67
|
+
* id: "foundation",
|
|
68
|
+
* name: "Foundation",
|
|
69
|
+
* hexColorCode: "#CC4400",
|
|
70
|
+
* },
|
|
71
|
+
* {
|
|
72
|
+
* id: "excellence",
|
|
73
|
+
* name: "Excellence",
|
|
74
|
+
* hexColorCode: "#00CC44",
|
|
75
|
+
* },
|
|
76
|
+
* ],
|
|
77
|
+
* ruleIds: [
|
|
78
|
+
* alertConfigured.id,
|
|
79
|
+
* lowLatency.id,
|
|
80
|
+
* ],
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* Rules are visually grouped under their tier label in the scorecard detail view. Tiers are not hard gates — an entity can pass an `"excellence"` rule without first passing all `"foundation"` rules. Because each rule belongs to only one scorecard, the tier assignment is always unambiguous.
|
|
85
|
+
*
|
|
86
|
+
* ## Additional Examples
|
|
87
|
+
*
|
|
88
|
+
* ### Disabled rule (paused without deletion)
|
|
89
|
+
*
|
|
90
|
+
* ```typescript
|
|
91
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
92
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
93
|
+
*
|
|
94
|
+
* const latencyThreshold = new newrelic.ScorecardRule("latency_threshold", {
|
|
95
|
+
* name: "P95 latency below 500ms",
|
|
96
|
+
* enabled: false,
|
|
97
|
+
* runInterval: 720,
|
|
98
|
+
* nrqlEngine: {
|
|
99
|
+
* accounts: [accountId],
|
|
100
|
+
* query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
101
|
+
* },
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* ### Cross-account rule using `joinAccounts`
|
|
106
|
+
*
|
|
107
|
+
* ```typescript
|
|
108
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
109
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
110
|
+
*
|
|
111
|
+
* const crossAccountErrors = new newrelic.ScorecardRule("cross_account_errors", {
|
|
112
|
+
* name: "Cross-account error rate below 1%",
|
|
113
|
+
* enabled: true,
|
|
114
|
+
* runInterval: 60,
|
|
115
|
+
* nrqlEngine: {
|
|
116
|
+
* accounts: [primaryAccountId],
|
|
117
|
+
* joinAccounts: [secondaryAccountId],
|
|
118
|
+
* query: "SELECT if(percentage(count(*), WHERE error IS true) < 1.0, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
119
|
+
* },
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* ### Rule with impact weighting
|
|
124
|
+
*
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
127
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
128
|
+
*
|
|
129
|
+
* const criticalAlertCheck = new newrelic.ScorecardRule("critical_alert_check", {
|
|
130
|
+
* name: "Critical alerts configured",
|
|
131
|
+
* enabled: true,
|
|
132
|
+
* runInterval: 1440,
|
|
133
|
+
* impactWeight: 3,
|
|
134
|
+
* nrqlEngine: {
|
|
135
|
+
* accounts: [accountId],
|
|
136
|
+
* query: "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
137
|
+
* },
|
|
138
|
+
* });
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* ## Import
|
|
142
|
+
*
|
|
143
|
+
* Scorecard rules can be imported using the entity GUID:
|
|
144
|
+
*
|
|
145
|
+
* ```sh
|
|
146
|
+
* $ pulumi import newrelic:index/scorecardRule:ScorecardRule example <guid>
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* To find a rule's GUID, use `terraform state show` after applying, or query NerdGraph:
|
|
150
|
+
*
|
|
151
|
+
* > **NOTE:** Scorecard rules are NGEP entities and are not returned by the `newrelic.getEntity` data source. Use the NerdGraph query above or `terraform state show newrelic_scorecard_rule.example` to retrieve the GUID.
|
|
152
|
+
*/
|
|
153
|
+
export declare class ScorecardRule extends pulumi.CustomResource {
|
|
154
|
+
/**
|
|
155
|
+
* Get an existing ScorecardRule resource's state with the given name, ID, and optional extra
|
|
156
|
+
* properties used to qualify the lookup.
|
|
157
|
+
*
|
|
158
|
+
* @param name The _unique_ name of the resulting resource.
|
|
159
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
160
|
+
* @param state Any extra arguments used during the lookup.
|
|
161
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
162
|
+
*/
|
|
163
|
+
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ScorecardRuleState, opts?: pulumi.CustomResourceOptions): ScorecardRule;
|
|
164
|
+
/**
|
|
165
|
+
* Returns true if the given object is an instance of ScorecardRule. This is designed to work even
|
|
166
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
167
|
+
*/
|
|
168
|
+
static isInstance(obj: any): obj is ScorecardRule;
|
|
169
|
+
/**
|
|
170
|
+
* A description of what this rule measures.
|
|
171
|
+
*/
|
|
172
|
+
readonly description: pulumi.Output<string | undefined>;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the rule is active. Set to `false` to pause evaluation without deleting the rule.
|
|
175
|
+
*/
|
|
176
|
+
readonly enabled: pulumi.Output<boolean>;
|
|
177
|
+
/**
|
|
178
|
+
* A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
|
|
179
|
+
*/
|
|
180
|
+
readonly impactWeight: pulumi.Output<number | undefined>;
|
|
181
|
+
/**
|
|
182
|
+
* The name of the rule.
|
|
183
|
+
*/
|
|
184
|
+
readonly name: pulumi.Output<string>;
|
|
185
|
+
/**
|
|
186
|
+
* A block defining the NRQL query that produces the score. See Nested `nrqlEngine` block below.
|
|
187
|
+
*/
|
|
188
|
+
readonly nrqlEngine: pulumi.Output<outputs.ScorecardRuleNrqlEngine>;
|
|
189
|
+
/**
|
|
190
|
+
* The organisation UUID, resolved automatically from the provider account.
|
|
191
|
+
*/
|
|
192
|
+
readonly organizationId: pulumi.Output<string>;
|
|
193
|
+
/**
|
|
194
|
+
* The `id` of a progress tier defined in the parent `newrelic.Scorecard`. Assigns the rule to a visual grouping in the UI. The value must exactly match a `progress_levels.id` on the scorecard (e.g. `"red"`, `"amber"`, `"green"`). Omit to leave the rule ungrouped. See Progress Level Relationship below.
|
|
195
|
+
*/
|
|
196
|
+
readonly progressLevel: pulumi.Output<string | undefined>;
|
|
197
|
+
/**
|
|
198
|
+
* How frequently the NRQL query runs, in minutes. Accepted values: `60` (hourly), `360` (6 hours), `720` (12 hours), `1440` (daily). Omit to use the API default.
|
|
199
|
+
*/
|
|
200
|
+
readonly runInterval: pulumi.Output<number | undefined>;
|
|
201
|
+
/**
|
|
202
|
+
* One or more `tags` blocks assigning key-value metadata to this rule. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
203
|
+
*/
|
|
204
|
+
readonly tags: pulumi.Output<outputs.ScorecardRuleTag[] | undefined>;
|
|
205
|
+
/**
|
|
206
|
+
* Create a ScorecardRule resource with the given unique name, arguments, and options.
|
|
207
|
+
*
|
|
208
|
+
* @param name The _unique_ name of the resource.
|
|
209
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
210
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
211
|
+
*/
|
|
212
|
+
constructor(name: string, args: ScorecardRuleArgs, opts?: pulumi.CustomResourceOptions);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Input properties used for looking up and filtering ScorecardRule resources.
|
|
216
|
+
*/
|
|
217
|
+
export interface ScorecardRuleState {
|
|
218
|
+
/**
|
|
219
|
+
* A description of what this rule measures.
|
|
220
|
+
*/
|
|
221
|
+
description?: pulumi.Input<string | undefined>;
|
|
222
|
+
/**
|
|
223
|
+
* Whether the rule is active. Set to `false` to pause evaluation without deleting the rule.
|
|
224
|
+
*/
|
|
225
|
+
enabled?: pulumi.Input<boolean | undefined>;
|
|
226
|
+
/**
|
|
227
|
+
* A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
|
|
228
|
+
*/
|
|
229
|
+
impactWeight?: pulumi.Input<number | undefined>;
|
|
230
|
+
/**
|
|
231
|
+
* The name of the rule.
|
|
232
|
+
*/
|
|
233
|
+
name?: pulumi.Input<string | undefined>;
|
|
234
|
+
/**
|
|
235
|
+
* A block defining the NRQL query that produces the score. See Nested `nrqlEngine` block below.
|
|
236
|
+
*/
|
|
237
|
+
nrqlEngine?: pulumi.Input<inputs.ScorecardRuleNrqlEngine | undefined>;
|
|
238
|
+
/**
|
|
239
|
+
* The organisation UUID, resolved automatically from the provider account.
|
|
240
|
+
*/
|
|
241
|
+
organizationId?: pulumi.Input<string | undefined>;
|
|
242
|
+
/**
|
|
243
|
+
* The `id` of a progress tier defined in the parent `newrelic.Scorecard`. Assigns the rule to a visual grouping in the UI. The value must exactly match a `progress_levels.id` on the scorecard (e.g. `"red"`, `"amber"`, `"green"`). Omit to leave the rule ungrouped. See Progress Level Relationship below.
|
|
244
|
+
*/
|
|
245
|
+
progressLevel?: pulumi.Input<string | undefined>;
|
|
246
|
+
/**
|
|
247
|
+
* How frequently the NRQL query runs, in minutes. Accepted values: `60` (hourly), `360` (6 hours), `720` (12 hours), `1440` (daily). Omit to use the API default.
|
|
248
|
+
*/
|
|
249
|
+
runInterval?: pulumi.Input<number | undefined>;
|
|
250
|
+
/**
|
|
251
|
+
* One or more `tags` blocks assigning key-value metadata to this rule. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
252
|
+
*/
|
|
253
|
+
tags?: pulumi.Input<pulumi.Input<inputs.ScorecardRuleTag>[] | undefined>;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* The set of arguments for constructing a ScorecardRule resource.
|
|
257
|
+
*/
|
|
258
|
+
export interface ScorecardRuleArgs {
|
|
259
|
+
/**
|
|
260
|
+
* A description of what this rule measures.
|
|
261
|
+
*/
|
|
262
|
+
description?: pulumi.Input<string | undefined>;
|
|
263
|
+
/**
|
|
264
|
+
* Whether the rule is active. Set to `false` to pause evaluation without deleting the rule.
|
|
265
|
+
*/
|
|
266
|
+
enabled: pulumi.Input<boolean>;
|
|
267
|
+
/**
|
|
268
|
+
* A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
|
|
269
|
+
*/
|
|
270
|
+
impactWeight?: pulumi.Input<number | undefined>;
|
|
271
|
+
/**
|
|
272
|
+
* The name of the rule.
|
|
273
|
+
*/
|
|
274
|
+
name?: pulumi.Input<string | undefined>;
|
|
275
|
+
/**
|
|
276
|
+
* A block defining the NRQL query that produces the score. See Nested `nrqlEngine` block below.
|
|
277
|
+
*/
|
|
278
|
+
nrqlEngine: pulumi.Input<inputs.ScorecardRuleNrqlEngine>;
|
|
279
|
+
/**
|
|
280
|
+
* The `id` of a progress tier defined in the parent `newrelic.Scorecard`. Assigns the rule to a visual grouping in the UI. The value must exactly match a `progress_levels.id` on the scorecard (e.g. `"red"`, `"amber"`, `"green"`). Omit to leave the rule ungrouped. See Progress Level Relationship below.
|
|
281
|
+
*/
|
|
282
|
+
progressLevel?: pulumi.Input<string | undefined>;
|
|
283
|
+
/**
|
|
284
|
+
* How frequently the NRQL query runs, in minutes. Accepted values: `60` (hourly), `360` (6 hours), `720` (12 hours), `1440` (daily). Omit to use the API default.
|
|
285
|
+
*/
|
|
286
|
+
runInterval?: pulumi.Input<number | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* One or more `tags` blocks assigning key-value metadata to this rule. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
289
|
+
*/
|
|
290
|
+
tags?: pulumi.Input<pulumi.Input<inputs.ScorecardRuleTag>[] | undefined>;
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=scorecardRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecardRule.d.ts","sourceRoot":"","sources":["../scorecardRule.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoJG;AACH,qBAAa,aAAc,SAAQ,MAAM,CAAC,cAAc;IACpD;;;;;;;;OAQG;WACW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAA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aAAa,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;CAC5E"}
|
package/scorecardRule.js
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.ScorecardRule = void 0;
|
|
29
|
+
const pulumi = __importStar(require("@pulumi/pulumi"));
|
|
30
|
+
const utilities = __importStar(require("./utilities"));
|
|
31
|
+
/**
|
|
32
|
+
* Use this resource to create, update, and delete [New Relic Scorecard Rules](https://docs.newrelic.com/docs/service-architecture-intelligence/scorecards/getting-started/).
|
|
33
|
+
*
|
|
34
|
+
* A Scorecard Rule is a NRQL-based check that evaluates a binary score (0 = fail, 1 = pass) for each entity in your account on a recurring schedule. Rules are **independent entities** — they exist outside any scorecard and are attached to a `newrelic.Scorecard` via that scorecard's `ruleIds` attribute.
|
|
35
|
+
*
|
|
36
|
+
* > **CONSTRAINT: One rule per scorecard.** Each rule can only belong to **one scorecard at a time**. The New Relic API enforces this at the collection level. If you attempt to attach a rule that is already assigned to another scorecard, the apply will fail. To reassign a rule: remove its GUID from the current scorecard's `ruleIds`, apply that change, then add it to the new scorecard.
|
|
37
|
+
*
|
|
38
|
+
* ## Example Usage
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
42
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
43
|
+
*
|
|
44
|
+
* const alertCoverage = new newrelic.ScorecardRule("alert_coverage", {
|
|
45
|
+
* name: "APM alert coverage",
|
|
46
|
+
* description: "All APM services must have alerts configured",
|
|
47
|
+
* enabled: true,
|
|
48
|
+
* runInterval: 1440,
|
|
49
|
+
* nrqlEngine: {
|
|
50
|
+
* accounts: [accountId],
|
|
51
|
+
* query: "SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
52
|
+
* },
|
|
53
|
+
* tags: [{
|
|
54
|
+
* key: "team",
|
|
55
|
+
* values: ["platform"],
|
|
56
|
+
* }],
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* See additional examples below.
|
|
61
|
+
*
|
|
62
|
+
* ## Progress Level Relationship
|
|
63
|
+
*
|
|
64
|
+
* The `progressLevel` field links a rule to a tier in the parent scorecard's `progressLevels` block. The value must exactly match one of those tier IDs.
|
|
65
|
+
*
|
|
66
|
+
* ```typescript
|
|
67
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
68
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
69
|
+
*
|
|
70
|
+
* const alertConfigured = new newrelic.ScorecardRule("alert_configured", {
|
|
71
|
+
* name: "Alerts configured",
|
|
72
|
+
* enabled: true,
|
|
73
|
+
* runInterval: 1440,
|
|
74
|
+
* progressLevel: "foundation",
|
|
75
|
+
* nrqlEngine: {
|
|
76
|
+
* accounts: [accountId],
|
|
77
|
+
* query: "SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
78
|
+
* },
|
|
79
|
+
* });
|
|
80
|
+
* const lowLatency = new newrelic.ScorecardRule("low_latency", {
|
|
81
|
+
* name: "P95 latency below 500ms",
|
|
82
|
+
* enabled: true,
|
|
83
|
+
* runInterval: 60,
|
|
84
|
+
* progressLevel: "excellence",
|
|
85
|
+
* nrqlEngine: {
|
|
86
|
+
* accounts: [accountId],
|
|
87
|
+
* query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
88
|
+
* },
|
|
89
|
+
* });
|
|
90
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
91
|
+
* name: "Engineering Standards",
|
|
92
|
+
* progressLevels: [
|
|
93
|
+
* {
|
|
94
|
+
* id: "foundation",
|
|
95
|
+
* name: "Foundation",
|
|
96
|
+
* hexColorCode: "#CC4400",
|
|
97
|
+
* },
|
|
98
|
+
* {
|
|
99
|
+
* id: "excellence",
|
|
100
|
+
* name: "Excellence",
|
|
101
|
+
* hexColorCode: "#00CC44",
|
|
102
|
+
* },
|
|
103
|
+
* ],
|
|
104
|
+
* ruleIds: [
|
|
105
|
+
* alertConfigured.id,
|
|
106
|
+
* lowLatency.id,
|
|
107
|
+
* ],
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* Rules are visually grouped under their tier label in the scorecard detail view. Tiers are not hard gates — an entity can pass an `"excellence"` rule without first passing all `"foundation"` rules. Because each rule belongs to only one scorecard, the tier assignment is always unambiguous.
|
|
112
|
+
*
|
|
113
|
+
* ## Additional Examples
|
|
114
|
+
*
|
|
115
|
+
* ### Disabled rule (paused without deletion)
|
|
116
|
+
*
|
|
117
|
+
* ```typescript
|
|
118
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
119
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
120
|
+
*
|
|
121
|
+
* const latencyThreshold = new newrelic.ScorecardRule("latency_threshold", {
|
|
122
|
+
* name: "P95 latency below 500ms",
|
|
123
|
+
* enabled: false,
|
|
124
|
+
* runInterval: 720,
|
|
125
|
+
* nrqlEngine: {
|
|
126
|
+
* accounts: [accountId],
|
|
127
|
+
* query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
128
|
+
* },
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* ### Cross-account rule using `joinAccounts`
|
|
133
|
+
*
|
|
134
|
+
* ```typescript
|
|
135
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
136
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
137
|
+
*
|
|
138
|
+
* const crossAccountErrors = new newrelic.ScorecardRule("cross_account_errors", {
|
|
139
|
+
* name: "Cross-account error rate below 1%",
|
|
140
|
+
* enabled: true,
|
|
141
|
+
* runInterval: 60,
|
|
142
|
+
* nrqlEngine: {
|
|
143
|
+
* accounts: [primaryAccountId],
|
|
144
|
+
* joinAccounts: [secondaryAccountId],
|
|
145
|
+
* query: "SELECT if(percentage(count(*), WHERE error IS true) < 1.0, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
|
|
146
|
+
* },
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* ### Rule with impact weighting
|
|
151
|
+
*
|
|
152
|
+
* ```typescript
|
|
153
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
154
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
155
|
+
*
|
|
156
|
+
* const criticalAlertCheck = new newrelic.ScorecardRule("critical_alert_check", {
|
|
157
|
+
* name: "Critical alerts configured",
|
|
158
|
+
* enabled: true,
|
|
159
|
+
* runInterval: 1440,
|
|
160
|
+
* impactWeight: 3,
|
|
161
|
+
* nrqlEngine: {
|
|
162
|
+
* accounts: [accountId],
|
|
163
|
+
* query: "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
|
|
164
|
+
* },
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* ## Import
|
|
169
|
+
*
|
|
170
|
+
* Scorecard rules can be imported using the entity GUID:
|
|
171
|
+
*
|
|
172
|
+
* ```sh
|
|
173
|
+
* $ pulumi import newrelic:index/scorecardRule:ScorecardRule example <guid>
|
|
174
|
+
* ```
|
|
175
|
+
*
|
|
176
|
+
* To find a rule's GUID, use `terraform state show` after applying, or query NerdGraph:
|
|
177
|
+
*
|
|
178
|
+
* > **NOTE:** Scorecard rules are NGEP entities and are not returned by the `newrelic.getEntity` data source. Use the NerdGraph query above or `terraform state show newrelic_scorecard_rule.example` to retrieve the GUID.
|
|
179
|
+
*/
|
|
180
|
+
class ScorecardRule extends pulumi.CustomResource {
|
|
181
|
+
/**
|
|
182
|
+
* Get an existing ScorecardRule resource's state with the given name, ID, and optional extra
|
|
183
|
+
* properties used to qualify the lookup.
|
|
184
|
+
*
|
|
185
|
+
* @param name The _unique_ name of the resulting resource.
|
|
186
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
187
|
+
* @param state Any extra arguments used during the lookup.
|
|
188
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
189
|
+
*/
|
|
190
|
+
static get(name, id, state, opts) {
|
|
191
|
+
return new ScorecardRule(name, state, { ...opts, id: id });
|
|
192
|
+
}
|
|
193
|
+
/** @internal */
|
|
194
|
+
static __pulumiType = 'newrelic:index/scorecardRule:ScorecardRule';
|
|
195
|
+
/**
|
|
196
|
+
* Returns true if the given object is an instance of ScorecardRule. This is designed to work even
|
|
197
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
198
|
+
*/
|
|
199
|
+
static isInstance(obj) {
|
|
200
|
+
if (obj === undefined || obj === null) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
return obj['__pulumiType'] === ScorecardRule.__pulumiType;
|
|
204
|
+
}
|
|
205
|
+
constructor(name, argsOrState, opts) {
|
|
206
|
+
let resourceInputs = {};
|
|
207
|
+
opts = opts || {};
|
|
208
|
+
if (opts.id) {
|
|
209
|
+
const state = argsOrState;
|
|
210
|
+
resourceInputs["description"] = state?.description;
|
|
211
|
+
resourceInputs["enabled"] = state?.enabled;
|
|
212
|
+
resourceInputs["impactWeight"] = state?.impactWeight;
|
|
213
|
+
resourceInputs["name"] = state?.name;
|
|
214
|
+
resourceInputs["nrqlEngine"] = state?.nrqlEngine;
|
|
215
|
+
resourceInputs["organizationId"] = state?.organizationId;
|
|
216
|
+
resourceInputs["progressLevel"] = state?.progressLevel;
|
|
217
|
+
resourceInputs["runInterval"] = state?.runInterval;
|
|
218
|
+
resourceInputs["tags"] = state?.tags;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
const args = argsOrState;
|
|
222
|
+
if (args?.enabled === undefined && !opts.urn) {
|
|
223
|
+
throw new Error("Missing required property 'enabled'");
|
|
224
|
+
}
|
|
225
|
+
if (args?.nrqlEngine === undefined && !opts.urn) {
|
|
226
|
+
throw new Error("Missing required property 'nrqlEngine'");
|
|
227
|
+
}
|
|
228
|
+
resourceInputs["description"] = args?.description;
|
|
229
|
+
resourceInputs["enabled"] = args?.enabled;
|
|
230
|
+
resourceInputs["impactWeight"] = args?.impactWeight;
|
|
231
|
+
resourceInputs["name"] = args?.name;
|
|
232
|
+
resourceInputs["nrqlEngine"] = args?.nrqlEngine;
|
|
233
|
+
resourceInputs["progressLevel"] = args?.progressLevel;
|
|
234
|
+
resourceInputs["runInterval"] = args?.runInterval;
|
|
235
|
+
resourceInputs["tags"] = args?.tags;
|
|
236
|
+
resourceInputs["organizationId"] = undefined /*out*/;
|
|
237
|
+
}
|
|
238
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
239
|
+
super(ScorecardRule.__pulumiType, name, resourceInputs, opts);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.ScorecardRule = ScorecardRule;
|
|
243
|
+
//# sourceMappingURL=scorecardRule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecardRule.js","sourceRoot":"","sources":["../scorecardRule.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AAGzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoJG;AACH,MAAa,aAAc,SAAQ,MAAM,CAAC,cAAc;IACpD;;;;;;;;OAQG;I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