1. Packages
  2. Datadog Provider
  3. API Docs
  4. CostBudget
Datadog v4.64.0 published on Thursday, Jan 29, 2026 by Pulumi
datadog logo
Datadog v4.64.0 published on Thursday, Jan 29, 2026 by Pulumi

    Provides a Datadog Cost Budget resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    // Simple budget without tag filters
    // Note: Must provide entries for all months in the budget period
    const simple = new datadog.CostBudget("simple", {
        name: "My AWS Cost Budget",
        metricsQuery: "sum:aws.cost.amortized{*}",
        startMonth: 202501,
        endMonth: 202503,
        entries: [
            {
                month: 202501,
                amount: 1000,
            },
            {
                month: 202502,
                amount: 1200,
            },
            {
                month: 202503,
                amount: 1000,
            },
        ],
    });
    // Budget with tag filters
    // Note: Must provide entries for all months in the budget period
    const withTagFilters = new datadog.CostBudget("with_tag_filters", {
        name: "Production AWS Budget",
        metricsQuery: "sum:aws.cost.amortized{*} by {environment}",
        startMonth: 202501,
        endMonth: 202503,
        entries: [
            {
                month: 202501,
                amount: 2000,
                tagFilters: [{
                    tagKey: "environment",
                    tagValue: "production",
                }],
            },
            {
                month: 202502,
                amount: 2200,
                tagFilters: [{
                    tagKey: "environment",
                    tagValue: "production",
                }],
            },
            {
                month: 202503,
                amount: 2000,
                tagFilters: [{
                    tagKey: "environment",
                    tagValue: "production",
                }],
            },
        ],
    });
    // Hierarchical budget with multiple tag combinations
    // Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
    // Each unique tag combination must have entries for all months in the budget period
    const hierarchical = new datadog.CostBudget("hierarchical", {
        name: "Team-Based AWS Budget",
        metricsQuery: "sum:aws.cost.amortized{*} by {team,account}",
        startMonth: 202501,
        endMonth: 202503,
        entries: [
            {
                month: 202501,
                amount: 500,
                tagFilters: [
                    {
                        tagKey: "team",
                        tagValue: "backend",
                    },
                    {
                        tagKey: "account",
                        tagValue: "staging",
                    },
                ],
            },
            {
                month: 202502,
                amount: 500,
                tagFilters: [
                    {
                        tagKey: "team",
                        tagValue: "backend",
                    },
                    {
                        tagKey: "account",
                        tagValue: "staging",
                    },
                ],
            },
            {
                month: 202503,
                amount: 500,
                tagFilters: [
                    {
                        tagKey: "team",
                        tagValue: "backend",
                    },
                    {
                        tagKey: "account",
                        tagValue: "staging",
                    },
                ],
            },
            {
                month: 202501,
                amount: 1500,
                tagFilters: [
                    {
                        tagKey: "team",
                        tagValue: "backend",
                    },
                    {
                        tagKey: "account",
                        tagValue: "production",
                    },
                ],
            },
        ],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    # Simple budget without tag filters
    # Note: Must provide entries for all months in the budget period
    simple = datadog.CostBudget("simple",
        name="My AWS Cost Budget",
        metrics_query="sum:aws.cost.amortized{*}",
        start_month=202501,
        end_month=202503,
        entries=[
            {
                "month": 202501,
                "amount": 1000,
            },
            {
                "month": 202502,
                "amount": 1200,
            },
            {
                "month": 202503,
                "amount": 1000,
            },
        ])
    # Budget with tag filters
    # Note: Must provide entries for all months in the budget period
    with_tag_filters = datadog.CostBudget("with_tag_filters",
        name="Production AWS Budget",
        metrics_query="sum:aws.cost.amortized{*} by {environment}",
        start_month=202501,
        end_month=202503,
        entries=[
            {
                "month": 202501,
                "amount": 2000,
                "tag_filters": [{
                    "tag_key": "environment",
                    "tag_value": "production",
                }],
            },
            {
                "month": 202502,
                "amount": 2200,
                "tag_filters": [{
                    "tag_key": "environment",
                    "tag_value": "production",
                }],
            },
            {
                "month": 202503,
                "amount": 2000,
                "tag_filters": [{
                    "tag_key": "environment",
                    "tag_value": "production",
                }],
            },
        ])
    # Hierarchical budget with multiple tag combinations
    # Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
    # Each unique tag combination must have entries for all months in the budget period
    hierarchical = datadog.CostBudget("hierarchical",
        name="Team-Based AWS Budget",
        metrics_query="sum:aws.cost.amortized{*} by {team,account}",
        start_month=202501,
        end_month=202503,
        entries=[
            {
                "month": 202501,
                "amount": 500,
                "tag_filters": [
                    {
                        "tag_key": "team",
                        "tag_value": "backend",
                    },
                    {
                        "tag_key": "account",
                        "tag_value": "staging",
                    },
                ],
            },
            {
                "month": 202502,
                "amount": 500,
                "tag_filters": [
                    {
                        "tag_key": "team",
                        "tag_value": "backend",
                    },
                    {
                        "tag_key": "account",
                        "tag_value": "staging",
                    },
                ],
            },
            {
                "month": 202503,
                "amount": 500,
                "tag_filters": [
                    {
                        "tag_key": "team",
                        "tag_value": "backend",
                    },
                    {
                        "tag_key": "account",
                        "tag_value": "staging",
                    },
                ],
            },
            {
                "month": 202501,
                "amount": 1500,
                "tag_filters": [
                    {
                        "tag_key": "team",
                        "tag_value": "backend",
                    },
                    {
                        "tag_key": "account",
                        "tag_value": "production",
                    },
                ],
            },
        ])
    
    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 {
    		// Simple budget without tag filters
    		// Note: Must provide entries for all months in the budget period
    		_, err := datadog.NewCostBudget(ctx, "simple", &datadog.CostBudgetArgs{
    			Name:         pulumi.String("My AWS Cost Budget"),
    			MetricsQuery: pulumi.String("sum:aws.cost.amortized{*}"),
    			StartMonth:   pulumi.Int(202501),
    			EndMonth:     pulumi.Int(202503),
    			Entries: datadog.CostBudgetEntryArray{
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202501),
    					Amount: pulumi.Float64(1000),
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202502),
    					Amount: pulumi.Float64(1200),
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202503),
    					Amount: pulumi.Float64(1000),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Budget with tag filters
    		// Note: Must provide entries for all months in the budget period
    		_, err = datadog.NewCostBudget(ctx, "with_tag_filters", &datadog.CostBudgetArgs{
    			Name:         pulumi.String("Production AWS Budget"),
    			MetricsQuery: pulumi.String("sum:aws.cost.amortized{*} by {environment}"),
    			StartMonth:   pulumi.Int(202501),
    			EndMonth:     pulumi.Int(202503),
    			Entries: datadog.CostBudgetEntryArray{
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202501),
    					Amount: pulumi.Float64(2000),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("environment"),
    							TagValue: pulumi.String("production"),
    						},
    					},
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202502),
    					Amount: pulumi.Float64(2200),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("environment"),
    							TagValue: pulumi.String("production"),
    						},
    					},
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202503),
    					Amount: pulumi.Float64(2000),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("environment"),
    							TagValue: pulumi.String("production"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Hierarchical budget with multiple tag combinations
    		// Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
    		// Each unique tag combination must have entries for all months in the budget period
    		_, err = datadog.NewCostBudget(ctx, "hierarchical", &datadog.CostBudgetArgs{
    			Name:         pulumi.String("Team-Based AWS Budget"),
    			MetricsQuery: pulumi.String("sum:aws.cost.amortized{*} by {team,account}"),
    			StartMonth:   pulumi.Int(202501),
    			EndMonth:     pulumi.Int(202503),
    			Entries: datadog.CostBudgetEntryArray{
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202501),
    					Amount: pulumi.Float64(500),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("team"),
    							TagValue: pulumi.String("backend"),
    						},
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("account"),
    							TagValue: pulumi.String("staging"),
    						},
    					},
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202502),
    					Amount: pulumi.Float64(500),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("team"),
    							TagValue: pulumi.String("backend"),
    						},
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("account"),
    							TagValue: pulumi.String("staging"),
    						},
    					},
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202503),
    					Amount: pulumi.Float64(500),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("team"),
    							TagValue: pulumi.String("backend"),
    						},
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("account"),
    							TagValue: pulumi.String("staging"),
    						},
    					},
    				},
    				&datadog.CostBudgetEntryArgs{
    					Month:  pulumi.Int(202501),
    					Amount: pulumi.Float64(1500),
    					TagFilters: datadog.CostBudgetEntryTagFilterArray{
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("team"),
    							TagValue: pulumi.String("backend"),
    						},
    						&datadog.CostBudgetEntryTagFilterArgs{
    							TagKey:   pulumi.String("account"),
    							TagValue: pulumi.String("production"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        // Simple budget without tag filters
        // Note: Must provide entries for all months in the budget period
        var simple = new Datadog.CostBudget("simple", new()
        {
            Name = "My AWS Cost Budget",
            MetricsQuery = "sum:aws.cost.amortized{*}",
            StartMonth = 202501,
            EndMonth = 202503,
            Entries = new[]
            {
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202501,
                    Amount = 1000,
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202502,
                    Amount = 1200,
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202503,
                    Amount = 1000,
                },
            },
        });
    
        // Budget with tag filters
        // Note: Must provide entries for all months in the budget period
        var withTagFilters = new Datadog.CostBudget("with_tag_filters", new()
        {
            Name = "Production AWS Budget",
            MetricsQuery = "sum:aws.cost.amortized{*} by {environment}",
            StartMonth = 202501,
            EndMonth = 202503,
            Entries = new[]
            {
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202501,
                    Amount = 2000,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "environment",
                            TagValue = "production",
                        },
                    },
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202502,
                    Amount = 2200,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "environment",
                            TagValue = "production",
                        },
                    },
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202503,
                    Amount = 2000,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "environment",
                            TagValue = "production",
                        },
                    },
                },
            },
        });
    
        // Hierarchical budget with multiple tag combinations
        // Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
        // Each unique tag combination must have entries for all months in the budget period
        var hierarchical = new Datadog.CostBudget("hierarchical", new()
        {
            Name = "Team-Based AWS Budget",
            MetricsQuery = "sum:aws.cost.amortized{*} by {team,account}",
            StartMonth = 202501,
            EndMonth = 202503,
            Entries = new[]
            {
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202501,
                    Amount = 500,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "team",
                            TagValue = "backend",
                        },
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "account",
                            TagValue = "staging",
                        },
                    },
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202502,
                    Amount = 500,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "team",
                            TagValue = "backend",
                        },
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "account",
                            TagValue = "staging",
                        },
                    },
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202503,
                    Amount = 500,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "team",
                            TagValue = "backend",
                        },
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "account",
                            TagValue = "staging",
                        },
                    },
                },
                new Datadog.Inputs.CostBudgetEntryArgs
                {
                    Month = 202501,
                    Amount = 1500,
                    TagFilters = new[]
                    {
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "team",
                            TagValue = "backend",
                        },
                        new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                        {
                            TagKey = "account",
                            TagValue = "production",
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.CostBudget;
    import com.pulumi.datadog.CostBudgetArgs;
    import com.pulumi.datadog.inputs.CostBudgetEntryArgs;
    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) {
            // Simple budget without tag filters
            // Note: Must provide entries for all months in the budget period
            var simple = new CostBudget("simple", CostBudgetArgs.builder()
                .name("My AWS Cost Budget")
                .metricsQuery("sum:aws.cost.amortized{*}")
                .startMonth(202501)
                .endMonth(202503)
                .entries(            
                    CostBudgetEntryArgs.builder()
                        .month(202501)
                        .amount(1000.0)
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202502)
                        .amount(1200.0)
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202503)
                        .amount(1000.0)
                        .build())
                .build());
    
            // Budget with tag filters
            // Note: Must provide entries for all months in the budget period
            var withTagFilters = new CostBudget("withTagFilters", CostBudgetArgs.builder()
                .name("Production AWS Budget")
                .metricsQuery("sum:aws.cost.amortized{*} by {environment}")
                .startMonth(202501)
                .endMonth(202503)
                .entries(            
                    CostBudgetEntryArgs.builder()
                        .month(202501)
                        .amount(2000.0)
                        .tagFilters(CostBudgetEntryTagFilterArgs.builder()
                            .tagKey("environment")
                            .tagValue("production")
                            .build())
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202502)
                        .amount(2200.0)
                        .tagFilters(CostBudgetEntryTagFilterArgs.builder()
                            .tagKey("environment")
                            .tagValue("production")
                            .build())
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202503)
                        .amount(2000.0)
                        .tagFilters(CostBudgetEntryTagFilterArgs.builder()
                            .tagKey("environment")
                            .tagValue("production")
                            .build())
                        .build())
                .build());
    
            // Hierarchical budget with multiple tag combinations
            // Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
            // Each unique tag combination must have entries for all months in the budget period
            var hierarchical = new CostBudget("hierarchical", CostBudgetArgs.builder()
                .name("Team-Based AWS Budget")
                .metricsQuery("sum:aws.cost.amortized{*} by {team,account}")
                .startMonth(202501)
                .endMonth(202503)
                .entries(            
                    CostBudgetEntryArgs.builder()
                        .month(202501)
                        .amount(500.0)
                        .tagFilters(                    
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("team")
                                .tagValue("backend")
                                .build(),
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("account")
                                .tagValue("staging")
                                .build())
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202502)
                        .amount(500.0)
                        .tagFilters(                    
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("team")
                                .tagValue("backend")
                                .build(),
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("account")
                                .tagValue("staging")
                                .build())
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202503)
                        .amount(500.0)
                        .tagFilters(                    
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("team")
                                .tagValue("backend")
                                .build(),
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("account")
                                .tagValue("staging")
                                .build())
                        .build(),
                    CostBudgetEntryArgs.builder()
                        .month(202501)
                        .amount(1500.0)
                        .tagFilters(                    
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("team")
                                .tagValue("backend")
                                .build(),
                            CostBudgetEntryTagFilterArgs.builder()
                                .tagKey("account")
                                .tagValue("production")
                                .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      # Simple budget without tag filters
      # Note: Must provide entries for all months in the budget period
      simple:
        type: datadog:CostBudget
        properties:
          name: My AWS Cost Budget
          metricsQuery: sum:aws.cost.amortized{*}
          startMonth: 202501
          endMonth: 202503
          entries:
            - month: 202501
              amount: 1000
            - month: 202502
              amount: 1200
            - month: 202503
              amount: 1000
      # Budget with tag filters
      # Note: Must provide entries for all months in the budget period
      withTagFilters:
        type: datadog:CostBudget
        name: with_tag_filters
        properties:
          name: Production AWS Budget
          metricsQuery: sum:aws.cost.amortized{*} by {environment}
          startMonth: 202501
          endMonth: 202503
          entries:
            - month: 202501
              amount: 2000
              tagFilters:
                - tagKey: environment
                  tagValue: production
            - month: 202502
              amount: 2200
              tagFilters:
                - tagKey: environment
                  tagValue: production
            - month: 202503
              amount: 2000
              tagFilters:
                - tagKey: environment
                  tagValue: production
      # Hierarchical budget with multiple tag combinations
      # Note: Order of tags in "by {tag1,tag2}" determines UI hierarchy (parent,child)
      # Each unique tag combination must have entries for all months in the budget period
      hierarchical:
        type: datadog:CostBudget
        properties:
          name: Team-Based AWS Budget
          metricsQuery: sum:aws.cost.amortized{*} by {team,account}
          startMonth: 202501
          endMonth: 202503
          entries:
            - month: 202501
              amount: 500
              tagFilters:
                - tagKey: team
                  tagValue: backend
                - tagKey: account
                  tagValue: staging
            - month: 202502
              amount: 500
              tagFilters:
                - tagKey: team
                  tagValue: backend
                - tagKey: account
                  tagValue: staging
            - month: 202503
              amount: 500
              tagFilters:
                - tagKey: team
                  tagValue: backend
                - tagKey: account
                  tagValue: staging
            - month: 202501
              amount: 1500
              tagFilters:
                - tagKey: team
                  tagValue: backend
                - tagKey: account
                  tagValue: production
    

    Create CostBudget Resource

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

    Constructor syntax

    new CostBudget(name: string, args: CostBudgetArgs, opts?: CustomResourceOptions);
    @overload
    def CostBudget(resource_name: str,
                   args: CostBudgetArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def CostBudget(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   end_month: Optional[int] = None,
                   metrics_query: Optional[str] = None,
                   name: Optional[str] = None,
                   start_month: Optional[int] = None,
                   budget_id: Optional[str] = None,
                   entries: Optional[Sequence[CostBudgetEntryArgs]] = None)
    func NewCostBudget(ctx *Context, name string, args CostBudgetArgs, opts ...ResourceOption) (*CostBudget, error)
    public CostBudget(string name, CostBudgetArgs args, CustomResourceOptions? opts = null)
    public CostBudget(String name, CostBudgetArgs args)
    public CostBudget(String name, CostBudgetArgs args, CustomResourceOptions options)
    
    type: datadog:CostBudget
    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 CostBudgetArgs
    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 CostBudgetArgs
    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 CostBudgetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CostBudgetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CostBudgetArgs
    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 costBudgetResource = new Datadog.CostBudget("costBudgetResource", new()
    {
        EndMonth = 0,
        MetricsQuery = "string",
        Name = "string",
        StartMonth = 0,
        BudgetId = "string",
        Entries = new[]
        {
            new Datadog.Inputs.CostBudgetEntryArgs
            {
                Amount = 0,
                Month = 0,
                TagFilters = new[]
                {
                    new Datadog.Inputs.CostBudgetEntryTagFilterArgs
                    {
                        TagKey = "string",
                        TagValue = "string",
                    },
                },
            },
        },
    });
    
    example, err := datadog.NewCostBudget(ctx, "costBudgetResource", &datadog.CostBudgetArgs{
    	EndMonth:     pulumi.Int(0),
    	MetricsQuery: pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	StartMonth:   pulumi.Int(0),
    	BudgetId:     pulumi.String("string"),
    	Entries: datadog.CostBudgetEntryArray{
    		&datadog.CostBudgetEntryArgs{
    			Amount: pulumi.Float64(0),
    			Month:  pulumi.Int(0),
    			TagFilters: datadog.CostBudgetEntryTagFilterArray{
    				&datadog.CostBudgetEntryTagFilterArgs{
    					TagKey:   pulumi.String("string"),
    					TagValue: pulumi.String("string"),
    				},
    			},
    		},
    	},
    })
    
    var costBudgetResource = new CostBudget("costBudgetResource", CostBudgetArgs.builder()
        .endMonth(0)
        .metricsQuery("string")
        .name("string")
        .startMonth(0)
        .budgetId("string")
        .entries(CostBudgetEntryArgs.builder()
            .amount(0.0)
            .month(0)
            .tagFilters(CostBudgetEntryTagFilterArgs.builder()
                .tagKey("string")
                .tagValue("string")
                .build())
            .build())
        .build());
    
    cost_budget_resource = datadog.CostBudget("costBudgetResource",
        end_month=0,
        metrics_query="string",
        name="string",
        start_month=0,
        budget_id="string",
        entries=[{
            "amount": 0,
            "month": 0,
            "tag_filters": [{
                "tag_key": "string",
                "tag_value": "string",
            }],
        }])
    
    const costBudgetResource = new datadog.CostBudget("costBudgetResource", {
        endMonth: 0,
        metricsQuery: "string",
        name: "string",
        startMonth: 0,
        budgetId: "string",
        entries: [{
            amount: 0,
            month: 0,
            tagFilters: [{
                tagKey: "string",
                tagValue: "string",
            }],
        }],
    });
    
    type: datadog:CostBudget
    properties:
        budgetId: string
        endMonth: 0
        entries:
            - amount: 0
              month: 0
              tagFilters:
                - tagKey: string
                  tagValue: string
        metricsQuery: string
        name: string
        startMonth: 0
    

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

    EndMonth int
    The month when the budget ends (YYYYMM).
    MetricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    Name string
    The name of the budget.
    StartMonth int
    The month when the budget starts (YYYYMM).
    BudgetId string
    The ID of the budget.
    Entries List<CostBudgetEntry>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    EndMonth int
    The month when the budget ends (YYYYMM).
    MetricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    Name string
    The name of the budget.
    StartMonth int
    The month when the budget starts (YYYYMM).
    BudgetId string
    The ID of the budget.
    Entries []CostBudgetEntryArgs
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    endMonth Integer
    The month when the budget ends (YYYYMM).
    metricsQuery String
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name String
    The name of the budget.
    startMonth Integer
    The month when the budget starts (YYYYMM).
    budgetId String
    The ID of the budget.
    entries List<CostBudgetEntry>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    endMonth number
    The month when the budget ends (YYYYMM).
    metricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name string
    The name of the budget.
    startMonth number
    The month when the budget starts (YYYYMM).
    budgetId string
    The ID of the budget.
    entries CostBudgetEntry[]
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    end_month int
    The month when the budget ends (YYYYMM).
    metrics_query str
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name str
    The name of the budget.
    start_month int
    The month when the budget starts (YYYYMM).
    budget_id str
    The ID of the budget.
    entries Sequence[CostBudgetEntryArgs]
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    endMonth Number
    The month when the budget ends (YYYYMM).
    metricsQuery String
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name String
    The name of the budget.
    startMonth Number
    The month when the budget starts (YYYYMM).
    budgetId String
    The ID of the budget.
    entries List<Property Map>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    TotalAmount double
    The sum of all budget entries' amounts.
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalAmount float64
    The sum of all budget entries' amounts.
    id String
    The provider-assigned unique ID for this managed resource.
    totalAmount Double
    The sum of all budget entries' amounts.
    id string
    The provider-assigned unique ID for this managed resource.
    totalAmount number
    The sum of all budget entries' amounts.
    id str
    The provider-assigned unique ID for this managed resource.
    total_amount float
    The sum of all budget entries' amounts.
    id String
    The provider-assigned unique ID for this managed resource.
    totalAmount Number
    The sum of all budget entries' amounts.

    Look up Existing CostBudget Resource

    Get an existing CostBudget 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?: CostBudgetState, opts?: CustomResourceOptions): CostBudget
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            budget_id: Optional[str] = None,
            end_month: Optional[int] = None,
            entries: Optional[Sequence[CostBudgetEntryArgs]] = None,
            metrics_query: Optional[str] = None,
            name: Optional[str] = None,
            start_month: Optional[int] = None,
            total_amount: Optional[float] = None) -> CostBudget
    func GetCostBudget(ctx *Context, name string, id IDInput, state *CostBudgetState, opts ...ResourceOption) (*CostBudget, error)
    public static CostBudget Get(string name, Input<string> id, CostBudgetState? state, CustomResourceOptions? opts = null)
    public static CostBudget get(String name, Output<String> id, CostBudgetState state, CustomResourceOptions options)
    resources:  _:    type: datadog:CostBudget    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:
    BudgetId string
    The ID of the budget.
    EndMonth int
    The month when the budget ends (YYYYMM).
    Entries List<CostBudgetEntry>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    MetricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    Name string
    The name of the budget.
    StartMonth int
    The month when the budget starts (YYYYMM).
    TotalAmount double
    The sum of all budget entries' amounts.
    BudgetId string
    The ID of the budget.
    EndMonth int
    The month when the budget ends (YYYYMM).
    Entries []CostBudgetEntryArgs
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    MetricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    Name string
    The name of the budget.
    StartMonth int
    The month when the budget starts (YYYYMM).
    TotalAmount float64
    The sum of all budget entries' amounts.
    budgetId String
    The ID of the budget.
    endMonth Integer
    The month when the budget ends (YYYYMM).
    entries List<CostBudgetEntry>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    metricsQuery String
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name String
    The name of the budget.
    startMonth Integer
    The month when the budget starts (YYYYMM).
    totalAmount Double
    The sum of all budget entries' amounts.
    budgetId string
    The ID of the budget.
    endMonth number
    The month when the budget ends (YYYYMM).
    entries CostBudgetEntry[]
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    metricsQuery string
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name string
    The name of the budget.
    startMonth number
    The month when the budget starts (YYYYMM).
    totalAmount number
    The sum of all budget entries' amounts.
    budget_id str
    The ID of the budget.
    end_month int
    The month when the budget ends (YYYYMM).
    entries Sequence[CostBudgetEntryArgs]
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    metrics_query str
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name str
    The name of the budget.
    start_month int
    The month when the budget starts (YYYYMM).
    total_amount float
    The sum of all budget entries' amounts.
    budgetId String
    The ID of the budget.
    endMonth Number
    The month when the budget ends (YYYYMM).
    entries List<Property Map>
    The entries of the budget. Note: You must provide entries for all months in the budget period. For hierarchical budgets, each unique tag combination must have entries for all months.
    metricsQuery String
    The cost query used to track against the budget. Note: For hierarchical budgets using by {tag1,tag2}, the order of tags determines the UI hierarchy (parent, child).
    name String
    The name of the budget.
    startMonth Number
    The month when the budget starts (YYYYMM).
    totalAmount Number
    The sum of all budget entries' amounts.

    Supporting Types

    CostBudgetEntry, CostBudgetEntryArgs

    CostBudgetEntryTagFilter, CostBudgetEntryTagFilterArgs

    TagKey string
    Note: Must be one of the tags from the metrics_query.
    TagValue string
    TagKey string
    Note: Must be one of the tags from the metrics_query.
    TagValue string
    tagKey String
    Note: Must be one of the tags from the metrics_query.
    tagValue String
    tagKey string
    Note: Must be one of the tags from the metrics_query.
    tagValue string
    tag_key str
    Note: Must be one of the tags from the metrics_query.
    tag_value str
    tagKey String
    Note: Must be one of the tags from the metrics_query.
    tagValue String

    Import

    The pulumi import command can be used, for example:

    Cost budgets can be imported using their ID, e.g.

    $ pulumi import datadog:index/costBudget:CostBudget example a1b2c3d4-e5f6-7890-abcd-ef1234567890
    

    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
    Datadog v4.64.0 published on Thursday, Jan 29, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate