New Relic

Pulumi Official
Package maintained by Pulumi
v4.16.0 published on Thursday, May 26, 2022 by Pulumi

getMonitorLocation

Use this data source to get information about a specific Synthetics monitor location in New Relic that already exists.

Example Usage

using Pulumi;
using NewRelic = Pulumi.NewRelic;

class MyStack : Stack
{
    public MyStack()
    {
        var bar = Output.Create(NewRelic.Synthetics.GetMonitorLocation.InvokeAsync(new NewRelic.Synthetics.GetMonitorLocationArgs
        {
            Label = "My private location",
        }));
        var foo = new NewRelic.Synthetics.Monitor("foo", new NewRelic.Synthetics.MonitorArgs
        {
            Type = "SIMPLE",
            Frequency = 5,
            Status = "ENABLED",
            Locations = 
            {
                bar.Apply(bar => bar.Name),
            },
            Uri = "https://example.com",
            ValidationString = "add example validation check here",
            VerifySsl = true,
        });
        // Optional for type "SIMPLE" and "BROWSER"
    }

}
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic/synthetics"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		bar, err := synthetics.GetMonitorLocation(ctx, &synthetics.GetMonitorLocationArgs{
			Label: "My private location",
		}, nil)
		if err != nil {
			return err
		}
		_, err = synthetics.NewMonitor(ctx, "foo", &synthetics.MonitorArgs{
			Type:      pulumi.String("SIMPLE"),
			Frequency: pulumi.Int(5),
			Status:    pulumi.String("ENABLED"),
			Locations: pulumi.StringArray{
				pulumi.String(bar.Name),
			},
			Uri:              pulumi.String("https://example.com"),
			ValidationString: pulumi.String("add example validation check here"),
			VerifySsl:        pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var bar = Output.of(SyntheticsFunctions.getMonitorLocation(GetMonitorLocationArgs.builder()
            .label("My private location")
            .build()));

        var foo = new Monitor("foo", MonitorArgs.builder()        
            .type("SIMPLE")
            .frequency(5)
            .status("ENABLED")
            .locations(bar.apply(getMonitorLocationResult -> getMonitorLocationResult.getName()))
            .uri("https://example.com")
            .validationString("add example validation check here")
            .verifySsl(true)
            .build());

        }
}
import pulumi
import pulumi_newrelic as newrelic

bar = newrelic.synthetics.get_monitor_location(label="My private location")
foo = newrelic.synthetics.Monitor("foo",
    type="SIMPLE",
    frequency=5,
    status="ENABLED",
    locations=[bar.name],
    uri="https://example.com",
    validation_string="add example validation check here",
    verify_ssl=True)
# Optional for type "SIMPLE" and "BROWSER"
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const bar = newrelic.synthetics.getMonitorLocation({
    label: "My private location",
});
const foo = new newrelic.synthetics.Monitor("foo", {
    type: "SIMPLE",
    frequency: 5,
    status: "ENABLED",
    locations: [bar.then(bar => bar.name)],
    uri: "https://example.com",
    validationString: "add example validation check here",
    verifySsl: true,
});
// Optional for type "SIMPLE" and "BROWSER"
resources:
  foo:
    type: newrelic:synthetics:Monitor
    properties:
      type: SIMPLE
      frequency: 5
      status: ENABLED
      locations:
        - ${bar.name}
      uri: https://example.com
      validationString: add example validation check here
      verifySsl: true
variables:
  bar:
    Fn::Invoke:
      Function: newrelic:synthetics:getMonitorLocation
      Arguments:
        label: My private location

Using getMonitorLocation

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getMonitorLocation(args: GetMonitorLocationArgs, opts?: InvokeOptions): Promise<GetMonitorLocationResult>
function getMonitorLocationOutput(args: GetMonitorLocationOutputArgs, opts?: InvokeOptions): Output<GetMonitorLocationResult>
def get_monitor_location(label: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetMonitorLocationResult
def get_monitor_location_output(label: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetMonitorLocationResult]
func GetMonitorLocation(ctx *Context, args *GetMonitorLocationArgs, opts ...InvokeOption) (*GetMonitorLocationResult, error)
func GetMonitorLocationOutput(ctx *Context, args *GetMonitorLocationOutputArgs, opts ...InvokeOption) GetMonitorLocationResultOutput

> Note: This function is named GetMonitorLocation in the Go SDK.

public static class GetMonitorLocation 
{
    public static Task<GetMonitorLocationResult> InvokeAsync(GetMonitorLocationArgs args, InvokeOptions? opts = null)
    public static Output<GetMonitorLocationResult> Invoke(GetMonitorLocationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetMonitorLocationResult> getMonitorLocation(GetMonitorLocationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: newrelic:synthetics/getMonitorLocation:getMonitorLocation
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Label string

The label of the Synthetics monitor location.

Label string

The label of the Synthetics monitor location.

label String

The label of the Synthetics monitor location.

label string

The label of the Synthetics monitor location.

label str

The label of the Synthetics monitor location.

label String

The label of the Synthetics monitor location.

getMonitorLocation Result

The following output properties are available:

Description string

A description of the Synthetics monitor location.

HighSecurityMode bool

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

Id string

The provider-assigned unique ID for this managed resource.

Label string
Name string

The name of the Synthetics monitor location.

Private bool

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

Description string

A description of the Synthetics monitor location.

HighSecurityMode bool

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

Id string

The provider-assigned unique ID for this managed resource.

Label string
Name string

The name of the Synthetics monitor location.

Private bool

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

description String

A description of the Synthetics monitor location.

highSecurityMode Boolean

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

id String

The provider-assigned unique ID for this managed resource.

label String
name String

The name of the Synthetics monitor location.

private_ Boolean

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

description string

A description of the Synthetics monitor location.

highSecurityMode boolean

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

id string

The provider-assigned unique ID for this managed resource.

label string
name string

The name of the Synthetics monitor location.

private boolean

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

description str

A description of the Synthetics monitor location.

high_security_mode bool

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

id str

The provider-assigned unique ID for this managed resource.

label str
name str

The name of the Synthetics monitor location.

private bool

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

description String

A description of the Synthetics monitor location.

highSecurityMode Boolean

Represents if high security mode is enabled for the location. A value of true means that high security mode is enabled, and a value of false means it is disabled.

id String

The provider-assigned unique ID for this managed resource.

label String
name String

The name of the Synthetics monitor location.

private Boolean

Represents if this location is a private location. A value of true means that the location is private, and a value of false means it is public.

Package Details

Repository
https://github.com/pulumi/pulumi-newrelic
License
Apache-2.0
Notes

This Pulumi package is based on the newrelic Terraform Provider.