published on Tuesday, Oct 27, 2026 by Pulumi
published on Tuesday, Oct 27, 2026 by Pulumi
Use this resource to create, update, and delete New Relic Scorecard Rules.
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.
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.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const alertCoverage = new newrelic.ScorecardRule("alert_coverage", {
name: "APM alert coverage",
description: "All APM services must have alerts configured",
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",
},
tags: [{
key: "team",
values: ["platform"],
}],
});
import pulumi
import pulumi_newrelic as newrelic
alert_coverage = newrelic.ScorecardRule("alert_coverage",
name="APM alert coverage",
description="All APM services must have alerts configured",
enabled=True,
run_interval=1440,
nrql_engine={
"accounts": [account_id],
"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",
},
tags=[{
"key": "team",
"values": ["platform"],
}])
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewScorecardRule(ctx, "alert_coverage", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("APM alert coverage"),
Description: pulumi.String("All APM services must have alerts configured"),
Enabled: pulumi.Bool(true),
RunInterval: pulumi.Int(1440),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
accountId,
},
Query: pulumi.String("SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago"),
},
Tags: newrelic.ScorecardRuleTagArray{
&newrelic.ScorecardRuleTagArgs{
Key: pulumi.String("team"),
Values: pulumi.StringArray{
pulumi.String("platform"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var alertCoverage = new NewRelic.ScorecardRule("alert_coverage", new()
{
Name = "APM alert coverage",
Description = "All APM services must have alerts configured",
Enabled = true,
RunInterval = 1440,
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
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",
},
Tags = new[]
{
new NewRelic.Inputs.ScorecardRuleTagArgs
{
Key = "team",
Values = new[]
{
"platform",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.ScorecardRule;
import com.pulumi.newrelic.ScorecardRuleArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleNrqlEngineArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleTagArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var alertCoverage = new ScorecardRule("alertCoverage", ScorecardRuleArgs.builder()
.name("APM alert coverage")
.description("All APM services must have alerts configured")
.enabled(true)
.runInterval(1440)
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.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")
.build())
.tags(ScorecardRuleTagArgs.builder()
.key("team")
.values("platform")
.build())
.build());
}
}
resources:
alertCoverage:
type: newrelic:ScorecardRule
name: alert_coverage
properties:
name: APM alert coverage
description: All APM services must have alerts configured
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
tags:
- key: team
values:
- platform
terraform {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_scorecard_rule" "alert_coverage" {
lifecycle {
create_before_destroy = true
}
name = "APM alert coverage"
description = "All APM services must have alerts configured"
enabled = true
run_interval = 1440
nrql_engine = {
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"
}
tags {
key = "team"
values = ["platform"]
}
}
See additional examples below.
Progress Level Relationship
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.
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const alertConfigured = new newrelic.ScorecardRule("alert_configured", {
name: "Alerts configured",
enabled: true,
runInterval: 1440,
progressLevel: "foundation",
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 lowLatency = new newrelic.ScorecardRule("low_latency", {
name: "P95 latency below 500ms",
enabled: true,
runInterval: 60,
progressLevel: "excellence",
nrqlEngine: {
accounts: [accountId],
query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
},
});
const engineering = new newrelic.Scorecard("engineering", {
name: "Engineering Standards",
progressLevels: [
{
id: "foundation",
name: "Foundation",
hexColorCode: "#CC4400",
},
{
id: "excellence",
name: "Excellence",
hexColorCode: "#00CC44",
},
],
ruleIds: [
alertConfigured.id,
lowLatency.id,
],
});
import pulumi
import pulumi_newrelic as newrelic
alert_configured = newrelic.ScorecardRule("alert_configured",
name="Alerts configured",
enabled=True,
run_interval=1440,
progress_level="foundation",
nrql_engine={
"accounts": [account_id],
"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",
})
low_latency = newrelic.ScorecardRule("low_latency",
name="P95 latency below 500ms",
enabled=True,
run_interval=60,
progress_level="excellence",
nrql_engine={
"accounts": [account_id],
"query": "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
})
engineering = newrelic.Scorecard("engineering",
name="Engineering Standards",
progress_levels=[
{
"id": "foundation",
"name": "Foundation",
"hex_color_code": "#CC4400",
},
{
"id": "excellence",
"name": "Excellence",
"hex_color_code": "#00CC44",
},
],
rule_ids=[
alert_configured.id,
low_latency.id,
])
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
alertConfigured, err := newrelic.NewScorecardRule(ctx, "alert_configured", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("Alerts configured"),
Enabled: pulumi.Bool(true),
RunInterval: pulumi.Int(1440),
ProgressLevel: pulumi.String("foundation"),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
accountId,
},
Query: pulumi.String("SELECT if(latest(alertSeverity) != 'NOT_CONFIGURED', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago"),
},
})
if err != nil {
return err
}
lowLatency, err := newrelic.NewScorecardRule(ctx, "low_latency", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("P95 latency below 500ms"),
Enabled: pulumi.Bool(true),
RunInterval: pulumi.Int(60),
ProgressLevel: pulumi.String("excellence"),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
accountId,
},
Query: pulumi.String("SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago"),
},
})
if err != nil {
return err
}
_, err = newrelic.NewScorecard(ctx, "engineering", &newrelic.ScorecardArgs{
Name: pulumi.String("Engineering Standards"),
ProgressLevels: newrelic.ScorecardProgressLevelArray{
&newrelic.ScorecardProgressLevelArgs{
Id: pulumi.String("foundation"),
Name: pulumi.String("Foundation"),
HexColorCode: pulumi.String("#CC4400"),
},
&newrelic.ScorecardProgressLevelArgs{
Id: pulumi.String("excellence"),
Name: pulumi.String("Excellence"),
HexColorCode: pulumi.String("#00CC44"),
},
},
RuleIds: pulumi.StringArray{
alertConfigured.ID().ToIDOutput().ToStringOutput(),
lowLatency.ID().ToIDOutput().ToStringOutput(),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var alertConfigured = new NewRelic.ScorecardRule("alert_configured", new()
{
Name = "Alerts configured",
Enabled = true,
RunInterval = 1440,
ProgressLevel = "foundation",
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
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",
},
});
var lowLatency = new NewRelic.ScorecardRule("low_latency", new()
{
Name = "P95 latency below 500ms",
Enabled = true,
RunInterval = 60,
ProgressLevel = "excellence",
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
accountId,
},
Query = "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
},
});
var engineering = new NewRelic.Scorecard("engineering", new()
{
Name = "Engineering Standards",
ProgressLevels = new[]
{
new NewRelic.Inputs.ScorecardProgressLevelArgs
{
Id = "foundation",
Name = "Foundation",
HexColorCode = "#CC4400",
},
new NewRelic.Inputs.ScorecardProgressLevelArgs
{
Id = "excellence",
Name = "Excellence",
HexColorCode = "#00CC44",
},
},
RuleIds = new[]
{
alertConfigured.Id,
lowLatency.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.ScorecardRule;
import com.pulumi.newrelic.ScorecardRuleArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleNrqlEngineArgs;
import com.pulumi.newrelic.Scorecard;
import com.pulumi.newrelic.ScorecardArgs;
import com.pulumi.newrelic.inputs.ScorecardProgressLevelArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var alertConfigured = new ScorecardRule("alertConfigured", ScorecardRuleArgs.builder()
.name("Alerts configured")
.enabled(true)
.runInterval(1440)
.progressLevel("foundation")
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.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")
.build())
.build());
var lowLatency = new ScorecardRule("lowLatency", ScorecardRuleArgs.builder()
.name("P95 latency below 500ms")
.enabled(true)
.runInterval(60)
.progressLevel("excellence")
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.accounts(accountId)
.query("SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago")
.build())
.build());
var engineering = new Scorecard("engineering", ScorecardArgs.builder()
.name("Engineering Standards")
.progressLevels(
ScorecardProgressLevelArgs.builder()
.id("foundation")
.name("Foundation")
.hexColorCode("#CC4400")
.build(),
ScorecardProgressLevelArgs.builder()
.id("excellence")
.name("Excellence")
.hexColorCode("#00CC44")
.build())
.ruleIds(
alertConfigured.id(),
lowLatency.id())
.build());
}
}
resources:
engineering:
type: newrelic:Scorecard
properties:
name: Engineering Standards
progressLevels:
- id: foundation
name: Foundation
hexColorCode: '#CC4400'
- id: excellence
name: Excellence
hexColorCode: '#00CC44'
ruleIds:
- ${alertConfigured.id}
- ${lowLatency.id}
alertConfigured:
type: newrelic:ScorecardRule
name: alert_configured
properties:
name: Alerts configured
enabled: true
runInterval: 1440
progressLevel: foundation
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
lowLatency:
type: newrelic:ScorecardRule
name: low_latency
properties:
name: P95 latency below 500ms
enabled: true
runInterval: 60
progressLevel: excellence
nrqlEngine:
accounts:
- ${accountId}
query: SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago
terraform {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_scorecard" "engineering" {
lifecycle {
create_before_destroy = true
}
name = "Engineering Standards"
progress_levels {
id = "foundation"
name = "Foundation"
hex_color_code = "#CC4400"
}
progress_levels {
id = "excellence"
name = "Excellence"
hex_color_code = "#00CC44"
}
rule_ids = [newrelic_scorecard_rule.alert_configured.id, newrelic_scorecard_rule.low_latency.id]
}
resource "newrelic_scorecard_rule" "alert_configured" {
lifecycle {
create_before_destroy = true
}
name = "Alerts configured"
enabled = true
run_interval = 1440
progress_level = "foundation"
nrql_engine = {
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"
}
}
resource "newrelic_scorecard_rule" "low_latency" {
lifecycle {
create_before_destroy = true
}
name = "P95 latency below 500ms"
enabled = true
run_interval = 60
progress_level = "excellence"
nrql_engine = {
accounts = [accountId]
query = "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago"
}
}
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.
Additional Examples
Disabled rule (paused without deletion)
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const latencyThreshold = new newrelic.ScorecardRule("latency_threshold", {
name: "P95 latency below 500ms",
enabled: false,
runInterval: 720,
nrqlEngine: {
accounts: [accountId],
query: "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
},
});
import pulumi
import pulumi_newrelic as newrelic
latency_threshold = newrelic.ScorecardRule("latency_threshold",
name="P95 latency below 500ms",
enabled=False,
run_interval=720,
nrql_engine={
"accounts": [account_id],
"query": "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
})
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewScorecardRule(ctx, "latency_threshold", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("P95 latency below 500ms"),
Enabled: pulumi.Bool(false),
RunInterval: pulumi.Int(720),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
accountId,
},
Query: pulumi.String("SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var latencyThreshold = new NewRelic.ScorecardRule("latency_threshold", new()
{
Name = "P95 latency below 500ms",
Enabled = false,
RunInterval = 720,
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
accountId,
},
Query = "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.ScorecardRule;
import com.pulumi.newrelic.ScorecardRuleArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleNrqlEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var latencyThreshold = new ScorecardRule("latencyThreshold", ScorecardRuleArgs.builder()
.name("P95 latency below 500ms")
.enabled(false)
.runInterval(720)
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.accounts(accountId)
.query("SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago")
.build())
.build());
}
}
resources:
latencyThreshold:
type: newrelic:ScorecardRule
name: latency_threshold
properties:
name: P95 latency below 500ms
enabled: false
runInterval: 720
nrqlEngine:
accounts:
- ${accountId}
query: SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago
terraform {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_scorecard_rule" "latency_threshold" {
lifecycle {
create_before_destroy = true
}
name = "P95 latency below 500ms"
enabled = false
run_interval = 720
nrql_engine = {
accounts = [accountId]
query = "SELECT if(percentile(duration, 95) < 0.5, 1, 0) AS 'score' FROM Transaction FACET entity.guid LIMIT MAX SINCE 1 hour ago"
}
}
Cross-account rule using joinAccounts
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const crossAccountErrors = new newrelic.ScorecardRule("cross_account_errors", {
name: "Cross-account error rate below 1%",
enabled: true,
runInterval: 60,
nrqlEngine: {
accounts: [primaryAccountId],
joinAccounts: [secondaryAccountId],
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",
},
});
import pulumi
import pulumi_newrelic as newrelic
cross_account_errors = newrelic.ScorecardRule("cross_account_errors",
name="Cross-account error rate below 1%",
enabled=True,
run_interval=60,
nrql_engine={
"accounts": [primary_account_id],
"join_accounts": [secondary_account_id],
"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",
})
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewScorecardRule(ctx, "cross_account_errors", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("Cross-account error rate below 1%"),
Enabled: pulumi.Bool(true),
RunInterval: pulumi.Int(60),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
primaryAccountId,
},
JoinAccounts: pulumi.IntArray{
secondaryAccountId,
},
Query: pulumi.String("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"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var crossAccountErrors = new NewRelic.ScorecardRule("cross_account_errors", new()
{
Name = "Cross-account error rate below 1%",
Enabled = true,
RunInterval = 60,
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
primaryAccountId,
},
JoinAccounts = new[]
{
secondaryAccountId,
},
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",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.ScorecardRule;
import com.pulumi.newrelic.ScorecardRuleArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleNrqlEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var crossAccountErrors = new ScorecardRule("crossAccountErrors", ScorecardRuleArgs.builder()
.name("Cross-account error rate below 1%")
.enabled(true)
.runInterval(60)
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.accounts(primaryAccountId)
.joinAccounts(secondaryAccountId)
.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")
.build())
.build());
}
}
resources:
crossAccountErrors:
type: newrelic:ScorecardRule
name: cross_account_errors
properties:
name: Cross-account error rate below 1%
enabled: true
runInterval: 60
nrqlEngine:
accounts:
- ${primaryAccountId}
joinAccounts:
- ${secondaryAccountId}
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
terraform {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_scorecard_rule" "cross_account_errors" {
lifecycle {
create_before_destroy = true
}
name = "Cross-account error rate below 1%"
enabled = true
run_interval = 60
nrql_engine = {
accounts = [primaryAccountId]
join_accounts = [secondaryAccountId]
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"
}
}
Rule with impact weighting
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const criticalAlertCheck = new newrelic.ScorecardRule("critical_alert_check", {
name: "Critical alerts configured",
enabled: true,
runInterval: 1440,
impactWeight: 3,
nrqlEngine: {
accounts: [accountId],
query: "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
},
});
import pulumi
import pulumi_newrelic as newrelic
critical_alert_check = newrelic.ScorecardRule("critical_alert_check",
name="Critical alerts configured",
enabled=True,
run_interval=1440,
impact_weight=3,
nrql_engine={
"accounts": [account_id],
"query": "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
})
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := newrelic.NewScorecardRule(ctx, "critical_alert_check", &newrelic.ScorecardRuleArgs{
Name: pulumi.String("Critical alerts configured"),
Enabled: pulumi.Bool(true),
RunInterval: pulumi.Int(1440),
ImpactWeight: pulumi.Int(3),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
accountId,
},
Query: pulumi.String("SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var criticalAlertCheck = new NewRelic.ScorecardRule("critical_alert_check", new()
{
Name = "Critical alerts configured",
Enabled = true,
RunInterval = 1440,
ImpactWeight = 3,
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
accountId,
},
Query = "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.ScorecardRule;
import com.pulumi.newrelic.ScorecardRuleArgs;
import com.pulumi.newrelic.inputs.ScorecardRuleNrqlEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var criticalAlertCheck = new ScorecardRule("criticalAlertCheck", ScorecardRuleArgs.builder()
.name("Critical alerts configured")
.enabled(true)
.runInterval(1440)
.impactWeight(3)
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.accounts(accountId)
.query("SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago")
.build())
.build());
}
}
resources:
criticalAlertCheck:
type: newrelic:ScorecardRule
name: critical_alert_check
properties:
name: Critical alerts configured
enabled: true
runInterval: 1440
impactWeight: 3 # counts 3× relative to rules without a weight
nrqlEngine:
accounts:
- ${accountId}
query: SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago
terraform {
required_providers {
newrelic = {
source = "pulumi/newrelic"
}
}
}
resource "newrelic_scorecard_rule" "critical_alert_check" {
lifecycle {
create_before_destroy = true
}
name = "Critical alerts configured"
enabled = true
run_interval = 1440
impact_weight = 3 # counts 3× relative to rules without a weight
nrql_engine = {
accounts = [accountId]
query = "SELECT if(latest(alertSeverity) = 'CRITICAL', 1, 0) AS 'score' FROM Entity WHERE type = 'APM-APPLICATION' FACET id LIMIT MAX SINCE 1 day ago"
}
}
Create ScorecardRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ScorecardRule(name: string, args: ScorecardRuleArgs, opts?: CustomResourceOptions);@overload
def ScorecardRule(resource_name: str,
args: ScorecardRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ScorecardRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
enabled: Optional[bool] = None,
nrql_engine: Optional[ScorecardRuleNrqlEngineArgs] = None,
description: Optional[str] = None,
impact_weight: Optional[int] = None,
name: Optional[str] = None,
progress_level: Optional[str] = None,
run_interval: Optional[int] = None,
tags: Optional[Sequence[ScorecardRuleTagArgs]] = None)func NewScorecardRule(ctx *Context, name string, args ScorecardRuleArgs, opts ...ResourceOption) (*ScorecardRule, error)public ScorecardRule(string name, ScorecardRuleArgs args, CustomResourceOptions? opts = null)
public ScorecardRule(String name, ScorecardRuleArgs args)
public ScorecardRule(String name, ScorecardRuleArgs args, CustomResourceOptions options)
type: newrelic:ScorecardRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "newrelic_scorecard_rule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ScorecardRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ScorecardRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ScorecardRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScorecardRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ScorecardRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var scorecardRuleResource = new NewRelic.ScorecardRule("scorecardRuleResource", new()
{
Enabled = false,
NrqlEngine = new NewRelic.Inputs.ScorecardRuleNrqlEngineArgs
{
Accounts = new[]
{
0,
},
Query = "string",
JoinAccounts = new[]
{
0,
},
},
Description = "string",
ImpactWeight = 0,
Name = "string",
ProgressLevel = "string",
RunInterval = 0,
Tags = new[]
{
new NewRelic.Inputs.ScorecardRuleTagArgs
{
Key = "string",
Values = new[]
{
"string",
},
},
},
});
example, err := newrelic.NewScorecardRule(ctx, "scorecardRuleResource", &newrelic.ScorecardRuleArgs{
Enabled: pulumi.Bool(false),
NrqlEngine: &newrelic.ScorecardRuleNrqlEngineArgs{
Accounts: pulumi.IntArray{
pulumi.Int(0),
},
Query: pulumi.String("string"),
JoinAccounts: pulumi.IntArray{
pulumi.Int(0),
},
},
Description: pulumi.String("string"),
ImpactWeight: pulumi.Int(0),
Name: pulumi.String("string"),
ProgressLevel: pulumi.String("string"),
RunInterval: pulumi.Int(0),
Tags: newrelic.ScorecardRuleTagArray{
&newrelic.ScorecardRuleTagArgs{
Key: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
})
resource "newrelic_scorecard_rule" "scorecardRuleResource" {
lifecycle {
create_before_destroy = true
}
enabled = false
nrql_engine = {
accounts = [0]
query = "string"
join_accounts = [0]
}
description = "string"
impact_weight = 0
name = "string"
progress_level = "string"
run_interval = 0
tags {
key = "string"
values = ["string"]
}
}
var scorecardRuleResource = new ScorecardRule("scorecardRuleResource", ScorecardRuleArgs.builder()
.enabled(false)
.nrqlEngine(ScorecardRuleNrqlEngineArgs.builder()
.accounts(0)
.query("string")
.joinAccounts(0)
.build())
.description("string")
.impactWeight(0)
.name("string")
.progressLevel("string")
.runInterval(0)
.tags(ScorecardRuleTagArgs.builder()
.key("string")
.values("string")
.build())
.build());
scorecard_rule_resource = newrelic.ScorecardRule("scorecardRuleResource",
enabled=False,
nrql_engine={
"accounts": [0],
"query": "string",
"join_accounts": [0],
},
description="string",
impact_weight=0,
name="string",
progress_level="string",
run_interval=0,
tags=[{
"key": "string",
"values": ["string"],
}])
const scorecardRuleResource = new newrelic.ScorecardRule("scorecardRuleResource", {
enabled: false,
nrqlEngine: {
accounts: [0],
query: "string",
joinAccounts: [0],
},
description: "string",
impactWeight: 0,
name: "string",
progressLevel: "string",
runInterval: 0,
tags: [{
key: "string",
values: ["string"],
}],
});
type: newrelic:ScorecardRule
properties:
description: string
enabled: false
impactWeight: 0
name: string
nrqlEngine:
accounts:
- 0
joinAccounts:
- 0
query: string
progressLevel: string
runInterval: 0
tags:
- key: string
values:
- string
ScorecardRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ScorecardRule resource accepts the following input properties:
- Enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - Nrql
Engine Pulumi.New Relic. Inputs. Scorecard Rule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - Description string
- A description of what this rule measures.
- Impact
Weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- Name string
- The name of the rule.
- Progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - Run
Interval int - 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. -
List<Pulumi.
New Relic. Inputs. Scorecard Rule Tag> - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- Enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - Nrql
Engine ScorecardRule Nrql Engine Args - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - Description string
- A description of what this rule measures.
- Impact
Weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- Name string
- The name of the rule.
- Progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - Run
Interval int - 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. -
[]Scorecard
Rule Tag Args - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - nrql_
engine object - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - description string
- A description of what this rule measures.
- impact_
weight number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name string
- The name of the rule.
- progress_
level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run_
interval number - 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. - list(object)
- One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- enabled Boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - nrql
Engine ScorecardRule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - description String
- A description of what this rule measures.
- impact
Weight Integer - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name String
- The name of the rule.
- progress
Level String - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval Integer - 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. -
List<Scorecard
Rule Tag> - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- enabled boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - nrql
Engine ScorecardRule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - description string
- A description of what this rule measures.
- impact
Weight number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name string
- The name of the rule.
- progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval number - 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. -
Scorecard
Rule Tag[] - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - nrql_
engine ScorecardRule Nrql Engine Args - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - description str
- A description of what this rule measures.
- impact_
weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name str
- The name of the rule.
- progress_
level str - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run_
interval int - 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. -
Sequence[Scorecard
Rule Tag Args] - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- enabled Boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - nrql
Engine Property Map - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - description String
- A description of what this rule measures.
- impact
Weight Number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name String
- The name of the rule.
- progress
Level String - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval Number - 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. - List<Property Map>
- One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
Outputs
All input properties are implicitly available as output properties. Additionally, the ScorecardRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The organisation UUID, resolved automatically from the provider account.
- Id string
- The provider-assigned unique ID for this managed resource.
- Organization
Id string - The organisation UUID, resolved automatically from the provider account.
- id string
- The provider-assigned unique ID for this managed resource.
- organization_
id string - The organisation UUID, resolved automatically from the provider account.
- id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The organisation UUID, resolved automatically from the provider account.
- id string
- The provider-assigned unique ID for this managed resource.
- organization
Id string - The organisation UUID, resolved automatically from the provider account.
- id str
- The provider-assigned unique ID for this managed resource.
- organization_
id str - The organisation UUID, resolved automatically from the provider account.
- id String
- The provider-assigned unique ID for this managed resource.
- organization
Id String - The organisation UUID, resolved automatically from the provider account.
Look up Existing ScorecardRule Resource
Get an existing ScorecardRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ScorecardRuleState, opts?: CustomResourceOptions): ScorecardRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
impact_weight: Optional[int] = None,
name: Optional[str] = None,
nrql_engine: Optional[ScorecardRuleNrqlEngineArgs] = None,
organization_id: Optional[str] = None,
progress_level: Optional[str] = None,
run_interval: Optional[int] = None,
tags: Optional[Sequence[ScorecardRuleTagArgs]] = None) -> ScorecardRulefunc GetScorecardRule(ctx *Context, name string, id IDInput, state *ScorecardRuleState, opts ...ResourceOption) (*ScorecardRule, error)public static ScorecardRule Get(string name, Input<string> id, ScorecardRuleState? state, CustomResourceOptions? opts = null)public static ScorecardRule get(String name, Output<String> id, ScorecardRuleState state, CustomResourceOptions options)resources: _: type: newrelic:ScorecardRule get: id: ${id}import {
to = newrelic_scorecard_rule.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- A description of what this rule measures.
- Enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - Impact
Weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- Name string
- The name of the rule.
- Nrql
Engine Pulumi.New Relic. Inputs. Scorecard Rule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - Organization
Id string - The organisation UUID, resolved automatically from the provider account.
- Progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - Run
Interval int - 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. -
List<Pulumi.
New Relic. Inputs. Scorecard Rule Tag> - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- Description string
- A description of what this rule measures.
- Enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - Impact
Weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- Name string
- The name of the rule.
- Nrql
Engine ScorecardRule Nrql Engine Args - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - Organization
Id string - The organisation UUID, resolved automatically from the provider account.
- Progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - Run
Interval int - 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. -
[]Scorecard
Rule Tag Args - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- description string
- A description of what this rule measures.
- enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - impact_
weight number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name string
- The name of the rule.
- nrql_
engine object - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - organization_
id string - The organisation UUID, resolved automatically from the provider account.
- progress_
level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run_
interval number - 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. - list(object)
- One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- description String
- A description of what this rule measures.
- enabled Boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - impact
Weight Integer - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name String
- The name of the rule.
- nrql
Engine ScorecardRule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - organization
Id String - The organisation UUID, resolved automatically from the provider account.
- progress
Level String - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval Integer - 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. -
List<Scorecard
Rule Tag> - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- description string
- A description of what this rule measures.
- enabled boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - impact
Weight number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name string
- The name of the rule.
- nrql
Engine ScorecardRule Nrql Engine - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - organization
Id string - The organisation UUID, resolved automatically from the provider account.
- progress
Level string - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval number - 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. -
Scorecard
Rule Tag[] - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- description str
- A description of what this rule measures.
- enabled bool
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - impact_
weight int - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name str
- The name of the rule.
- nrql_
engine ScorecardRule Nrql Engine Args - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - organization_
id str - The organisation UUID, resolved automatically from the provider account.
- progress_
level str - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run_
interval int - 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. -
Sequence[Scorecard
Rule Tag Args] - One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
- description String
- A description of what this rule measures.
- enabled Boolean
- Whether the rule is active. Set to
falseto pause evaluation without deleting the rule. - impact
Weight Number - A non-negative integer weighting this rule's contribution to the overall scorecard score relative to other rules. Omit for equal weighting.
- name String
- The name of the rule.
- nrql
Engine Property Map - A block defining the NRQL query that produces the score. See Nested
nrqlEngineblock below. - organization
Id String - The organisation UUID, resolved automatically from the provider account.
- progress
Level String - The
idof a progress tier defined in the parentnewrelic.Scorecard. Assigns the rule to a visual grouping in the UI. The value must exactly match aprogress_levels.idon the scorecard (e.g."red","amber","green"). Omit to leave the rule ungrouped. See Progress Level Relationship below. - run
Interval Number - 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. - List<Property Map>
- One or more
tagsblocks assigning key-value metadata to this rule. Tags prefixed withnr.are managed by New Relic and are preserved automatically. Each block supports:
Supporting Types
ScorecardRuleNrqlEngine, ScorecardRuleNrqlEngineArgs
- Accounts List<int>
- Account IDs where this rule runs.
- Query string
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- Join
Accounts List<int> - Additional account IDs to join with the query accounts.
- Accounts []int
- Account IDs where this rule runs.
- Query string
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- Join
Accounts []int - Additional account IDs to join with the query accounts.
- accounts list(number)
- Account IDs where this rule runs.
- query string
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- join_
accounts list(number) - Additional account IDs to join with the query accounts.
- accounts List<Integer>
- Account IDs where this rule runs.
- query String
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- join
Accounts List<Integer> - Additional account IDs to join with the query accounts.
- accounts number[]
- Account IDs where this rule runs.
- query string
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- join
Accounts number[] - Additional account IDs to join with the query accounts.
- accounts Sequence[int]
- Account IDs where this rule runs.
- query str
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- join_
accounts Sequence[int] - Additional account IDs to join with the query accounts.
- accounts List<Number>
- Account IDs where this rule runs.
- query String
- The NRQL query. Must be FACET-ed and alias the result as 'score'.
- join
Accounts List<Number> - Additional account IDs to join with the query accounts.
ScorecardRuleTag, ScorecardRuleTagArgs
Import
Scorecard rules can be imported using the entity GUID:
$ pulumi import newrelic:index/scorecardRule:ScorecardRule example <guid>
To find a rule’s GUID, use terraform state show after applying, or query NerdGraph:
{
actor {
entityManagement {
entitySearch(query: "type = 'SCORECARD_RULE' AND name = 'Your Rule Name'") {
entities { id name }
}
}
}
}
NOTE: Scorecard rules are NGEP entities and are not returned by the
newrelic.getEntitydata source. Use the NerdGraph query above orterraform state show newrelic_scorecard_rule.exampleto retrieve the GUID.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.
published on Tuesday, Oct 27, 2026 by Pulumi