1. Packages
  2. Packages
  3. Dynatrace
  4. API Docs
  5. ApplicationDetectionRuleV2
Viewing docs for Dynatrace v0.36.0
published on Tuesday, Jun 9, 2026 by Pulumiverse
dynatrace logo
Viewing docs for Dynatrace v0.36.0
published on Tuesday, Jun 9, 2026 by Pulumiverse

    This resource does not handle ordering of rules. If ordering is required, please use dynatrace.ApplicationDetectionRule instead.

    This resource requires the API token scopes Read settings (settings.read) and Write settings (settings.write)

    Dynatrace Documentation

    • Check application detection rules - https://www.dynatrace.com/support/help/platform-modules/digital-experience/web-applications/additional-configuration/application-detection-rules

    • Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: builtin:rum.web.app-detection)

    Export Example Usage

    • terraform-provider-dynatrace -export dynatrace.ApplicationDetectionRuleV2 downloads all existing application detection rule configuration

    The full documentation of the export feature is available here.

    Resource Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    const webApplication = dynatrace.getApplication({
        name: "Web Application",
    });
    const detectionRule = new dynatrace.ApplicationDetectionRuleV2("detection_rule", {
        applicationId: webApplication.then(webApplication => webApplication.id),
        matcher: "DOMAIN_MATCHES",
        pattern: "TerraformTest",
    });
    
    import pulumi
    import pulumi_dynatrace as dynatrace
    import pulumiverse_dynatrace as dynatrace
    
    web_application = dynatrace.get_application(name="Web Application")
    detection_rule = dynatrace.ApplicationDetectionRuleV2("detection_rule",
        application_id=web_application.id,
        matcher="DOMAIN_MATCHES",
        pattern="TerraformTest")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		webApplication, err := dynatrace.GetApplication(ctx, &dynatrace.GetApplicationArgs{
    			Name: "Web Application",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.NewApplicationDetectionRuleV2(ctx, "detection_rule", &dynatrace.ApplicationDetectionRuleV2Args{
    			ApplicationId: pulumi.String(pulumi.String(webApplication.Id)),
    			Matcher:       pulumi.String("DOMAIN_MATCHES"),
    			Pattern:       pulumi.String("TerraformTest"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Dynatrace = Pulumiverse.Dynatrace;
    
    return await Deployment.RunAsync(() => 
    {
        var webApplication = Dynatrace.GetApplication.Invoke(new()
        {
            Name = "Web Application",
        });
    
        var detectionRule = new Dynatrace.ApplicationDetectionRuleV2("detection_rule", new()
        {
            ApplicationId = webApplication.Apply(getApplicationResult => getApplicationResult.Id),
            Matcher = "DOMAIN_MATCHES",
            Pattern = "TerraformTest",
        });
    
    });
    
    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.GetApplicationArgs;
    import com.pulumi.dynatrace.ApplicationDetectionRuleV2;
    import com.pulumi.dynatrace.ApplicationDetectionRuleV2Args;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 webApplication = DynatraceFunctions.getApplication(GetApplicationArgs.builder()
                .name("Web Application")
                .build());
    
            var detectionRule = new ApplicationDetectionRuleV2("detectionRule", ApplicationDetectionRuleV2Args.builder()
                .applicationId(webApplication.id())
                .matcher("DOMAIN_MATCHES")
                .pattern("TerraformTest")
                .build());
    
        }
    }
    
    resources:
      detectionRule:
        type: dynatrace:ApplicationDetectionRuleV2
        name: detection_rule
        properties:
          applicationId: ${webApplication.id}
          matcher: DOMAIN_MATCHES
          pattern: TerraformTest
    variables:
      webApplication:
        fn::invoke:
          function: dynatrace:getApplication
          arguments:
            name: Web Application
    
    pulumi {
      required_providers {
        dynatrace = {
          source = "pulumi/dynatrace"
        }
      }
    }
    
    data "dynatrace_getapplication" "webApplication" {
      name = "Web Application"
    }
    
    resource "dynatrace_applicationdetectionrulev2" "detection_rule" {
      application_id = data.dynatrace_getapplication.webApplication.id
      matcher        = "DOMAIN_MATCHES"
      pattern        = "TerraformTest"
    }
    

    Create ApplicationDetectionRuleV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApplicationDetectionRuleV2(name: string, args: ApplicationDetectionRuleV2Args, opts?: CustomResourceOptions);
    @overload
    def ApplicationDetectionRuleV2(resource_name: str,
                                   args: ApplicationDetectionRuleV2Args,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApplicationDetectionRuleV2(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   application_id: Optional[str] = None,
                                   matcher: Optional[str] = None,
                                   pattern: Optional[str] = None,
                                   description: Optional[str] = None,
                                   insert_after: Optional[str] = None)
    func NewApplicationDetectionRuleV2(ctx *Context, name string, args ApplicationDetectionRuleV2Args, opts ...ResourceOption) (*ApplicationDetectionRuleV2, error)
    public ApplicationDetectionRuleV2(string name, ApplicationDetectionRuleV2Args args, CustomResourceOptions? opts = null)
    public ApplicationDetectionRuleV2(String name, ApplicationDetectionRuleV2Args args)
    public ApplicationDetectionRuleV2(String name, ApplicationDetectionRuleV2Args args, CustomResourceOptions options)
    
    type: dynatrace:ApplicationDetectionRuleV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "dynatrace_applicationdetectionrulev2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ApplicationDetectionRuleV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ApplicationDetectionRuleV2Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ApplicationDetectionRuleV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApplicationDetectionRuleV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApplicationDetectionRuleV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var applicationDetectionRuleV2Resource = new Dynatrace.ApplicationDetectionRuleV2("applicationDetectionRuleV2Resource", new()
    {
        ApplicationId = "string",
        Matcher = "string",
        Pattern = "string",
        Description = "string",
        InsertAfter = "string",
    });
    
    example, err := dynatrace.NewApplicationDetectionRuleV2(ctx, "applicationDetectionRuleV2Resource", &dynatrace.ApplicationDetectionRuleV2Args{
    	ApplicationId: pulumi.String("string"),
    	Matcher:       pulumi.String("string"),
    	Pattern:       pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	InsertAfter:   pulumi.String("string"),
    })
    
    resource "dynatrace_applicationdetectionrulev2" "applicationDetectionRuleV2Resource" {
      application_id = "string"
      matcher        = "string"
      pattern        = "string"
      description    = "string"
      insert_after   = "string"
    }
    
    var applicationDetectionRuleV2Resource = new ApplicationDetectionRuleV2("applicationDetectionRuleV2Resource", ApplicationDetectionRuleV2Args.builder()
        .applicationId("string")
        .matcher("string")
        .pattern("string")
        .description("string")
        .insertAfter("string")
        .build());
    
    application_detection_rule_v2_resource = dynatrace.ApplicationDetectionRuleV2("applicationDetectionRuleV2Resource",
        application_id="string",
        matcher="string",
        pattern="string",
        description="string",
        insert_after="string")
    
    const applicationDetectionRuleV2Resource = new dynatrace.ApplicationDetectionRuleV2("applicationDetectionRuleV2Resource", {
        applicationId: "string",
        matcher: "string",
        pattern: "string",
        description: "string",
        insertAfter: "string",
    });
    
    type: dynatrace:ApplicationDetectionRuleV2
    properties:
        applicationId: string
        description: string
        insertAfter: string
        matcher: string
        pattern: string
    

    ApplicationDetectionRuleV2 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ApplicationDetectionRuleV2 resource accepts the following input properties:

    ApplicationId string
    Select an existing application or create a new one.
    Matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    Pattern string
    Pattern
    Description string
    Add a description for your rule
    InsertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    ApplicationId string
    Select an existing application or create a new one.
    Matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    Pattern string
    Pattern
    Description string
    Add a description for your rule
    InsertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    application_id string
    Select an existing application or create a new one.
    matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern string
    Pattern
    description string
    Add a description for your rule
    insert_after string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    applicationId String
    Select an existing application or create a new one.
    matcher String
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern String
    Pattern
    description String
    Add a description for your rule
    insertAfter String
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    applicationId string
    Select an existing application or create a new one.
    matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern string
    Pattern
    description string
    Add a description for your rule
    insertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    application_id str
    Select an existing application or create a new one.
    matcher str
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern str
    Pattern
    description str
    Add a description for your rule
    insert_after str
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    applicationId String
    Select an existing application or create a new one.
    matcher String
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern String
    Pattern
    description String
    Add a description for your rule
    insertAfter String
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApplicationDetectionRuleV2 resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApplicationDetectionRuleV2 Resource

    Get an existing ApplicationDetectionRuleV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ApplicationDetectionRuleV2State, opts?: CustomResourceOptions): ApplicationDetectionRuleV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_id: Optional[str] = None,
            description: Optional[str] = None,
            insert_after: Optional[str] = None,
            matcher: Optional[str] = None,
            pattern: Optional[str] = None) -> ApplicationDetectionRuleV2
    func GetApplicationDetectionRuleV2(ctx *Context, name string, id IDInput, state *ApplicationDetectionRuleV2State, opts ...ResourceOption) (*ApplicationDetectionRuleV2, error)
    public static ApplicationDetectionRuleV2 Get(string name, Input<string> id, ApplicationDetectionRuleV2State? state, CustomResourceOptions? opts = null)
    public static ApplicationDetectionRuleV2 get(String name, Output<String> id, ApplicationDetectionRuleV2State state, CustomResourceOptions options)
    resources:  _:    type: dynatrace:ApplicationDetectionRuleV2    get:      id: ${id}
    import {
      to = dynatrace_applicationdetectionrulev2.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApplicationId string
    Select an existing application or create a new one.
    Description string
    Add a description for your rule
    InsertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    Matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    Pattern string
    Pattern
    ApplicationId string
    Select an existing application or create a new one.
    Description string
    Add a description for your rule
    InsertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    Matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    Pattern string
    Pattern
    application_id string
    Select an existing application or create a new one.
    description string
    Add a description for your rule
    insert_after string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern string
    Pattern
    applicationId String
    Select an existing application or create a new one.
    description String
    Add a description for your rule
    insertAfter String
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    matcher String
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern String
    Pattern
    applicationId string
    Select an existing application or create a new one.
    description string
    Add a description for your rule
    insertAfter string
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    matcher string
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern string
    Pattern
    application_id str
    Select an existing application or create a new one.
    description str
    Add a description for your rule
    insert_after str
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    matcher str
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern str
    Pattern
    applicationId String
    Select an existing application or create a new one.
    description String
    Add a description for your rule
    insertAfter String
    Because this resource allows for ordering you may specify the ID of the resource instance that comes before this instance regarding order. If not specified when creating the setting will be added to the end of the list. If not specified during update the order will remain untouched
    matcher String
    Matcher. Possible values: DOMAIN_CONTAINS, DOMAIN_ENDS_WITH, DOMAIN_EQUALS, DOMAIN_MATCHES, DOMAIN_STARTS_WITH, URL_CONTAINS, URL_ENDS_WITH, URL_EQUALS, URL_STARTS_WITH
    pattern String
    Pattern

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Viewing docs for Dynatrace v0.36.0
    published on Tuesday, Jun 9, 2026 by Pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial