GetMonitor
Use this data source to get information about a specific synthetics monitor in New Relic that already exists. This can be used to set up a Synthetics alert condition.
Example Usage
using Pulumi;
using NewRelic = Pulumi.NewRelic;
class MyStack : Stack
{
public MyStack()
{
var bar = Output.Create(NewRelic.Synthetics.GetMonitor.InvokeAsync(new NewRelic.Synthetics.GetMonitorArgs
{
Name = "bar",
}));
var baz = new NewRelic.Synthetics.AlertCondition("baz", new NewRelic.Synthetics.AlertConditionArgs
{
PolicyId = newrelic_alert_policy.Foo.Id,
MonitorId = bar.Apply(bar => bar.Id),
RunbookUrl = "https://www.example.com",
});
}
}
Coming soon!
import pulumi
import pulumi_newrelic as newrelic
bar = newrelic.synthetics.get_monitor(name="bar")
baz = newrelic.synthetics.AlertCondition("baz",
policy_id=newrelic_alert_policy["foo"]["id"],
monitor_id=bar.id,
runbook_url="https://www.example.com")import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const bar = newrelic.synthetics.getMonitor({
name: "bar",
});
const baz = new newrelic.synthetics.AlertCondition("baz", {
policyId: newrelic_alert_policy.foo.id,
monitorId: bar.then(bar => bar.id),
runbookUrl: "https://www.example.com",
});Using GetMonitor
function getMonitor(args: GetMonitorArgs, opts?: InvokeOptions): Promise<GetMonitorResult>function get_monitor(name=None, opts=None)func LookupMonitor(ctx *Context, args *LookupMonitorArgs, opts ...InvokeOption) (*LookupMonitorResult, error)Note: This function is named
LookupMonitorin the Go SDK.
public static class GetMonitor {
public static Task<GetMonitorResult> InvokeAsync(GetMonitorArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
GetMonitor Result
The following output properties are available:
Package Details
- Repository
- https://github.com/pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.