1. Packages
  2. Packages
  3. Datadog Provider
  4. API Docs
  5. TagIndexingRuleOrder
Viewing docs for Datadog v5.6.0
published on Thursday, Jun 18, 2026 by Pulumi
datadog logo
Viewing docs for Datadog v5.6.0
published on Thursday, Jun 18, 2026 by Pulumi

    Provides a Datadog Tag Indexing Rule Order resource. Manages the evaluation order of tag indexing rules for an org. Only one instance of this resource should exist per org; the name field is a user-chosen identifier with no server-side equivalent.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const broad = new datadog.TagIndexingRule("broad", {
        name: "Broad rule applied first",
        metricNameMatches: ["*"],
        tags: [
            "env",
            "service",
        ],
        excludeTagsMode: false,
    });
    const specific = new datadog.TagIndexingRule("specific", {
        name: "Specific override for web metrics",
        metricNameMatches: ["web.*"],
        tags: [
            "env",
            "service",
            "version",
            "host",
        ],
        excludeTagsMode: false,
    });
    // Enforce evaluation order: broad rule first, then specific override.
    const example = new datadog.TagIndexingRuleOrder("example", {
        name: "main",
        ruleIds: [
            broad.id,
            specific.id,
        ],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    broad = datadog.TagIndexingRule("broad",
        name="Broad rule applied first",
        metric_name_matches=["*"],
        tags=[
            "env",
            "service",
        ],
        exclude_tags_mode=False)
    specific = datadog.TagIndexingRule("specific",
        name="Specific override for web metrics",
        metric_name_matches=["web.*"],
        tags=[
            "env",
            "service",
            "version",
            "host",
        ],
        exclude_tags_mode=False)
    # Enforce evaluation order: broad rule first, then specific override.
    example = datadog.TagIndexingRuleOrder("example",
        name="main",
        rule_ids=[
            broad.id,
            specific.id,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v5/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		broad, err := datadog.NewTagIndexingRule(ctx, "broad", &datadog.TagIndexingRuleArgs{
    			Name: pulumi.String("Broad rule applied first"),
    			MetricNameMatches: pulumi.StringArray{
    				pulumi.String("*"),
    			},
    			Tags: pulumi.StringArray{
    				pulumi.String("env"),
    				pulumi.String("service"),
    			},
    			ExcludeTagsMode: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		specific, err := datadog.NewTagIndexingRule(ctx, "specific", &datadog.TagIndexingRuleArgs{
    			Name: pulumi.String("Specific override for web metrics"),
    			MetricNameMatches: pulumi.StringArray{
    				pulumi.String("web.*"),
    			},
    			Tags: pulumi.StringArray{
    				pulumi.String("env"),
    				pulumi.String("service"),
    				pulumi.String("version"),
    				pulumi.String("host"),
    			},
    			ExcludeTagsMode: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		// Enforce evaluation order: broad rule first, then specific override.
    		_, err = datadog.NewTagIndexingRuleOrder(ctx, "example", &datadog.TagIndexingRuleOrderArgs{
    			Name: pulumi.String("main"),
    			RuleIds: pulumi.StringArray{
    				broad.ID(),
    				specific.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var broad = new Datadog.TagIndexingRule("broad", new()
        {
            Name = "Broad rule applied first",
            MetricNameMatches = new[]
            {
                "*",
            },
            Tags = new[]
            {
                "env",
                "service",
            },
            ExcludeTagsMode = false,
        });
    
        var specific = new Datadog.TagIndexingRule("specific", new()
        {
            Name = "Specific override for web metrics",
            MetricNameMatches = new[]
            {
                "web.*",
            },
            Tags = new[]
            {
                "env",
                "service",
                "version",
                "host",
            },
            ExcludeTagsMode = false,
        });
    
        // Enforce evaluation order: broad rule first, then specific override.
        var example = new Datadog.TagIndexingRuleOrder("example", new()
        {
            Name = "main",
            RuleIds = new[]
            {
                broad.Id,
                specific.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.TagIndexingRule;
    import com.pulumi.datadog.TagIndexingRuleArgs;
    import com.pulumi.datadog.TagIndexingRuleOrder;
    import com.pulumi.datadog.TagIndexingRuleOrderArgs;
    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 broad = new TagIndexingRule("broad", TagIndexingRuleArgs.builder()
                .name("Broad rule applied first")
                .metricNameMatches("*")
                .tags(            
                    "env",
                    "service")
                .excludeTagsMode(false)
                .build());
    
            var specific = new TagIndexingRule("specific", TagIndexingRuleArgs.builder()
                .name("Specific override for web metrics")
                .metricNameMatches("web.*")
                .tags(            
                    "env",
                    "service",
                    "version",
                    "host")
                .excludeTagsMode(false)
                .build());
    
            // Enforce evaluation order: broad rule first, then specific override.
            var example = new TagIndexingRuleOrder("example", TagIndexingRuleOrderArgs.builder()
                .name("main")
                .ruleIds(            
                    broad.id(),
                    specific.id())
                .build());
    
        }
    }
    
    resources:
      broad:
        type: datadog:TagIndexingRule
        properties:
          name: Broad rule applied first
          metricNameMatches:
            - '*'
          tags:
            - env
            - service
          excludeTagsMode: false
      specific:
        type: datadog:TagIndexingRule
        properties:
          name: Specific override for web metrics
          metricNameMatches:
            - web.*
          tags:
            - env
            - service
            - version
            - host
          excludeTagsMode: false
      # Enforce evaluation order: broad rule first, then specific override.
      example:
        type: datadog:TagIndexingRuleOrder
        properties:
          name: main
          ruleIds:
            - ${broad.id}
            - ${specific.id}
    
    pulumi {
      required_providers {
        datadog = {
          source = "pulumi/datadog"
        }
      }
    }
    
    resource "datadog_tagindexingrule" "broad" {
      name                = "Broad rule applied first"
      metric_name_matches = ["*"]
      tags                = ["env", "service"]
      exclude_tags_mode   = false
    }
    resource "datadog_tagindexingrule" "specific" {
      name                = "Specific override for web metrics"
      metric_name_matches = ["web.*"]
      tags                = ["env", "service", "version", "host"]
      exclude_tags_mode   = false
    }
    # Enforce evaluation order: broad rule first, then specific override.
    resource "datadog_tagindexingruleorder" "example" {
      name     = "main"
      rule_ids = [datadog_tagindexingrule.broad.id, datadog_tagindexingrule.specific.id]
    }
    

    Create TagIndexingRuleOrder Resource

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

    Constructor syntax

    new TagIndexingRuleOrder(name: string, args: TagIndexingRuleOrderArgs, opts?: CustomResourceOptions);
    @overload
    def TagIndexingRuleOrder(resource_name: str,
                             args: TagIndexingRuleOrderArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def TagIndexingRuleOrder(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             name: Optional[str] = None,
                             rule_ids: Optional[Sequence[str]] = None)
    func NewTagIndexingRuleOrder(ctx *Context, name string, args TagIndexingRuleOrderArgs, opts ...ResourceOption) (*TagIndexingRuleOrder, error)
    public TagIndexingRuleOrder(string name, TagIndexingRuleOrderArgs args, CustomResourceOptions? opts = null)
    public TagIndexingRuleOrder(String name, TagIndexingRuleOrderArgs args)
    public TagIndexingRuleOrder(String name, TagIndexingRuleOrderArgs args, CustomResourceOptions options)
    
    type: datadog:TagIndexingRuleOrder
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "datadog_tagindexingruleorder" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TagIndexingRuleOrderArgs
    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 TagIndexingRuleOrderArgs
    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 TagIndexingRuleOrderArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TagIndexingRuleOrderArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TagIndexingRuleOrderArgs
    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 tagIndexingRuleOrderResource = new Datadog.TagIndexingRuleOrder("tagIndexingRuleOrderResource", new()
    {
        Name = "string",
        RuleIds = new[]
        {
            "string",
        },
    });
    
    example, err := datadog.NewTagIndexingRuleOrder(ctx, "tagIndexingRuleOrderResource", &datadog.TagIndexingRuleOrderArgs{
    	Name: pulumi.String("string"),
    	RuleIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    resource "datadog_tagindexingruleorder" "tagIndexingRuleOrderResource" {
      name     = "string"
      rule_ids = ["string"]
    }
    
    var tagIndexingRuleOrderResource = new TagIndexingRuleOrder("tagIndexingRuleOrderResource", TagIndexingRuleOrderArgs.builder()
        .name("string")
        .ruleIds("string")
        .build());
    
    tag_indexing_rule_order_resource = datadog.TagIndexingRuleOrder("tagIndexingRuleOrderResource",
        name="string",
        rule_ids=["string"])
    
    const tagIndexingRuleOrderResource = new datadog.TagIndexingRuleOrder("tagIndexingRuleOrderResource", {
        name: "string",
        ruleIds: ["string"],
    });
    
    type: datadog:TagIndexingRuleOrder
    properties:
        name: string
        ruleIds:
            - string
    

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

    Name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    RuleIds List<string>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    Name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    RuleIds []string
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    rule_ids list(string)
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name String
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds List<String>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds string[]
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name str
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    rule_ids Sequence[str]
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name String
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds List<String>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.

    Outputs

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

    Get an existing TagIndexingRuleOrder 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?: TagIndexingRuleOrderState, opts?: CustomResourceOptions): TagIndexingRuleOrder
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            rule_ids: Optional[Sequence[str]] = None) -> TagIndexingRuleOrder
    func GetTagIndexingRuleOrder(ctx *Context, name string, id IDInput, state *TagIndexingRuleOrderState, opts ...ResourceOption) (*TagIndexingRuleOrder, error)
    public static TagIndexingRuleOrder Get(string name, Input<string> id, TagIndexingRuleOrderState? state, CustomResourceOptions? opts = null)
    public static TagIndexingRuleOrder get(String name, Output<String> id, TagIndexingRuleOrderState state, CustomResourceOptions options)
    resources:  _:    type: datadog:TagIndexingRuleOrder    get:      id: ${id}
    import {
      to = datadog_tagindexingruleorder.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:
    Name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    RuleIds List<string>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    Name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    RuleIds []string
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    rule_ids list(string)
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name String
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds List<String>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name string
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds string[]
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name str
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    rule_ids Sequence[str]
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.
    name String
    A unique name for the order resource. Recommended to match the resource name. No corresponding field exists in the API.
    ruleIds List<String>
    Ordered list of ALL tag indexing rule UUIDs. The server assigns each rule a ruleOrder value (1, 2, 3, ...) corresponding to its position in this list. This resource claims full ownership of evaluation order: rules created outside Terraform (e.g. via the UI) will appear as configuration drift on the next plan. All rules must be listed here; omitting a rule ID will result in a 404 error from the API.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Viewing docs for Datadog v5.6.0
    published on Thursday, Jun 18, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial