dynatrace logo
Dynatrace v0.0.2, Nov 1 22

dynatrace.getSyntheticLocation

The synthetic location data source allows the location ID to be retrieved based off of provided parameters.

Example Usage

Coming soon!

Coming soon!

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.DynatraceFunctions;
import com.pulumi.dynatrace.inputs.GetSyntheticLocationArgs;
import com.pulumi.dynatrace.HttpMonitor;
import com.pulumi.dynatrace.HttpMonitorArgs;
import com.pulumi.dynatrace.inputs.HttpMonitorAnomalyDetectionArgs;
import com.pulumi.dynatrace.inputs.HttpMonitorScriptArgs;
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 test = DynatraceFunctions.getSyntheticLocation(GetSyntheticLocationArgs.builder()
            .cloudPlatform("AMAZON_EC2")
            .name("Sydney")
            .type("PUBLIC")
            .build());

        var _name_ = new HttpMonitor("#name#", HttpMonitorArgs.builder()        
            .anomalyDetections(HttpMonitorAnomalyDetectionArgs.builder()
                .loadingTimeThresholds(HttpMonitorAnomalyDetectionLoadingTimeThresholdArgs.builder()
                    .enabled(true)
                    .build())
                .outageHandlings(HttpMonitorAnomalyDetectionOutageHandlingArgs.builder()
                    .globalOutage(true)
                    .localOutage(false)
                    .retryOnError(false)
                    .build())
                .build())
            .enabled(true)
            .frequency(60)
            .locations(test.applyValue(getSyntheticLocationResult -> getSyntheticLocationResult.id()))
            .script(HttpMonitorScriptArgs.builder()
                .requests(HttpMonitorScriptRequestArgs.builder()
                    .configuration(HttpMonitorScriptRequestConfigurationArgs.builder()
                        .acceptAnyCertificate(true)
                        .followRedirects(true)
                        .build())
                    .description("google.com")
                    .method("GET")
                    .url("https://www.google.com")
                    .validation(HttpMonitorScriptRequestValidationArgs.builder()
                        .rule(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                        .build())
                    .build())
                .build())
            .build());

    }
}

Coming soon!

import * as pulumi from "@pulumi/pulumi";
import * as dynatrace from "@pulumi/dynatrace";

const test = pulumi.output(dynatrace.getSyntheticLocation({
    cloudPlatform: "AMAZON_EC2",
    name: "Sydney",
    type: "PUBLIC",
}));
const _name_ = new dynatrace.HttpMonitor("#name#", {
    anomalyDetections: [{
        loadingTimeThresholds: [{
            enabled: true,
        }],
        outageHandlings: [{
            globalOutage: true,
            localOutage: false,
            retryOnError: false,
        }],
    }],
    enabled: true,
    frequency: 60,
    locations: [test.id!],
    script: {
        requests: [{
            configuration: {
                acceptAnyCertificate: true,
                followRedirects: true,
            },
            description: "google.com",
            method: "GET",
            url: "https://www.google.com",
            validation: {
                rules: [{
                    passIfFound: false,
                    type: "httpStatusesList",
                    value: ">=400",
                }],
            },
        }],
    },
});
resources:
  '#name#':
    type: dynatrace:HttpMonitor
    properties:
      anomalyDetections:
        - loadingTimeThresholds:
            - enabled: true
          outageHandlings:
            - globalOutage: true
              localOutage: false
              retryOnError: false
      enabled: true
      frequency: 60
      locations:
        - ${test.id}
      script:
        requests:
          - configuration:
              acceptAnyCertificate: true
              followRedirects: true
            description: google.com
            method: GET
            url: https://www.google.com
            validation:
              rule:
                - passIfFound: false
                  type: httpStatusesList
                  value: '>=400'
variables:
  test:
    fn::invoke:
      Function: dynatrace:getSyntheticLocation
      Arguments:
        cloudPlatform: AMAZON_EC2
        name: Sydney
        type: PUBLIC

Using getSyntheticLocation

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 getSyntheticLocation(args: GetSyntheticLocationArgs, opts?: InvokeOptions): Promise<GetSyntheticLocationResult>
function getSyntheticLocationOutput(args: GetSyntheticLocationOutputArgs, opts?: InvokeOptions): Output<GetSyntheticLocationResult>
def get_synthetic_location(cloud_platform: Optional[str] = None,
                           id: Optional[str] = None,
                           ips: Optional[Sequence[str]] = None,
                           name: Optional[str] = None,
                           stage: Optional[str] = None,
                           status: Optional[str] = None,
                           type: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSyntheticLocationResult
def get_synthetic_location_output(cloud_platform: Optional[pulumi.Input[str]] = None,
                           id: Optional[pulumi.Input[str]] = None,
                           ips: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           stage: Optional[pulumi.Input[str]] = None,
                           status: Optional[pulumi.Input[str]] = None,
                           type: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSyntheticLocationResult]
func GetSyntheticLocation(ctx *Context, args *GetSyntheticLocationArgs, opts ...InvokeOption) (*GetSyntheticLocationResult, error)
func GetSyntheticLocationOutput(ctx *Context, args *GetSyntheticLocationOutputArgs, opts ...InvokeOption) GetSyntheticLocationResultOutput

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

public static class GetSyntheticLocation 
{
    public static Task<GetSyntheticLocationResult> InvokeAsync(GetSyntheticLocationArgs args, InvokeOptions? opts = null)
    public static Output<GetSyntheticLocationResult> Invoke(GetSyntheticLocationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSyntheticLocationResult> getSyntheticLocation(GetSyntheticLocationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: dynatrace:index/getSyntheticLocation:getSyntheticLocation
  arguments:
    # arguments dictionary

The following arguments are supported:

CloudPlatform string

The cloud provider where the location is hosted.

Id string
Ips List<string>
Name string
Stage string
Status string
Type string
CloudPlatform string

The cloud provider where the location is hosted.

Id string
Ips []string
Name string
Stage string
Status string
Type string
cloudPlatform String

The cloud provider where the location is hosted.

id String
ips List<String>
name String
stage String
status String
type String
cloudPlatform string

The cloud provider where the location is hosted.

id string
ips string[]
name string
stage string
status string
type string
cloud_platform str

The cloud provider where the location is hosted.

id str
ips Sequence[str]
name str
stage str
status str
type str
cloudPlatform String

The cloud provider where the location is hosted.

id String
ips List<String>
name String
stage String
status String
type String

getSyntheticLocation Result

The following output properties are available:

CloudPlatform string

The cloud provider where the location is hosted.

Ips List<string>
Stage string
Status string
Id string
Name string
Type string
CloudPlatform string

The cloud provider where the location is hosted.

Ips []string
Stage string
Status string
Id string
Name string
Type string
cloudPlatform String

The cloud provider where the location is hosted.

ips List<String>
stage String
status String
id String
name String
type String
cloudPlatform string

The cloud provider where the location is hosted.

ips string[]
stage string
status string
id string
name string
type string
cloud_platform str

The cloud provider where the location is hosted.

ips Sequence[str]
stage str
status str
id str
name str
type str
cloudPlatform String

The cloud provider where the location is hosted.

ips List<String>
stage String
status String
id String
name String
type String

Package Details

Repository
dynatrace lbrlabs/pulumi-dynatrace
License
Apache-2.0
Notes

This Pulumi package is based on the dynatrace Terraform Provider.