@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
package/scorecard.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
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 Scorecards](https://docs.newrelic.com/docs/service-architecture-intelligence/scorecards/getting-started/).
|
|
6
|
+
*
|
|
7
|
+
* Scorecards let you define and track engineering quality standards across your organisation by grouping NRQL-based rules that evaluate your entities on a recurring schedule.
|
|
8
|
+
*
|
|
9
|
+
* > **NOTE:** Rules are managed as separate `newrelic.ScorecardRule` resources and attached via the `ruleIds` attribute. **Each rule can only belong to one scorecard at a time.** Attempting to attach a rule that is already assigned to another scorecard will fail. Remove the rule from its current scorecard first.
|
|
10
|
+
*
|
|
11
|
+
* > **NOTE:** To assign a rule to a specific progress tier, set `progressLevel` on the `newrelic.ScorecardRule` to match one of the `id` values declared in this scorecard's `progressLevels` block (e.g. `progressLevel = "red"`). See the Progress Level Relationship example in the rule documentation for a full walkthrough.
|
|
12
|
+
*
|
|
13
|
+
* ## Example Usage
|
|
14
|
+
*
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
17
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
18
|
+
*
|
|
19
|
+
* const alertCoverage = new newrelic.ScorecardRule("alert_coverage", {
|
|
20
|
+
* name: "APM alert coverage",
|
|
21
|
+
* enabled: true,
|
|
22
|
+
* runInterval: 1440,
|
|
23
|
+
* nrqlEngine: {
|
|
24
|
+
* accounts: [accountId],
|
|
25
|
+
* 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",
|
|
26
|
+
* },
|
|
27
|
+
* });
|
|
28
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
29
|
+
* name: "Engineering Quality",
|
|
30
|
+
* description: "Tracks key observability standards across all APM services",
|
|
31
|
+
* tags: [{
|
|
32
|
+
* key: "team",
|
|
33
|
+
* values: ["platform"],
|
|
34
|
+
* }],
|
|
35
|
+
* progressLevels: [
|
|
36
|
+
* {
|
|
37
|
+
* id: "red",
|
|
38
|
+
* name: "Needs Work",
|
|
39
|
+
* description: "Score below 60%",
|
|
40
|
+
* hexColorCode: "#FF4444",
|
|
41
|
+
* },
|
|
42
|
+
* {
|
|
43
|
+
* id: "amber",
|
|
44
|
+
* name: "Improving",
|
|
45
|
+
* description: "Score 60–80%",
|
|
46
|
+
* hexColorCode: "#FFAA00",
|
|
47
|
+
* },
|
|
48
|
+
* {
|
|
49
|
+
* id: "green",
|
|
50
|
+
* name: "Healthy",
|
|
51
|
+
* description: "Score above 80%",
|
|
52
|
+
* hexColorCode: "#00CC44",
|
|
53
|
+
* },
|
|
54
|
+
* ],
|
|
55
|
+
* ruleIds: [alertCoverage.id],
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* See additional examples below.
|
|
60
|
+
*
|
|
61
|
+
* ## Additional Examples
|
|
62
|
+
*
|
|
63
|
+
* ### Scorecard with no custom progress levels
|
|
64
|
+
*
|
|
65
|
+
* When `progressLevels` is omitted, the organisation's default levels are applied automatically.
|
|
66
|
+
*
|
|
67
|
+
* ```typescript
|
|
68
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
69
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
70
|
+
*
|
|
71
|
+
* const minimal = new newrelic.Scorecard("minimal", {
|
|
72
|
+
* name: "Service Health Check",
|
|
73
|
+
* ruleIds: [alertCoverage.id],
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* ### Scorecard with multiple rules
|
|
78
|
+
*
|
|
79
|
+
* ```typescript
|
|
80
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
81
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
82
|
+
*
|
|
83
|
+
* const platformStandards = new newrelic.Scorecard("platform_standards", {
|
|
84
|
+
* name: "Platform Standards",
|
|
85
|
+
* tags: [{
|
|
86
|
+
* key: "team",
|
|
87
|
+
* values: ["platform"],
|
|
88
|
+
* }],
|
|
89
|
+
* ruleIds: [
|
|
90
|
+
* alertCoverage.id,
|
|
91
|
+
* latencyThreshold.id,
|
|
92
|
+
* errorRate.id,
|
|
93
|
+
* ],
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* ### Custom Bronze / Silver / Gold tiers
|
|
98
|
+
*
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
101
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
102
|
+
*
|
|
103
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
104
|
+
* name: "Engineering Standards",
|
|
105
|
+
* progressLevels: [
|
|
106
|
+
* {
|
|
107
|
+
* id: "bronze",
|
|
108
|
+
* name: "Bronze",
|
|
109
|
+
* description: "Baseline requirements met",
|
|
110
|
+
* hexColorCode: "#CD7F32",
|
|
111
|
+
* },
|
|
112
|
+
* {
|
|
113
|
+
* id: "silver",
|
|
114
|
+
* name: "Silver",
|
|
115
|
+
* description: "Strong operational posture",
|
|
116
|
+
* hexColorCode: "#C0C0C0",
|
|
117
|
+
* },
|
|
118
|
+
* {
|
|
119
|
+
* id: "gold",
|
|
120
|
+
* name: "Gold",
|
|
121
|
+
* description: "Exemplary reliability and observability",
|
|
122
|
+
* hexColorCode: "#FFD700",
|
|
123
|
+
* },
|
|
124
|
+
* ],
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* ## Import
|
|
129
|
+
*
|
|
130
|
+
* Scorecards can be imported using the entity GUID:
|
|
131
|
+
*
|
|
132
|
+
* ```sh
|
|
133
|
+
* $ pulumi import newrelic:index/scorecard:Scorecard example <guid>
|
|
134
|
+
* ```
|
|
135
|
+
*
|
|
136
|
+
* To find a scorecard's GUID, use `terraform state show` after applying, or query NerdGraph:
|
|
137
|
+
*
|
|
138
|
+
* > **NOTE:** Scorecards are NGEP entities and are not returned by the `newrelic.getEntity` data source. Use the NerdGraph query above or `terraform state show newrelic_scorecard.example` to retrieve the GUID.
|
|
139
|
+
*/
|
|
140
|
+
export declare class Scorecard extends pulumi.CustomResource {
|
|
141
|
+
/**
|
|
142
|
+
* Get an existing Scorecard resource's state with the given name, ID, and optional extra
|
|
143
|
+
* properties used to qualify the lookup.
|
|
144
|
+
*
|
|
145
|
+
* @param name The _unique_ name of the resulting resource.
|
|
146
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
147
|
+
* @param state Any extra arguments used during the lookup.
|
|
148
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
149
|
+
*/
|
|
150
|
+
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ScorecardState, opts?: pulumi.CustomResourceOptions): Scorecard;
|
|
151
|
+
/**
|
|
152
|
+
* Returns true if the given object is an instance of Scorecard. This is designed to work even
|
|
153
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
154
|
+
*/
|
|
155
|
+
static isInstance(obj: any): obj is Scorecard;
|
|
156
|
+
/**
|
|
157
|
+
* A description of the scorecard's purpose.
|
|
158
|
+
*/
|
|
159
|
+
readonly description: pulumi.Output<string | undefined>;
|
|
160
|
+
/**
|
|
161
|
+
* The name of the scorecard.
|
|
162
|
+
*/
|
|
163
|
+
readonly name: pulumi.Output<string>;
|
|
164
|
+
/**
|
|
165
|
+
* The organisation UUID, resolved automatically from the provider account.
|
|
166
|
+
*/
|
|
167
|
+
readonly organizationId: pulumi.Output<string>;
|
|
168
|
+
/**
|
|
169
|
+
* One or more blocks defining the scorecard's scoring tiers (e.g. Red / Amber / Green). Levels can be added, updated, or removed in-place without recreating the scorecard. If omitted, the organisation's default levels are applied and stored in state. See Nested `progressLevels` blocks below.
|
|
170
|
+
*/
|
|
171
|
+
readonly progressLevels: pulumi.Output<outputs.ScorecardProgressLevel[]>;
|
|
172
|
+
/**
|
|
173
|
+
* A set of `newrelic.ScorecardRule` entity GUIDs to attach to this scorecard. Removing a GUID detaches the rule without deleting it, making it available for another scorecard.
|
|
174
|
+
*/
|
|
175
|
+
readonly ruleIds: pulumi.Output<string[] | undefined>;
|
|
176
|
+
/**
|
|
177
|
+
* The GUID of the auto-created rules collection. Managed by the provider via `ruleIds`; do not modify directly.
|
|
178
|
+
*/
|
|
179
|
+
readonly rulesCollectionId: pulumi.Output<string>;
|
|
180
|
+
/**
|
|
181
|
+
* One or more `tags` blocks assigning key-value metadata to this scorecard. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
182
|
+
*/
|
|
183
|
+
readonly tags: pulumi.Output<outputs.ScorecardTag[] | undefined>;
|
|
184
|
+
/**
|
|
185
|
+
* Create a Scorecard resource with the given unique name, arguments, and options.
|
|
186
|
+
*
|
|
187
|
+
* @param name The _unique_ name of the resource.
|
|
188
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
189
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
190
|
+
*/
|
|
191
|
+
constructor(name: string, args?: ScorecardArgs, opts?: pulumi.CustomResourceOptions);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Input properties used for looking up and filtering Scorecard resources.
|
|
195
|
+
*/
|
|
196
|
+
export interface ScorecardState {
|
|
197
|
+
/**
|
|
198
|
+
* A description of the scorecard's purpose.
|
|
199
|
+
*/
|
|
200
|
+
description?: pulumi.Input<string | undefined>;
|
|
201
|
+
/**
|
|
202
|
+
* The name of the scorecard.
|
|
203
|
+
*/
|
|
204
|
+
name?: pulumi.Input<string | undefined>;
|
|
205
|
+
/**
|
|
206
|
+
* The organisation UUID, resolved automatically from the provider account.
|
|
207
|
+
*/
|
|
208
|
+
organizationId?: pulumi.Input<string | undefined>;
|
|
209
|
+
/**
|
|
210
|
+
* One or more blocks defining the scorecard's scoring tiers (e.g. Red / Amber / Green). Levels can be added, updated, or removed in-place without recreating the scorecard. If omitted, the organisation's default levels are applied and stored in state. See Nested `progressLevels` blocks below.
|
|
211
|
+
*/
|
|
212
|
+
progressLevels?: pulumi.Input<pulumi.Input<inputs.ScorecardProgressLevel>[] | undefined>;
|
|
213
|
+
/**
|
|
214
|
+
* A set of `newrelic.ScorecardRule` entity GUIDs to attach to this scorecard. Removing a GUID detaches the rule without deleting it, making it available for another scorecard.
|
|
215
|
+
*/
|
|
216
|
+
ruleIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
|
|
217
|
+
/**
|
|
218
|
+
* The GUID of the auto-created rules collection. Managed by the provider via `ruleIds`; do not modify directly.
|
|
219
|
+
*/
|
|
220
|
+
rulesCollectionId?: pulumi.Input<string | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* One or more `tags` blocks assigning key-value metadata to this scorecard. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
223
|
+
*/
|
|
224
|
+
tags?: pulumi.Input<pulumi.Input<inputs.ScorecardTag>[] | undefined>;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The set of arguments for constructing a Scorecard resource.
|
|
228
|
+
*/
|
|
229
|
+
export interface ScorecardArgs {
|
|
230
|
+
/**
|
|
231
|
+
* A description of the scorecard's purpose.
|
|
232
|
+
*/
|
|
233
|
+
description?: pulumi.Input<string | undefined>;
|
|
234
|
+
/**
|
|
235
|
+
* The name of the scorecard.
|
|
236
|
+
*/
|
|
237
|
+
name?: pulumi.Input<string | undefined>;
|
|
238
|
+
/**
|
|
239
|
+
* One or more blocks defining the scorecard's scoring tiers (e.g. Red / Amber / Green). Levels can be added, updated, or removed in-place without recreating the scorecard. If omitted, the organisation's default levels are applied and stored in state. See Nested `progressLevels` blocks below.
|
|
240
|
+
*/
|
|
241
|
+
progressLevels?: pulumi.Input<pulumi.Input<inputs.ScorecardProgressLevel>[] | undefined>;
|
|
242
|
+
/**
|
|
243
|
+
* A set of `newrelic.ScorecardRule` entity GUIDs to attach to this scorecard. Removing a GUID detaches the rule without deleting it, making it available for another scorecard.
|
|
244
|
+
*/
|
|
245
|
+
ruleIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
|
|
246
|
+
/**
|
|
247
|
+
* One or more `tags` blocks assigning key-value metadata to this scorecard. Tags prefixed with `nr.` are managed by New Relic and are preserved automatically. Each block supports:
|
|
248
|
+
*/
|
|
249
|
+
tags?: pulumi.Input<pulumi.Input<inputs.ScorecardTag>[] | undefined>;
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=scorecard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecard.d.ts","s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CAAC;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IACzF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAC3D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;CACxE"}
|
package/scorecard.js
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
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.Scorecard = 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 Scorecards](https://docs.newrelic.com/docs/service-architecture-intelligence/scorecards/getting-started/).
|
|
33
|
+
*
|
|
34
|
+
* Scorecards let you define and track engineering quality standards across your organisation by grouping NRQL-based rules that evaluate your entities on a recurring schedule.
|
|
35
|
+
*
|
|
36
|
+
* > **NOTE:** Rules are managed as separate `newrelic.ScorecardRule` resources and attached via the `ruleIds` attribute. **Each rule can only belong to one scorecard at a time.** Attempting to attach a rule that is already assigned to another scorecard will fail. Remove the rule from its current scorecard first.
|
|
37
|
+
*
|
|
38
|
+
* > **NOTE:** To assign a rule to a specific progress tier, set `progressLevel` on the `newrelic.ScorecardRule` to match one of the `id` values declared in this scorecard's `progressLevels` block (e.g. `progressLevel = "red"`). See the Progress Level Relationship example in the rule documentation for a full walkthrough.
|
|
39
|
+
*
|
|
40
|
+
* ## Example Usage
|
|
41
|
+
*
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
44
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
45
|
+
*
|
|
46
|
+
* const alertCoverage = new newrelic.ScorecardRule("alert_coverage", {
|
|
47
|
+
* name: "APM alert coverage",
|
|
48
|
+
* enabled: true,
|
|
49
|
+
* runInterval: 1440,
|
|
50
|
+
* nrqlEngine: {
|
|
51
|
+
* accounts: [accountId],
|
|
52
|
+
* 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",
|
|
53
|
+
* },
|
|
54
|
+
* });
|
|
55
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
56
|
+
* name: "Engineering Quality",
|
|
57
|
+
* description: "Tracks key observability standards across all APM services",
|
|
58
|
+
* tags: [{
|
|
59
|
+
* key: "team",
|
|
60
|
+
* values: ["platform"],
|
|
61
|
+
* }],
|
|
62
|
+
* progressLevels: [
|
|
63
|
+
* {
|
|
64
|
+
* id: "red",
|
|
65
|
+
* name: "Needs Work",
|
|
66
|
+
* description: "Score below 60%",
|
|
67
|
+
* hexColorCode: "#FF4444",
|
|
68
|
+
* },
|
|
69
|
+
* {
|
|
70
|
+
* id: "amber",
|
|
71
|
+
* name: "Improving",
|
|
72
|
+
* description: "Score 60–80%",
|
|
73
|
+
* hexColorCode: "#FFAA00",
|
|
74
|
+
* },
|
|
75
|
+
* {
|
|
76
|
+
* id: "green",
|
|
77
|
+
* name: "Healthy",
|
|
78
|
+
* description: "Score above 80%",
|
|
79
|
+
* hexColorCode: "#00CC44",
|
|
80
|
+
* },
|
|
81
|
+
* ],
|
|
82
|
+
* ruleIds: [alertCoverage.id],
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* See additional examples below.
|
|
87
|
+
*
|
|
88
|
+
* ## Additional Examples
|
|
89
|
+
*
|
|
90
|
+
* ### Scorecard with no custom progress levels
|
|
91
|
+
*
|
|
92
|
+
* When `progressLevels` is omitted, the organisation's default levels are applied automatically.
|
|
93
|
+
*
|
|
94
|
+
* ```typescript
|
|
95
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
96
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
97
|
+
*
|
|
98
|
+
* const minimal = new newrelic.Scorecard("minimal", {
|
|
99
|
+
* name: "Service Health Check",
|
|
100
|
+
* ruleIds: [alertCoverage.id],
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* ### Scorecard with multiple rules
|
|
105
|
+
*
|
|
106
|
+
* ```typescript
|
|
107
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
108
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
109
|
+
*
|
|
110
|
+
* const platformStandards = new newrelic.Scorecard("platform_standards", {
|
|
111
|
+
* name: "Platform Standards",
|
|
112
|
+
* tags: [{
|
|
113
|
+
* key: "team",
|
|
114
|
+
* values: ["platform"],
|
|
115
|
+
* }],
|
|
116
|
+
* ruleIds: [
|
|
117
|
+
* alertCoverage.id,
|
|
118
|
+
* latencyThreshold.id,
|
|
119
|
+
* errorRate.id,
|
|
120
|
+
* ],
|
|
121
|
+
* });
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* ### Custom Bronze / Silver / Gold tiers
|
|
125
|
+
*
|
|
126
|
+
* ```typescript
|
|
127
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
128
|
+
* import * as newrelic from "@pulumi/newrelic";
|
|
129
|
+
*
|
|
130
|
+
* const engineering = new newrelic.Scorecard("engineering", {
|
|
131
|
+
* name: "Engineering Standards",
|
|
132
|
+
* progressLevels: [
|
|
133
|
+
* {
|
|
134
|
+
* id: "bronze",
|
|
135
|
+
* name: "Bronze",
|
|
136
|
+
* description: "Baseline requirements met",
|
|
137
|
+
* hexColorCode: "#CD7F32",
|
|
138
|
+
* },
|
|
139
|
+
* {
|
|
140
|
+
* id: "silver",
|
|
141
|
+
* name: "Silver",
|
|
142
|
+
* description: "Strong operational posture",
|
|
143
|
+
* hexColorCode: "#C0C0C0",
|
|
144
|
+
* },
|
|
145
|
+
* {
|
|
146
|
+
* id: "gold",
|
|
147
|
+
* name: "Gold",
|
|
148
|
+
* description: "Exemplary reliability and observability",
|
|
149
|
+
* hexColorCode: "#FFD700",
|
|
150
|
+
* },
|
|
151
|
+
* ],
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* ## Import
|
|
156
|
+
*
|
|
157
|
+
* Scorecards can be imported using the entity GUID:
|
|
158
|
+
*
|
|
159
|
+
* ```sh
|
|
160
|
+
* $ pulumi import newrelic:index/scorecard:Scorecard example <guid>
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* To find a scorecard's GUID, use `terraform state show` after applying, or query NerdGraph:
|
|
164
|
+
*
|
|
165
|
+
* > **NOTE:** Scorecards are NGEP entities and are not returned by the `newrelic.getEntity` data source. Use the NerdGraph query above or `terraform state show newrelic_scorecard.example` to retrieve the GUID.
|
|
166
|
+
*/
|
|
167
|
+
class Scorecard extends pulumi.CustomResource {
|
|
168
|
+
/**
|
|
169
|
+
* Get an existing Scorecard resource's state with the given name, ID, and optional extra
|
|
170
|
+
* properties used to qualify the lookup.
|
|
171
|
+
*
|
|
172
|
+
* @param name The _unique_ name of the resulting resource.
|
|
173
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
174
|
+
* @param state Any extra arguments used during the lookup.
|
|
175
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
176
|
+
*/
|
|
177
|
+
static get(name, id, state, opts) {
|
|
178
|
+
return new Scorecard(name, state, { ...opts, id: id });
|
|
179
|
+
}
|
|
180
|
+
/** @internal */
|
|
181
|
+
static __pulumiType = 'newrelic:index/scorecard:Scorecard';
|
|
182
|
+
/**
|
|
183
|
+
* Returns true if the given object is an instance of Scorecard. This is designed to work even
|
|
184
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
185
|
+
*/
|
|
186
|
+
static isInstance(obj) {
|
|
187
|
+
if (obj === undefined || obj === null) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
return obj['__pulumiType'] === Scorecard.__pulumiType;
|
|
191
|
+
}
|
|
192
|
+
constructor(name, argsOrState, opts) {
|
|
193
|
+
let resourceInputs = {};
|
|
194
|
+
opts = opts || {};
|
|
195
|
+
if (opts.id) {
|
|
196
|
+
const state = argsOrState;
|
|
197
|
+
resourceInputs["description"] = state?.description;
|
|
198
|
+
resourceInputs["name"] = state?.name;
|
|
199
|
+
resourceInputs["organizationId"] = state?.organizationId;
|
|
200
|
+
resourceInputs["progressLevels"] = state?.progressLevels;
|
|
201
|
+
resourceInputs["ruleIds"] = state?.ruleIds;
|
|
202
|
+
resourceInputs["rulesCollectionId"] = state?.rulesCollectionId;
|
|
203
|
+
resourceInputs["tags"] = state?.tags;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const args = argsOrState;
|
|
207
|
+
resourceInputs["description"] = args?.description;
|
|
208
|
+
resourceInputs["name"] = args?.name;
|
|
209
|
+
resourceInputs["progressLevels"] = args?.progressLevels;
|
|
210
|
+
resourceInputs["ruleIds"] = args?.ruleIds;
|
|
211
|
+
resourceInputs["tags"] = args?.tags;
|
|
212
|
+
resourceInputs["organizationId"] = undefined /*out*/;
|
|
213
|
+
resourceInputs["rulesCollectionId"] = undefined /*out*/;
|
|
214
|
+
}
|
|
215
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
216
|
+
super(Scorecard.__pulumiType, name, resourceInputs, opts);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
exports.Scorecard = Scorecard;
|
|
220
|
+
//# sourceMappingURL=scorecard.js.map
|
package/scorecard.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scorecard.js","sourceRoot":"","sources":["../scorecard.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AAGzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuIG;AACH,MAAa,SAAU,SAAQ,MAAM,CAAC,cAAc;IAChD;;;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