1. Packages
  2. Packages
  3. Dynatrace
  4. API Docs
  5. WebAppCustomInjection
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 requires the API token scopes Read settings (settings.read) and Write settings (settings.write)

    Dynatrace Documentation

    • Web applications - https://docs.dynatrace.com/docs/platform-modules/digital-experience/web-applications

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

    Export Example Usage

    • terraform-provider-dynatrace -export dynatrace.WebAppCustomInjection downloads existing custom injection rules

    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 APPLICATION_1234567890000000 = new dynatrace.WebAppCustomInjection("APPLICATION-1234567890000000", {
        enabled: false,
        applicationId: "APPLICATION-1234567890000000",
        operator: "Starts",
        urlPattern: "/terraform",
        rule: "AfterSpecificHtml",
        htmlPattern: "example",
    });
    
    import pulumi
    import pulumiverse_dynatrace as dynatrace
    
    applicatio_n_1234567890000000 = dynatrace.WebAppCustomInjection("APPLICATION-1234567890000000",
        enabled=False,
        application_id="APPLICATION-1234567890000000",
        operator="Starts",
        url_pattern="/terraform",
        rule="AfterSpecificHtml",
        html_pattern="example")
    
    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 {
    		_, err := dynatrace.NewWebAppCustomInjection(ctx, "APPLICATION-1234567890000000", &dynatrace.WebAppCustomInjectionArgs{
    			Enabled:       pulumi.Bool(false),
    			ApplicationId: pulumi.String("APPLICATION-1234567890000000"),
    			Operator:      pulumi.String("Starts"),
    			UrlPattern:    pulumi.String("/terraform"),
    			Rule:          pulumi.String("AfterSpecificHtml"),
    			HtmlPattern:   pulumi.String("example"),
    		})
    		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 APPLICATION_1234567890000000 = new Dynatrace.WebAppCustomInjection("APPLICATION-1234567890000000", new()
        {
            Enabled = false,
            ApplicationId = "APPLICATION-1234567890000000",
            Operator = "Starts",
            UrlPattern = "/terraform",
            Rule = "AfterSpecificHtml",
            HtmlPattern = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.WebAppCustomInjection;
    import com.pulumi.dynatrace.WebAppCustomInjectionArgs;
    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) {
            var aPPLICATION_1234567890000000 = new WebAppCustomInjection("APPLICATION-1234567890000000", WebAppCustomInjectionArgs.builder()
                .enabled(false)
                .applicationId("APPLICATION-1234567890000000")
                .operator("Starts")
                .urlPattern("/terraform")
                .rule("AfterSpecificHtml")
                .htmlPattern("example")
                .build());
    
        }
    }
    
    resources:
      APPLICATION-1234567890000000:
        type: dynatrace:WebAppCustomInjection
        properties:
          enabled: false
          applicationId: APPLICATION-1234567890000000
          operator: Starts
          urlPattern: /terraform
          rule: AfterSpecificHtml
          htmlPattern: example
    
    pulumi {
      required_providers {
        dynatrace = {
          source = "pulumi/dynatrace"
        }
      }
    }
    
    resource "dynatrace_webappcustominjection" "APPLICATION-1234567890000000" {
      enabled        = false
      application_id = "APPLICATION-1234567890000000"
      operator       = "Starts"
      url_pattern    = "/terraform"
      rule           = "AfterSpecificHtml"
      html_pattern   = "example"
    }
    

    Create WebAppCustomInjection Resource

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

    Constructor syntax

    new WebAppCustomInjection(name: string, args: WebAppCustomInjectionArgs, opts?: CustomResourceOptions);
    @overload
    def WebAppCustomInjection(resource_name: str,
                              args: WebAppCustomInjectionArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def WebAppCustomInjection(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              application_id: Optional[str] = None,
                              enabled: Optional[bool] = None,
                              operator: Optional[str] = None,
                              rule: Optional[str] = None,
                              html_pattern: Optional[str] = None,
                              insert_after: Optional[str] = None,
                              url_pattern: Optional[str] = None)
    func NewWebAppCustomInjection(ctx *Context, name string, args WebAppCustomInjectionArgs, opts ...ResourceOption) (*WebAppCustomInjection, error)
    public WebAppCustomInjection(string name, WebAppCustomInjectionArgs args, CustomResourceOptions? opts = null)
    public WebAppCustomInjection(String name, WebAppCustomInjectionArgs args)
    public WebAppCustomInjection(String name, WebAppCustomInjectionArgs args, CustomResourceOptions options)
    
    type: dynatrace:WebAppCustomInjection
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "dynatrace_webappcustominjection" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args WebAppCustomInjectionArgs
    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 WebAppCustomInjectionArgs
    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 WebAppCustomInjectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WebAppCustomInjectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WebAppCustomInjectionArgs
    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 webAppCustomInjectionResource = new Dynatrace.WebAppCustomInjection("webAppCustomInjectionResource", new()
    {
        ApplicationId = "string",
        Enabled = false,
        Operator = "string",
        Rule = "string",
        HtmlPattern = "string",
        InsertAfter = "string",
        UrlPattern = "string",
    });
    
    example, err := dynatrace.NewWebAppCustomInjection(ctx, "webAppCustomInjectionResource", &dynatrace.WebAppCustomInjectionArgs{
    	ApplicationId: pulumi.String("string"),
    	Enabled:       pulumi.Bool(false),
    	Operator:      pulumi.String("string"),
    	Rule:          pulumi.String("string"),
    	HtmlPattern:   pulumi.String("string"),
    	InsertAfter:   pulumi.String("string"),
    	UrlPattern:    pulumi.String("string"),
    })
    
    resource "dynatrace_webappcustominjection" "webAppCustomInjectionResource" {
      application_id = "string"
      enabled        = false
      operator       = "string"
      rule           = "string"
      html_pattern   = "string"
      insert_after   = "string"
      url_pattern    = "string"
    }
    
    var webAppCustomInjectionResource = new WebAppCustomInjection("webAppCustomInjectionResource", WebAppCustomInjectionArgs.builder()
        .applicationId("string")
        .enabled(false)
        .operator("string")
        .rule("string")
        .htmlPattern("string")
        .insertAfter("string")
        .urlPattern("string")
        .build());
    
    web_app_custom_injection_resource = dynatrace.WebAppCustomInjection("webAppCustomInjectionResource",
        application_id="string",
        enabled=False,
        operator="string",
        rule="string",
        html_pattern="string",
        insert_after="string",
        url_pattern="string")
    
    const webAppCustomInjectionResource = new dynatrace.WebAppCustomInjection("webAppCustomInjectionResource", {
        applicationId: "string",
        enabled: false,
        operator: "string",
        rule: "string",
        htmlPattern: "string",
        insertAfter: "string",
        urlPattern: "string",
    });
    
    type: dynatrace:WebAppCustomInjection
    properties:
        applicationId: string
        enabled: false
        htmlPattern: string
        insertAfter: string
        operator: string
        rule: string
        urlPattern: string
    

    WebAppCustomInjection 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 WebAppCustomInjection resource accepts the following input properties:

    ApplicationId string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    Enabled bool
    This setting is enabled (true) or disabled (false)
    Operator string
    Example:
    Rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    HtmlPattern string
    No documentation available
    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
    UrlPattern string
    URL pattern
    ApplicationId string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    Enabled bool
    This setting is enabled (true) or disabled (false)
    Operator string
    Example:
    Rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    HtmlPattern string
    No documentation available
    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
    UrlPattern string
    URL pattern
    application_id string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled bool
    This setting is enabled (true) or disabled (false)
    operator string
    Example:
    rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    html_pattern string
    No documentation available
    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
    url_pattern string
    URL pattern
    applicationId String
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled Boolean
    This setting is enabled (true) or disabled (false)
    operator String
    Example:
    rule String
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    htmlPattern String
    No documentation available
    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
    urlPattern String
    URL pattern
    applicationId string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled boolean
    This setting is enabled (true) or disabled (false)
    operator string
    Example:
    rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    htmlPattern string
    No documentation available
    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
    urlPattern string
    URL pattern
    application_id str
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled bool
    This setting is enabled (true) or disabled (false)
    operator str
    Example:
    rule str
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    html_pattern str
    No documentation available
    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
    url_pattern str
    URL pattern
    applicationId String
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled Boolean
    This setting is enabled (true) or disabled (false)
    operator String
    Example:
    rule String
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    htmlPattern String
    No documentation available
    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
    urlPattern String
    URL pattern

    Outputs

    All input properties are implicitly available as output properties. Additionally, the WebAppCustomInjection 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 WebAppCustomInjection Resource

    Get an existing WebAppCustomInjection 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?: WebAppCustomInjectionState, opts?: CustomResourceOptions): WebAppCustomInjection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_id: Optional[str] = None,
            enabled: Optional[bool] = None,
            html_pattern: Optional[str] = None,
            insert_after: Optional[str] = None,
            operator: Optional[str] = None,
            rule: Optional[str] = None,
            url_pattern: Optional[str] = None) -> WebAppCustomInjection
    func GetWebAppCustomInjection(ctx *Context, name string, id IDInput, state *WebAppCustomInjectionState, opts ...ResourceOption) (*WebAppCustomInjection, error)
    public static WebAppCustomInjection Get(string name, Input<string> id, WebAppCustomInjectionState? state, CustomResourceOptions? opts = null)
    public static WebAppCustomInjection get(String name, Output<String> id, WebAppCustomInjectionState state, CustomResourceOptions options)
    resources:  _:    type: dynatrace:WebAppCustomInjection    get:      id: ${id}
    import {
      to = dynatrace_webappcustominjection.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
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    Enabled bool
    This setting is enabled (true) or disabled (false)
    HtmlPattern string
    No documentation available
    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
    Operator string
    Example:
    Rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    UrlPattern string
    URL pattern
    ApplicationId string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    Enabled bool
    This setting is enabled (true) or disabled (false)
    HtmlPattern string
    No documentation available
    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
    Operator string
    Example:
    Rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    UrlPattern string
    URL pattern
    application_id string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled bool
    This setting is enabled (true) or disabled (false)
    html_pattern string
    No documentation available
    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
    operator string
    Example:
    rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    url_pattern string
    URL pattern
    applicationId String
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled Boolean
    This setting is enabled (true) or disabled (false)
    htmlPattern String
    No documentation available
    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
    operator String
    Example:
    rule String
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    urlPattern String
    URL pattern
    applicationId string
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled boolean
    This setting is enabled (true) or disabled (false)
    htmlPattern string
    No documentation available
    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
    operator string
    Example:
    rule string
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    urlPattern string
    URL pattern
    application_id str
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled bool
    This setting is enabled (true) or disabled (false)
    html_pattern str
    No documentation available
    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
    operator str
    Example:
    rule str
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    url_pattern str
    URL pattern
    applicationId String
    The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
    enabled Boolean
    This setting is enabled (true) or disabled (false)
    htmlPattern String
    No documentation available
    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
    operator String
    Example:
    rule String
    Rule. Possible values: AfterSpecificHtml, Automatic, BeforeSpecificHtml, DoNotInject
    urlPattern String
    URL 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