1. Packages
  2. Datadog Provider
  3. API Docs
  4. CustomAllocationRules
Viewing docs for Datadog v4.68.0
published on Wednesday, Feb 25, 2026 by Pulumi
datadog logo
Viewing docs for Datadog v4.68.0
published on Wednesday, Feb 25, 2026 by Pulumi

    Provides a Datadog Custom Allocation Rule Order API resource. This can be used to manage the order of Datadog Custom Allocation Rules.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const rule1 = new datadog.CustomAllocationRule("rule_1", {
        costsToAllocates: [{
            condition: "is",
            tag: "aws_product",
            value: "AmazonEC2",
        }],
        enabled: true,
        providernames: ["aws"],
        ruleName: "my-custom-rule-1",
        strategy: [{
            allocatedByTagKeys: ["team"],
            basedOnCosts: [{
                condition: "is",
                tag: "aws_product",
                value: "AmazonEC2",
            }],
            method: "even",
        }],
    });
    const rule2 = new datadog.CustomAllocationRule("rule_2", {
        costsToAllocates: [{
            condition: "is",
            tag: "aws_product",
            value: "AmazonS3",
        }],
        enabled: true,
        providernames: ["aws"],
        ruleName: "my-custom-rule-2",
        strategy: [{
            allocatedByTagKeys: ["team"],
            basedOnCosts: [{
                condition: "is",
                tag: "aws_product",
                value: "AmazonS3",
            }],
            method: "even",
        }],
    });
    const rule3 = new datadog.CustomAllocationRule("rule_3", {
        costsToAllocates: [{
            condition: "is",
            tag: "aws_product",
            value: "AmazonRDS",
        }],
        enabled: true,
        providernames: ["aws"],
        ruleName: "my-custom-rule-3",
        strategy: [{
            allocatedByTagKeys: ["team"],
            basedOnCosts: [{
                condition: "is",
                tag: "aws_product",
                value: "AmazonRDS",
            }],
            method: "even",
        }],
    });
    // Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
    // This will preserve any existing rules created outside of Terraform as long as they are at the end
    const preserveOrder = new datadog.CustomAllocationRules("preserve_order", {ruleIds: [
        rule1.id,
        rule2.id,
        rule3.id,
    ]});
    // Example 2: Override mode - deletes all unmanaged rules and maintains strict order
    // This will delete any rules not defined in Terraform and enforce the exact order specified
    const overrideOrder = new datadog.CustomAllocationRules("override_order", {
        overrideUiDefinedResources: true,
        ruleIds: [
            rule1.id,
            rule2.id,
            rule3.id,
        ],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    rule1 = datadog.CustomAllocationRule("rule_1",
        costs_to_allocates=[{
            "condition": "is",
            "tag": "aws_product",
            "value": "AmazonEC2",
        }],
        enabled=True,
        providernames=["aws"],
        rule_name="my-custom-rule-1",
        strategy=[{
            "allocatedByTagKeys": ["team"],
            "basedOnCosts": [{
                "condition": "is",
                "tag": "aws_product",
                "value": "AmazonEC2",
            }],
            "method": "even",
        }])
    rule2 = datadog.CustomAllocationRule("rule_2",
        costs_to_allocates=[{
            "condition": "is",
            "tag": "aws_product",
            "value": "AmazonS3",
        }],
        enabled=True,
        providernames=["aws"],
        rule_name="my-custom-rule-2",
        strategy=[{
            "allocatedByTagKeys": ["team"],
            "basedOnCosts": [{
                "condition": "is",
                "tag": "aws_product",
                "value": "AmazonS3",
            }],
            "method": "even",
        }])
    rule3 = datadog.CustomAllocationRule("rule_3",
        costs_to_allocates=[{
            "condition": "is",
            "tag": "aws_product",
            "value": "AmazonRDS",
        }],
        enabled=True,
        providernames=["aws"],
        rule_name="my-custom-rule-3",
        strategy=[{
            "allocatedByTagKeys": ["team"],
            "basedOnCosts": [{
                "condition": "is",
                "tag": "aws_product",
                "value": "AmazonRDS",
            }],
            "method": "even",
        }])
    # Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
    # This will preserve any existing rules created outside of Terraform as long as they are at the end
    preserve_order = datadog.CustomAllocationRules("preserve_order", rule_ids=[
        rule1.id,
        rule2.id,
        rule3.id,
    ])
    # Example 2: Override mode - deletes all unmanaged rules and maintains strict order
    # This will delete any rules not defined in Terraform and enforce the exact order specified
    override_order = datadog.CustomAllocationRules("override_order",
        override_ui_defined_resources=True,
        rule_ids=[
            rule1.id,
            rule2.id,
            rule3.id,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		rule1, err := datadog.NewCustomAllocationRule(ctx, "rule_1", &datadog.CustomAllocationRuleArgs{
    			CostsToAllocates: datadog.CustomAllocationRuleCostsToAllocateArray{
    				&datadog.CustomAllocationRuleCostsToAllocateArgs{
    					Condition: pulumi.String("is"),
    					Tag:       pulumi.String("aws_product"),
    					Value:     pulumi.String("AmazonEC2"),
    				},
    			},
    			Enabled: pulumi.Bool(true),
    			Providernames: pulumi.StringArray{
    				pulumi.String("aws"),
    			},
    			RuleName: pulumi.String("my-custom-rule-1"),
    			Strategy: datadog.CustomAllocationRuleStrategyArgs{
    				map[string]interface{}{
    					"allocatedByTagKeys": []string{
    						"team",
    					},
    					"basedOnCosts": []map[string]interface{}{
    						map[string]interface{}{
    							"condition": "is",
    							"tag":       "aws_product",
    							"value":     "AmazonEC2",
    						},
    					},
    					"method": "even",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		rule2, err := datadog.NewCustomAllocationRule(ctx, "rule_2", &datadog.CustomAllocationRuleArgs{
    			CostsToAllocates: datadog.CustomAllocationRuleCostsToAllocateArray{
    				&datadog.CustomAllocationRuleCostsToAllocateArgs{
    					Condition: pulumi.String("is"),
    					Tag:       pulumi.String("aws_product"),
    					Value:     pulumi.String("AmazonS3"),
    				},
    			},
    			Enabled: pulumi.Bool(true),
    			Providernames: pulumi.StringArray{
    				pulumi.String("aws"),
    			},
    			RuleName: pulumi.String("my-custom-rule-2"),
    			Strategy: datadog.CustomAllocationRuleStrategyArgs{
    				map[string]interface{}{
    					"allocatedByTagKeys": []string{
    						"team",
    					},
    					"basedOnCosts": []map[string]interface{}{
    						map[string]interface{}{
    							"condition": "is",
    							"tag":       "aws_product",
    							"value":     "AmazonS3",
    						},
    					},
    					"method": "even",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		rule3, err := datadog.NewCustomAllocationRule(ctx, "rule_3", &datadog.CustomAllocationRuleArgs{
    			CostsToAllocates: datadog.CustomAllocationRuleCostsToAllocateArray{
    				&datadog.CustomAllocationRuleCostsToAllocateArgs{
    					Condition: pulumi.String("is"),
    					Tag:       pulumi.String("aws_product"),
    					Value:     pulumi.String("AmazonRDS"),
    				},
    			},
    			Enabled: pulumi.Bool(true),
    			Providernames: pulumi.StringArray{
    				pulumi.String("aws"),
    			},
    			RuleName: pulumi.String("my-custom-rule-3"),
    			Strategy: datadog.CustomAllocationRuleStrategyArgs{
    				map[string]interface{}{
    					"allocatedByTagKeys": []string{
    						"team",
    					},
    					"basedOnCosts": []map[string]interface{}{
    						map[string]interface{}{
    							"condition": "is",
    							"tag":       "aws_product",
    							"value":     "AmazonRDS",
    						},
    					},
    					"method": "even",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
    		// This will preserve any existing rules created outside of Terraform as long as they are at the end
    		_, err = datadog.NewCustomAllocationRules(ctx, "preserve_order", &datadog.CustomAllocationRulesArgs{
    			RuleIds: pulumi.StringArray{
    				rule1.ID(),
    				rule2.ID(),
    				rule3.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Example 2: Override mode - deletes all unmanaged rules and maintains strict order
    		// This will delete any rules not defined in Terraform and enforce the exact order specified
    		_, err = datadog.NewCustomAllocationRules(ctx, "override_order", &datadog.CustomAllocationRulesArgs{
    			OverrideUiDefinedResources: pulumi.Bool(true),
    			RuleIds: pulumi.StringArray{
    				rule1.ID(),
    				rule2.ID(),
    				rule3.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 rule1 = new Datadog.CustomAllocationRule("rule_1", new()
        {
            CostsToAllocates = new[]
            {
                new Datadog.Inputs.CustomAllocationRuleCostsToAllocateArgs
                {
                    Condition = "is",
                    Tag = "aws_product",
                    Value = "AmazonEC2",
                },
            },
            Enabled = true,
            Providernames = new[]
            {
                "aws",
            },
            RuleName = "my-custom-rule-1",
            Strategy = new[]
            {
                
                {
                    { "allocatedByTagKeys", new[]
                    {
                        "team",
                    } },
                    { "basedOnCosts", new[]
                    {
                        
                        {
                            { "condition", "is" },
                            { "tag", "aws_product" },
                            { "value", "AmazonEC2" },
                        },
                    } },
                    { "method", "even" },
                },
            },
        });
    
        var rule2 = new Datadog.CustomAllocationRule("rule_2", new()
        {
            CostsToAllocates = new[]
            {
                new Datadog.Inputs.CustomAllocationRuleCostsToAllocateArgs
                {
                    Condition = "is",
                    Tag = "aws_product",
                    Value = "AmazonS3",
                },
            },
            Enabled = true,
            Providernames = new[]
            {
                "aws",
            },
            RuleName = "my-custom-rule-2",
            Strategy = new[]
            {
                
                {
                    { "allocatedByTagKeys", new[]
                    {
                        "team",
                    } },
                    { "basedOnCosts", new[]
                    {
                        
                        {
                            { "condition", "is" },
                            { "tag", "aws_product" },
                            { "value", "AmazonS3" },
                        },
                    } },
                    { "method", "even" },
                },
            },
        });
    
        var rule3 = new Datadog.CustomAllocationRule("rule_3", new()
        {
            CostsToAllocates = new[]
            {
                new Datadog.Inputs.CustomAllocationRuleCostsToAllocateArgs
                {
                    Condition = "is",
                    Tag = "aws_product",
                    Value = "AmazonRDS",
                },
            },
            Enabled = true,
            Providernames = new[]
            {
                "aws",
            },
            RuleName = "my-custom-rule-3",
            Strategy = new[]
            {
                
                {
                    { "allocatedByTagKeys", new[]
                    {
                        "team",
                    } },
                    { "basedOnCosts", new[]
                    {
                        
                        {
                            { "condition", "is" },
                            { "tag", "aws_product" },
                            { "value", "AmazonRDS" },
                        },
                    } },
                    { "method", "even" },
                },
            },
        });
    
        // Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
        // This will preserve any existing rules created outside of Terraform as long as they are at the end
        var preserveOrder = new Datadog.CustomAllocationRules("preserve_order", new()
        {
            RuleIds = new[]
            {
                rule1.Id,
                rule2.Id,
                rule3.Id,
            },
        });
    
        // Example 2: Override mode - deletes all unmanaged rules and maintains strict order
        // This will delete any rules not defined in Terraform and enforce the exact order specified
        var overrideOrder = new Datadog.CustomAllocationRules("override_order", new()
        {
            OverrideUiDefinedResources = true,
            RuleIds = new[]
            {
                rule1.Id,
                rule2.Id,
                rule3.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.CustomAllocationRule;
    import com.pulumi.datadog.CustomAllocationRuleArgs;
    import com.pulumi.datadog.inputs.CustomAllocationRuleCostsToAllocateArgs;
    import com.pulumi.datadog.CustomAllocationRules;
    import com.pulumi.datadog.CustomAllocationRulesArgs;
    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) {
            var rule1 = new CustomAllocationRule("rule1", CustomAllocationRuleArgs.builder()
                .costsToAllocates(CustomAllocationRuleCostsToAllocateArgs.builder()
                    .condition("is")
                    .tag("aws_product")
                    .value("AmazonEC2")
                    .build())
                .enabled(true)
                .providernames("aws")
                .ruleName("my-custom-rule-1")
                .strategy(CustomAllocationRuleStrategyArgs.builder()
                    .allocatedByTagKeys("team")
                    .basedOnCosts(CustomAllocationRuleStrategyBasedOnCostArgs.builder()
                        .condition("is")
                        .tag("aws_product")
                        .value("AmazonEC2")
                        .build())
                    .method("even")
                    .build())
                .build());
    
            var rule2 = new CustomAllocationRule("rule2", CustomAllocationRuleArgs.builder()
                .costsToAllocates(CustomAllocationRuleCostsToAllocateArgs.builder()
                    .condition("is")
                    .tag("aws_product")
                    .value("AmazonS3")
                    .build())
                .enabled(true)
                .providernames("aws")
                .ruleName("my-custom-rule-2")
                .strategy(CustomAllocationRuleStrategyArgs.builder()
                    .allocatedByTagKeys("team")
                    .basedOnCosts(CustomAllocationRuleStrategyBasedOnCostArgs.builder()
                        .condition("is")
                        .tag("aws_product")
                        .value("AmazonS3")
                        .build())
                    .method("even")
                    .build())
                .build());
    
            var rule3 = new CustomAllocationRule("rule3", CustomAllocationRuleArgs.builder()
                .costsToAllocates(CustomAllocationRuleCostsToAllocateArgs.builder()
                    .condition("is")
                    .tag("aws_product")
                    .value("AmazonRDS")
                    .build())
                .enabled(true)
                .providernames("aws")
                .ruleName("my-custom-rule-3")
                .strategy(CustomAllocationRuleStrategyArgs.builder()
                    .allocatedByTagKeys("team")
                    .basedOnCosts(CustomAllocationRuleStrategyBasedOnCostArgs.builder()
                        .condition("is")
                        .tag("aws_product")
                        .value("AmazonRDS")
                        .build())
                    .method("even")
                    .build())
                .build());
    
            // Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
            // This will preserve any existing rules created outside of Terraform as long as they are at the end
            var preserveOrder = new CustomAllocationRules("preserveOrder", CustomAllocationRulesArgs.builder()
                .ruleIds(            
                    rule1.id(),
                    rule2.id(),
                    rule3.id())
                .build());
    
            // Example 2: Override mode - deletes all unmanaged rules and maintains strict order
            // This will delete any rules not defined in Terraform and enforce the exact order specified
            var overrideOrder = new CustomAllocationRules("overrideOrder", CustomAllocationRulesArgs.builder()
                .overrideUiDefinedResources(true)
                .ruleIds(            
                    rule1.id(),
                    rule2.id(),
                    rule3.id())
                .build());
    
        }
    }
    
    resources:
      rule1:
        type: datadog:CustomAllocationRule
        name: rule_1
        properties:
          costsToAllocates:
            - condition: is
              tag: aws_product
              value: AmazonEC2
          enabled: true
          providernames:
            - aws
          ruleName: my-custom-rule-1
          strategy:
            - allocatedByTagKeys:
                - team
              basedOnCosts:
                - condition: is
                  tag: aws_product
                  value: AmazonEC2
              method: even
      rule2:
        type: datadog:CustomAllocationRule
        name: rule_2
        properties:
          costsToAllocates:
            - condition: is
              tag: aws_product
              value: AmazonS3
          enabled: true
          providernames:
            - aws
          ruleName: my-custom-rule-2
          strategy:
            - allocatedByTagKeys:
                - team
              basedOnCosts:
                - condition: is
                  tag: aws_product
                  value: AmazonS3
              method: even
      rule3:
        type: datadog:CustomAllocationRule
        name: rule_3
        properties:
          costsToAllocates:
            - condition: is
              tag: aws_product
              value: AmazonRDS
          enabled: true
          providernames:
            - aws
          ruleName: my-custom-rule-3
          strategy:
            - allocatedByTagKeys:
                - team
              basedOnCosts:
                - condition: is
                  tag: aws_product
                  value: AmazonRDS
              method: even
      # Example 1: Preserve mode (default) - allows unmanaged rules to exist at the end
      # This will preserve any existing rules created outside of Terraform as long as they are at the end
      preserveOrder:
        type: datadog:CustomAllocationRules
        name: preserve_order
        properties:
          ruleIds:
            - ${rule1.id}
            - ${rule2.id}
            - ${rule3.id}
      # Example 2: Override mode - deletes all unmanaged rules and maintains strict order
      # This will delete any rules not defined in Terraform and enforce the exact order specified
      overrideOrder:
        type: datadog:CustomAllocationRules
        name: override_order
        properties:
          overrideUiDefinedResources: true
          ruleIds:
            - ${rule1.id}
            - ${rule2.id}
            - ${rule3.id}
    

    Create CustomAllocationRules Resource

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

    Constructor syntax

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

    Parameters

    name string
    The unique name of the resource.
    args CustomAllocationRulesArgs
    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 CustomAllocationRulesArgs
    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 CustomAllocationRulesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomAllocationRulesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomAllocationRulesArgs
    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 customAllocationRulesResource = new Datadog.CustomAllocationRules("customAllocationRulesResource", new()
    {
        RuleIds = new[]
        {
            "string",
        },
        OverrideUiDefinedResources = false,
    });
    
    example, err := datadog.NewCustomAllocationRules(ctx, "customAllocationRulesResource", &datadog.CustomAllocationRulesArgs{
    	RuleIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	OverrideUiDefinedResources: pulumi.Bool(false),
    })
    
    var customAllocationRulesResource = new CustomAllocationRules("customAllocationRulesResource", CustomAllocationRulesArgs.builder()
        .ruleIds("string")
        .overrideUiDefinedResources(false)
        .build());
    
    custom_allocation_rules_resource = datadog.CustomAllocationRules("customAllocationRulesResource",
        rule_ids=["string"],
        override_ui_defined_resources=False)
    
    const customAllocationRulesResource = new datadog.CustomAllocationRules("customAllocationRulesResource", {
        ruleIds: ["string"],
        overrideUiDefinedResources: false,
    });
    
    type: datadog:CustomAllocationRules
    properties:
        overrideUiDefinedResources: false
        ruleIds:
            - string
    

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

    RuleIds List<string>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    OverrideUiDefinedResources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    RuleIds []string
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    OverrideUiDefinedResources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds List<String>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources Boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds string[]
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    rule_ids Sequence[str]
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    override_ui_defined_resources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds List<String>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources Boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CustomAllocationRules 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CustomAllocationRules Resource

    Get an existing CustomAllocationRules 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?: CustomAllocationRulesState, opts?: CustomResourceOptions): CustomAllocationRules
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            override_ui_defined_resources: Optional[bool] = None,
            rule_ids: Optional[Sequence[str]] = None) -> CustomAllocationRules
    func GetCustomAllocationRules(ctx *Context, name string, id IDInput, state *CustomAllocationRulesState, opts ...ResourceOption) (*CustomAllocationRules, error)
    public static CustomAllocationRules Get(string name, Input<string> id, CustomAllocationRulesState? state, CustomResourceOptions? opts = null)
    public static CustomAllocationRules get(String name, Output<String> id, CustomAllocationRulesState state, CustomResourceOptions options)
    resources:  _:    type: datadog:CustomAllocationRules    get:      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:
    OverrideUiDefinedResources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    RuleIds List<string>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    OverrideUiDefinedResources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    RuleIds []string
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources Boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds List<String>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds string[]
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    override_ui_defined_resources bool
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    rule_ids Sequence[str]
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.
    overrideUiDefinedResources Boolean
    Whether to override UI-defined rules. When set to true, any rules created via the UI that are not defined in Terraform will be deleted and Terraform will be used as the source of truth for rules and their ordering. When set to false, any rules created via the UI that are at the end of order will be kept but will be warned, otherwise an error will be thrown in pulumi preview phase. Default is false
    ruleIds List<String>
    The list of Custom Allocation Rule IDs, in order. Rules are executed in the order specified in this list. Comes from the id field on a datadog.CustomAllocationRule resource.

    Import

    The pulumi import command can be used, for example:

    $ pulumi import datadog:index/customAllocationRules:CustomAllocationRules order order
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v4.68.0
    published on Wednesday, Feb 25, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.