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 LookupMonitor in the Go SDK.

public static class GetMonitor {
    public static Task<GetMonitorResult> InvokeAsync(GetMonitorArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string

The name of the synthetics monitor in New Relic.

Name string

The name of the synthetics monitor in New Relic.

name string

The name of the synthetics monitor in New Relic.

name str

The name of the synthetics monitor in New Relic.

GetMonitor Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

MonitorId string

The ID of the synthetics monitor.

Name string
Id string

The provider-assigned unique ID for this managed resource.

MonitorId string

The ID of the synthetics monitor.

Name string
id string

The provider-assigned unique ID for this managed resource.

monitorId string

The ID of the synthetics monitor.

name string
id str

The provider-assigned unique ID for this managed resource.

monitor_id str

The ID of the synthetics monitor.

name str

Package Details

Repository
https://github.com/pulumi/pulumi-newrelic
License
Apache-2.0
Notes
This Pulumi package is based on the newrelic Terraform Provider.