import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create, update, and delete [New Relic Scorecards](https://docs.newrelic.com/docs/service-architecture-intelligence/scorecards/getting-started/). * * 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. * * > **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. * * > **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. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const alertCoverage = new newrelic.ScorecardRule("alert_coverage", { * name: "APM alert coverage", * enabled: true, * runInterval: 1440, * nrqlEngine: { * accounts: [accountId], * 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", * }, * }); * const engineering = new newrelic.Scorecard("engineering", { * name: "Engineering Quality", * description: "Tracks key observability standards across all APM services", * tags: [{ * key: "team", * values: ["platform"], * }], * progressLevels: [ * { * id: "red", * name: "Needs Work", * description: "Score below 60%", * hexColorCode: "#FF4444", * }, * { * id: "amber", * name: "Improving", * description: "Score 60–80%", * hexColorCode: "#FFAA00", * }, * { * id: "green", * name: "Healthy", * description: "Score above 80%", * hexColorCode: "#00CC44", * }, * ], * ruleIds: [alertCoverage.id], * }); * ``` * * See additional examples below. * * ## Additional Examples * * ### Scorecard with no custom progress levels * * When `progressLevels` is omitted, the organisation's default levels are applied automatically. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const minimal = new newrelic.Scorecard("minimal", { * name: "Service Health Check", * ruleIds: [alertCoverage.id], * }); * ``` * * ### Scorecard with multiple rules * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const platformStandards = new newrelic.Scorecard("platform_standards", { * name: "Platform Standards", * tags: [{ * key: "team", * values: ["platform"], * }], * ruleIds: [ * alertCoverage.id, * latencyThreshold.id, * errorRate.id, * ], * }); * ``` * * ### Custom Bronze / Silver / Gold tiers * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const engineering = new newrelic.Scorecard("engineering", { * name: "Engineering Standards", * progressLevels: [ * { * id: "bronze", * name: "Bronze", * description: "Baseline requirements met", * hexColorCode: "#CD7F32", * }, * { * id: "silver", * name: "Silver", * description: "Strong operational posture", * hexColorCode: "#C0C0C0", * }, * { * id: "gold", * name: "Gold", * description: "Exemplary reliability and observability", * hexColorCode: "#FFD700", * }, * ], * }); * ``` * * ## Import * * Scorecards can be imported using the entity GUID: * * ```sh * $ pulumi import newrelic:index/scorecard:Scorecard example * ``` * * To find a scorecard's GUID, use `terraform state show` after applying, or query NerdGraph: * * > **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. */ export declare class Scorecard extends pulumi.CustomResource { /** * Get an existing Scorecard resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ScorecardState, opts?: pulumi.CustomResourceOptions): Scorecard; /** * Returns true if the given object is an instance of Scorecard. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Scorecard; /** * A description of the scorecard's purpose. */ readonly description: pulumi.Output; /** * The name of the scorecard. */ readonly name: pulumi.Output; /** * The organisation UUID, resolved automatically from the provider account. */ readonly organizationId: pulumi.Output; /** * 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. */ readonly progressLevels: pulumi.Output; /** * 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. */ readonly ruleIds: pulumi.Output; /** * The GUID of the auto-created rules collection. Managed by the provider via `ruleIds`; do not modify directly. */ readonly rulesCollectionId: pulumi.Output; /** * 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: */ readonly tags: pulumi.Output; /** * Create a Scorecard resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ScorecardArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Scorecard resources. */ export interface ScorecardState { /** * A description of the scorecard's purpose. */ description?: pulumi.Input; /** * The name of the scorecard. */ name?: pulumi.Input; /** * The organisation UUID, resolved automatically from the provider account. */ organizationId?: pulumi.Input; /** * 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. */ progressLevels?: pulumi.Input[] | undefined>; /** * 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. */ ruleIds?: pulumi.Input[] | undefined>; /** * The GUID of the auto-created rules collection. Managed by the provider via `ruleIds`; do not modify directly. */ rulesCollectionId?: pulumi.Input; /** * 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: */ tags?: pulumi.Input[] | undefined>; } /** * The set of arguments for constructing a Scorecard resource. */ export interface ScorecardArgs { /** * A description of the scorecard's purpose. */ description?: pulumi.Input; /** * The name of the scorecard. */ name?: pulumi.Input; /** * 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. */ progressLevels?: pulumi.Input[] | undefined>; /** * 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. */ ruleIds?: pulumi.Input[] | undefined>; /** * 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: */ tags?: pulumi.Input[] | undefined>; } //# sourceMappingURL=scorecard.d.ts.map