1. Packages
  2. Packages
  3. Newrelic Provider
  4. API Docs
  5. synthetics
  6. getMonitorLocation
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
newrelic logo
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

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

    Example Usage

    using System.Collections.Generic;
    using Pulumi;
    using NewRelic = Pulumi.NewRelic;
    
    return await Deployment.RunAsync(() => 
    {
        var bar = NewRelic.Synthetics.GetMonitorLocation.Invoke(new()
        {
            Label = "My private location",
        });
    
        var foo = new NewRelic.Synthetics.Monitor("foo", new()
        {
            Type = "SIMPLE",
            Frequency = 5,
            Status = "ENABLED",
            Locations = new[]
            {
                bar.Apply(getMonitorLocationResult => getMonitorLocationResult.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 com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.synthetics.SyntheticsFunctions;
    import com.pulumi.newrelic.synthetics.inputs.GetMonitorLocationArgs;
    import com.pulumi.newrelic.synthetics.Monitor;
    import com.pulumi.newrelic.synthetics.MonitorArgs;
    import java.util.List;
    import java.util.ArrayList;
    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) {
            final var bar = SyntheticsFunctions.getMonitorLocation(GetMonitorLocationArgs.builder()
                .label("My private location")
                .build());
    
            var foo = new Monitor("foo", MonitorArgs.builder()        
                .type("SIMPLE")
                .frequency(5)
                .status("ENABLED")
                .locations(bar.applyValue(getMonitorLocationResult -> getMonitorLocationResult.name()))
                .uri("https://example.com")
                .validationString("add example validation check here")
                .verifySsl(true)
                .build());
    
        }
    }
    
    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"
    
    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"
    
    resources:
      foo:
        type: newrelic:synthetics:Monitor
        properties:
          type: SIMPLE
          frequency: 5
          status: ENABLED
          locations:
            - ${bar.name}
          uri: https://example.com
          # Required for type "SIMPLE" and "BROWSER"
          validationString: add example validation check here
          # Optional for type "SIMPLE" and "BROWSER"
          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)
    public static Output<GetMonitorLocationResult> getMonitorLocation(GetMonitorLocationArgs args, InvokeOptions options)
    
    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
    New Relic pulumi/pulumi-newrelic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the newrelic Terraform Provider.
    newrelic logo
    Viewing docs for New Relic v4.20.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.