published on Wednesday, Feb 25, 2026 by Pulumi
published on Wednesday, Feb 25, 2026 by Pulumi
Provides a Datadog Cost Budget resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Budget with multiple tag combinations
// Note: Each unique tag combination needs its own budget_line block
const withTags = new datadog.CostBudget("with_tags", {
name: "Multi-Environment Budget",
metricsQuery: "sum:aws.cost.amortized{*} by {environment}",
startMonth: 202601,
endMonth: 202603,
budgetLines: [
{
amounts: {
"202601": 2000,
"202602": 2200,
"202603": 2000,
},
tagFilters: [{
tagKey: "environment",
tagValue: "production",
}],
},
{
amounts: {
"202601": 1000,
"202602": 1100,
"202603": 1000,
},
tagFilters: [{
tagKey: "environment",
tagValue: "staging",
}],
},
],
});
import pulumi
import pulumi_datadog as datadog
# Budget with multiple tag combinations
# Note: Each unique tag combination needs its own budget_line block
with_tags = datadog.CostBudget("with_tags",
name="Multi-Environment Budget",
metrics_query="sum:aws.cost.amortized{*} by {environment}",
start_month=202601,
end_month=202603,
budget_lines=[
{
"amounts": {
"202601": 2000,
"202602": 2200,
"202603": 2000,
},
"tag_filters": [{
"tag_key": "environment",
"tag_value": "production",
}],
},
{
"amounts": {
"202601": 1000,
"202602": 1100,
"202603": 1000,
},
"tag_filters": [{
"tag_key": "environment",
"tag_value": "staging",
}],
},
])
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 {
// Budget with multiple tag combinations
// Note: Each unique tag combination needs its own budget_line block
_, err := datadog.NewCostBudget(ctx, "with_tags", &datadog.CostBudgetArgs{
Name: pulumi.String("Multi-Environment Budget"),
MetricsQuery: pulumi.String("sum:aws.cost.amortized{*} by {environment}"),
StartMonth: pulumi.Int(202601),
EndMonth: pulumi.Int(202603),
BudgetLines: datadog.CostBudgetBudgetLineArray{
&datadog.CostBudgetBudgetLineArgs{
Amounts: pulumi.Float64Map{
"202601": pulumi.Float64(2000),
"202602": pulumi.Float64(2200),
"202603": pulumi.Float64(2000),
},
TagFilters: datadog.CostBudgetBudgetLineTagFilterArray{
&datadog.CostBudgetBudgetLineTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("production"),
},
},
},
&datadog.CostBudgetBudgetLineArgs{
Amounts: pulumi.Float64Map{
"202601": pulumi.Float64(1000),
"202602": pulumi.Float64(1100),
"202603": pulumi.Float64(1000),
},
TagFilters: datadog.CostBudgetBudgetLineTagFilterArray{
&datadog.CostBudgetBudgetLineTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("staging"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
// Budget with multiple tag combinations
// Note: Each unique tag combination needs its own budget_line block
var withTags = new Datadog.CostBudget("with_tags", new()
{
Name = "Multi-Environment Budget",
MetricsQuery = "sum:aws.cost.amortized{*} by {environment}",
StartMonth = 202601,
EndMonth = 202603,
BudgetLines = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineArgs
{
Amounts =
{
{ "202601", 2000 },
{ "202602", 2200 },
{ "202603", 2000 },
},
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineTagFilterArgs
{
TagKey = "environment",
TagValue = "production",
},
},
},
new Datadog.Inputs.CostBudgetBudgetLineArgs
{
Amounts =
{
{ "202601", 1000 },
{ "202602", 1100 },
{ "202603", 1000 },
},
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineTagFilterArgs
{
TagKey = "environment",
TagValue = "staging",
},
},
},
},
});
});
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.CostBudgetBudgetLineArgs;
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) {
// Budget with multiple tag combinations
// Note: Each unique tag combination needs its own budget_line block
var withTags = new CostBudget("withTags", CostBudgetArgs.builder()
.name("Multi-Environment Budget")
.metricsQuery("sum:aws.cost.amortized{*} by {environment}")
.startMonth(202601)
.endMonth(202603)
.budgetLines(
CostBudgetBudgetLineArgs.builder()
.amounts(Map.ofEntries(
Map.entry("202601", 2000.0),
Map.entry("202602", 2200.0),
Map.entry("202603", 2000.0)
))
.tagFilters(CostBudgetBudgetLineTagFilterArgs.builder()
.tagKey("environment")
.tagValue("production")
.build())
.build(),
CostBudgetBudgetLineArgs.builder()
.amounts(Map.ofEntries(
Map.entry("202601", 1000.0),
Map.entry("202602", 1100.0),
Map.entry("202603", 1000.0)
))
.tagFilters(CostBudgetBudgetLineTagFilterArgs.builder()
.tagKey("environment")
.tagValue("staging")
.build())
.build())
.build());
}
}
resources:
# Budget with multiple tag combinations
# Note: Each unique tag combination needs its own budget_line block
withTags:
type: datadog:CostBudget
name: with_tags
properties:
name: Multi-Environment Budget
metricsQuery: sum:aws.cost.amortized{*} by {environment}
startMonth: 202601
endMonth: 202603
budgetLines:
- amounts:
'202601': 2000
'202602': 2200
'202603': 2000
tagFilters:
- tagKey: environment
tagValue: production
- amounts:
'202601': 1000
'202602': 1100
'202603': 1000
tagFilters:
- tagKey: environment
tagValue: staging
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Hierarchical budget with parent/child tag structure
// Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
// Each unique parent+child combination needs its own budget_line block
const hierarchical = new datadog.CostBudget("hierarchical", {
name: "Team-Based AWS Budget",
metricsQuery: "sum:aws.cost.amortized{*} by {team,environment}",
startMonth: 202601,
endMonth: 202603,
budgetLines: [
{
amounts: {
"202601": 1500,
"202602": 1600,
"202603": 1500,
},
parentTagFilters: [{
tagKey: "team",
tagValue: "backend",
}],
childTagFilters: [{
tagKey: "environment",
tagValue: "production",
}],
},
{
amounts: {
"202601": 500,
"202602": 550,
"202603": 500,
},
parentTagFilters: [{
tagKey: "team",
tagValue: "frontend",
}],
childTagFilters: [{
tagKey: "environment",
tagValue: "staging",
}],
},
],
});
import pulumi
import pulumi_datadog as datadog
# Hierarchical budget with parent/child tag structure
# Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
# Each unique parent+child combination needs its own budget_line block
hierarchical = datadog.CostBudget("hierarchical",
name="Team-Based AWS Budget",
metrics_query="sum:aws.cost.amortized{*} by {team,environment}",
start_month=202601,
end_month=202603,
budget_lines=[
{
"amounts": {
"202601": 1500,
"202602": 1600,
"202603": 1500,
},
"parent_tag_filters": [{
"tag_key": "team",
"tag_value": "backend",
}],
"child_tag_filters": [{
"tag_key": "environment",
"tag_value": "production",
}],
},
{
"amounts": {
"202601": 500,
"202602": 550,
"202603": 500,
},
"parent_tag_filters": [{
"tag_key": "team",
"tag_value": "frontend",
}],
"child_tag_filters": [{
"tag_key": "environment",
"tag_value": "staging",
}],
},
])
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 {
// Hierarchical budget with parent/child tag structure
// Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
// Each unique parent+child combination needs its own budget_line block
_, err := datadog.NewCostBudget(ctx, "hierarchical", &datadog.CostBudgetArgs{
Name: pulumi.String("Team-Based AWS Budget"),
MetricsQuery: pulumi.String("sum:aws.cost.amortized{*} by {team,environment}"),
StartMonth: pulumi.Int(202601),
EndMonth: pulumi.Int(202603),
BudgetLines: datadog.CostBudgetBudgetLineArray{
&datadog.CostBudgetBudgetLineArgs{
Amounts: pulumi.Float64Map{
"202601": pulumi.Float64(1500),
"202602": pulumi.Float64(1600),
"202603": pulumi.Float64(1500),
},
ParentTagFilters: datadog.CostBudgetBudgetLineParentTagFilterArray{
&datadog.CostBudgetBudgetLineParentTagFilterArgs{
TagKey: pulumi.String("team"),
TagValue: pulumi.String("backend"),
},
},
ChildTagFilters: datadog.CostBudgetBudgetLineChildTagFilterArray{
&datadog.CostBudgetBudgetLineChildTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("production"),
},
},
},
&datadog.CostBudgetBudgetLineArgs{
Amounts: pulumi.Float64Map{
"202601": pulumi.Float64(500),
"202602": pulumi.Float64(550),
"202603": pulumi.Float64(500),
},
ParentTagFilters: datadog.CostBudgetBudgetLineParentTagFilterArray{
&datadog.CostBudgetBudgetLineParentTagFilterArgs{
TagKey: pulumi.String("team"),
TagValue: pulumi.String("frontend"),
},
},
ChildTagFilters: datadog.CostBudgetBudgetLineChildTagFilterArray{
&datadog.CostBudgetBudgetLineChildTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("staging"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
// Hierarchical budget with parent/child tag structure
// Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
// Each unique parent+child combination needs its own budget_line block
var hierarchical = new Datadog.CostBudget("hierarchical", new()
{
Name = "Team-Based AWS Budget",
MetricsQuery = "sum:aws.cost.amortized{*} by {team,environment}",
StartMonth = 202601,
EndMonth = 202603,
BudgetLines = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineArgs
{
Amounts =
{
{ "202601", 1500 },
{ "202602", 1600 },
{ "202603", 1500 },
},
ParentTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineParentTagFilterArgs
{
TagKey = "team",
TagValue = "backend",
},
},
ChildTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineChildTagFilterArgs
{
TagKey = "environment",
TagValue = "production",
},
},
},
new Datadog.Inputs.CostBudgetBudgetLineArgs
{
Amounts =
{
{ "202601", 500 },
{ "202602", 550 },
{ "202603", 500 },
},
ParentTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineParentTagFilterArgs
{
TagKey = "team",
TagValue = "frontend",
},
},
ChildTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineChildTagFilterArgs
{
TagKey = "environment",
TagValue = "staging",
},
},
},
},
});
});
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.CostBudgetBudgetLineArgs;
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) {
// Hierarchical budget with parent/child tag structure
// Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
// Each unique parent+child combination needs its own budget_line block
var hierarchical = new CostBudget("hierarchical", CostBudgetArgs.builder()
.name("Team-Based AWS Budget")
.metricsQuery("sum:aws.cost.amortized{*} by {team,environment}")
.startMonth(202601)
.endMonth(202603)
.budgetLines(
CostBudgetBudgetLineArgs.builder()
.amounts(Map.ofEntries(
Map.entry("202601", 1500.0),
Map.entry("202602", 1600.0),
Map.entry("202603", 1500.0)
))
.parentTagFilters(CostBudgetBudgetLineParentTagFilterArgs.builder()
.tagKey("team")
.tagValue("backend")
.build())
.childTagFilters(CostBudgetBudgetLineChildTagFilterArgs.builder()
.tagKey("environment")
.tagValue("production")
.build())
.build(),
CostBudgetBudgetLineArgs.builder()
.amounts(Map.ofEntries(
Map.entry("202601", 500.0),
Map.entry("202602", 550.0),
Map.entry("202603", 500.0)
))
.parentTagFilters(CostBudgetBudgetLineParentTagFilterArgs.builder()
.tagKey("team")
.tagValue("frontend")
.build())
.childTagFilters(CostBudgetBudgetLineChildTagFilterArgs.builder()
.tagKey("environment")
.tagValue("staging")
.build())
.build())
.build());
}
}
resources:
# Hierarchical budget with parent/child tag structure
# Note: Order in "by {tag1,tag2}" determines hierarchy (parent,child)
# Each unique parent+child combination needs its own budget_line block
hierarchical:
type: datadog:CostBudget
properties:
name: Team-Based AWS Budget
metricsQuery: sum:aws.cost.amortized{*} by {team,environment}
startMonth: 202601
endMonth: 202603
budgetLines:
- amounts:
'202601': 1500
'202602': 1600
'202603': 1500
parentTagFilters:
- tagKey: team
tagValue: backend
childTagFilters:
- tagKey: environment
tagValue: production
- amounts:
'202601': 500
'202602': 550
'202603': 500
parentTagFilters:
- tagKey: team
tagValue: frontend
childTagFilters:
- tagKey: environment
tagValue: staging
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Legacy entries with tag filters (deprecated - use budget_line instead)
// Note: Each unique tag combination must have entries for all months
const legacyWithTags = new datadog.CostBudget("legacy_with_tags", {
name: "Production Budget (Legacy)",
metricsQuery: "sum:aws.cost.amortized{*} by {environment}",
startMonth: 202601,
endMonth: 202603,
entries: [
{
month: 202601,
amount: 2000,
tagFilters: [{
tagKey: "environment",
tagValue: "production",
}],
},
{
month: 202602,
amount: 2200,
tagFilters: [{
tagKey: "environment",
tagValue: "production",
}],
},
{
month: 202603,
amount: 2000,
tagFilters: [{
tagKey: "environment",
tagValue: "production",
}],
},
],
});
import pulumi
import pulumi_datadog as datadog
# Legacy entries with tag filters (deprecated - use budget_line instead)
# Note: Each unique tag combination must have entries for all months
legacy_with_tags = datadog.CostBudget("legacy_with_tags",
name="Production Budget (Legacy)",
metrics_query="sum:aws.cost.amortized{*} by {environment}",
start_month=202601,
end_month=202603,
entries=[
{
"month": 202601,
"amount": 2000,
"tag_filters": [{
"tag_key": "environment",
"tag_value": "production",
}],
},
{
"month": 202602,
"amount": 2200,
"tag_filters": [{
"tag_key": "environment",
"tag_value": "production",
}],
},
{
"month": 202603,
"amount": 2000,
"tag_filters": [{
"tag_key": "environment",
"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 {
// Legacy entries with tag filters (deprecated - use budget_line instead)
// Note: Each unique tag combination must have entries for all months
_, err := datadog.NewCostBudget(ctx, "legacy_with_tags", &datadog.CostBudgetArgs{
Name: pulumi.String("Production Budget (Legacy)"),
MetricsQuery: pulumi.String("sum:aws.cost.amortized{*} by {environment}"),
StartMonth: pulumi.Int(202601),
EndMonth: pulumi.Int(202603),
Entries: datadog.CostBudgetEntryArray{
&datadog.CostBudgetEntryArgs{
Month: pulumi.Int(202601),
Amount: pulumi.Float64(2000),
TagFilters: datadog.CostBudgetEntryTagFilterArray{
&datadog.CostBudgetEntryTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("production"),
},
},
},
&datadog.CostBudgetEntryArgs{
Month: pulumi.Int(202602),
Amount: pulumi.Float64(2200),
TagFilters: datadog.CostBudgetEntryTagFilterArray{
&datadog.CostBudgetEntryTagFilterArgs{
TagKey: pulumi.String("environment"),
TagValue: pulumi.String("production"),
},
},
},
&datadog.CostBudgetEntryArgs{
Month: pulumi.Int(202603),
Amount: pulumi.Float64(2000),
TagFilters: datadog.CostBudgetEntryTagFilterArray{
&datadog.CostBudgetEntryTagFilterArgs{
TagKey: pulumi.String("environment"),
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(() =>
{
// Legacy entries with tag filters (deprecated - use budget_line instead)
// Note: Each unique tag combination must have entries for all months
var legacyWithTags = new Datadog.CostBudget("legacy_with_tags", new()
{
Name = "Production Budget (Legacy)",
MetricsQuery = "sum:aws.cost.amortized{*} by {environment}",
StartMonth = 202601,
EndMonth = 202603,
Entries = new[]
{
new Datadog.Inputs.CostBudgetEntryArgs
{
Month = 202601,
Amount = 2000,
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetEntryTagFilterArgs
{
TagKey = "environment",
TagValue = "production",
},
},
},
new Datadog.Inputs.CostBudgetEntryArgs
{
Month = 202602,
Amount = 2200,
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetEntryTagFilterArgs
{
TagKey = "environment",
TagValue = "production",
},
},
},
new Datadog.Inputs.CostBudgetEntryArgs
{
Month = 202603,
Amount = 2000,
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetEntryTagFilterArgs
{
TagKey = "environment",
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) {
// Legacy entries with tag filters (deprecated - use budget_line instead)
// Note: Each unique tag combination must have entries for all months
var legacyWithTags = new CostBudget("legacyWithTags", CostBudgetArgs.builder()
.name("Production Budget (Legacy)")
.metricsQuery("sum:aws.cost.amortized{*} by {environment}")
.startMonth(202601)
.endMonth(202603)
.entries(
CostBudgetEntryArgs.builder()
.month(202601)
.amount(2000.0)
.tagFilters(CostBudgetEntryTagFilterArgs.builder()
.tagKey("environment")
.tagValue("production")
.build())
.build(),
CostBudgetEntryArgs.builder()
.month(202602)
.amount(2200.0)
.tagFilters(CostBudgetEntryTagFilterArgs.builder()
.tagKey("environment")
.tagValue("production")
.build())
.build(),
CostBudgetEntryArgs.builder()
.month(202603)
.amount(2000.0)
.tagFilters(CostBudgetEntryTagFilterArgs.builder()
.tagKey("environment")
.tagValue("production")
.build())
.build())
.build());
}
}
resources:
# Legacy entries with tag filters (deprecated - use budget_line instead)
# Note: Each unique tag combination must have entries for all months
legacyWithTags:
type: datadog:CostBudget
name: legacy_with_tags
properties:
name: Production Budget (Legacy)
metricsQuery: sum:aws.cost.amortized{*} by {environment}
startMonth: 202601
endMonth: 202603
entries:
- month: 202601
amount: 2000
tagFilters:
- tagKey: environment
tagValue: production
- month: 202602
amount: 2200
tagFilters:
- tagKey: environment
tagValue: production
- month: 202603
amount: 2000
tagFilters:
- tagKey: environment
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,
budget_lines: Optional[Sequence[CostBudgetBudgetLineArgs]] = 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",
BudgetLines = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineArgs
{
Amounts =
{
{ "string", 0 },
},
ChildTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineChildTagFilterArgs
{
TagKey = "string",
TagValue = "string",
},
},
ParentTagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineParentTagFilterArgs
{
TagKey = "string",
TagValue = "string",
},
},
TagFilters = new[]
{
new Datadog.Inputs.CostBudgetBudgetLineTagFilterArgs
{
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"),
BudgetLines: datadog.CostBudgetBudgetLineArray{
&datadog.CostBudgetBudgetLineArgs{
Amounts: pulumi.Float64Map{
"string": pulumi.Float64(0),
},
ChildTagFilters: datadog.CostBudgetBudgetLineChildTagFilterArray{
&datadog.CostBudgetBudgetLineChildTagFilterArgs{
TagKey: pulumi.String("string"),
TagValue: pulumi.String("string"),
},
},
ParentTagFilters: datadog.CostBudgetBudgetLineParentTagFilterArray{
&datadog.CostBudgetBudgetLineParentTagFilterArgs{
TagKey: pulumi.String("string"),
TagValue: pulumi.String("string"),
},
},
TagFilters: datadog.CostBudgetBudgetLineTagFilterArray{
&datadog.CostBudgetBudgetLineTagFilterArgs{
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")
.budgetLines(CostBudgetBudgetLineArgs.builder()
.amounts(Map.of("string", 0.0))
.childTagFilters(CostBudgetBudgetLineChildTagFilterArgs.builder()
.tagKey("string")
.tagValue("string")
.build())
.parentTagFilters(CostBudgetBudgetLineParentTagFilterArgs.builder()
.tagKey("string")
.tagValue("string")
.build())
.tagFilters(CostBudgetBudgetLineTagFilterArgs.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",
budget_lines=[{
"amounts": {
"string": 0,
},
"child_tag_filters": [{
"tag_key": "string",
"tag_value": "string",
}],
"parent_tag_filters": [{
"tag_key": "string",
"tag_value": "string",
}],
"tag_filters": [{
"tag_key": "string",
"tag_value": "string",
}],
}])
const costBudgetResource = new datadog.CostBudget("costBudgetResource", {
endMonth: 0,
metricsQuery: "string",
name: "string",
startMonth: 0,
budgetId: "string",
budgetLines: [{
amounts: {
string: 0,
},
childTagFilters: [{
tagKey: "string",
tagValue: "string",
}],
parentTagFilters: [{
tagKey: "string",
tagValue: "string",
}],
tagFilters: [{
tagKey: "string",
tagValue: "string",
}],
}],
});
type: datadog:CostBudget
properties:
budgetId: string
budgetLines:
- amounts:
string: 0
childTagFilters:
- tagKey: string
tagValue: string
parentTagFilters:
- tagKey: string
tagValue: string
tagFilters:
- tagKey: string
tagValue: string
endMonth: 0
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:
- End
Month int - The month when the budget ends (YYYYMM).
- Metrics
Query 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.
- Start
Month int - The month when the budget starts (YYYYMM).
- Budget
Id string - The ID of the budget.
- Budget
Lines List<CostBudget Budget Line> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - Entries
List<Cost
Budget Entry> - 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 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.
- Start
Month int - The month when the budget starts (YYYYMM).
- Budget
Id string - The ID of the budget.
- Budget
Lines []CostBudget Budget Line Args - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - Entries
[]Cost
Budget Entry Args - 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 Integer - The month when the budget ends (YYYYMM).
- metrics
Query 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.
- start
Month Integer - The month when the budget starts (YYYYMM).
- budget
Id String - The ID of the budget.
- budget
Lines List<CostBudget Budget Line> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - entries
List<Cost
Budget Entry> - 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 number - The month when the budget ends (YYYYMM).
- metrics
Query 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.
- start
Month number - The month when the budget starts (YYYYMM).
- budget
Id string - The ID of the budget.
- budget
Lines CostBudget Budget Line[] - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - entries
Cost
Budget Entry[] - 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.
- budget_
lines Sequence[CostBudget Budget Line Args] - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - entries
Sequence[Cost
Budget Entry Args] - 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 Number - The month when the budget ends (YYYYMM).
- metrics
Query 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.
- start
Month Number - The month when the budget starts (YYYYMM).
- budget
Id String - The ID of the budget.
- budget
Lines List<Property Map> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - 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.
- Total
Amount double - The sum of all budget entries' amounts.
- Id string
- The provider-assigned unique ID for this managed resource.
- Total
Amount float64 - The sum of all budget entries' amounts.
- id String
- The provider-assigned unique ID for this managed resource.
- total
Amount Double - The sum of all budget entries' amounts.
- id string
- The provider-assigned unique ID for this managed resource.
- total
Amount 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.
- total
Amount 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,
budget_lines: Optional[Sequence[CostBudgetBudgetLineArgs]] = 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) -> CostBudgetfunc 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.
- Budget
Id string - The ID of the budget.
- Budget
Lines List<CostBudget Budget Line> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - End
Month int - The month when the budget ends (YYYYMM).
- Entries
List<Cost
Budget Entry> - 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 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.
- Start
Month int - The month when the budget starts (YYYYMM).
- Total
Amount double - The sum of all budget entries' amounts.
- Budget
Id string - The ID of the budget.
- Budget
Lines []CostBudget Budget Line Args - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - End
Month int - The month when the budget ends (YYYYMM).
- Entries
[]Cost
Budget Entry Args - 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 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.
- Start
Month int - The month when the budget starts (YYYYMM).
- Total
Amount float64 - The sum of all budget entries' amounts.
- budget
Id String - The ID of the budget.
- budget
Lines List<CostBudget Budget Line> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - end
Month Integer - The month when the budget ends (YYYYMM).
- entries
List<Cost
Budget Entry> - 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 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.
- start
Month Integer - The month when the budget starts (YYYYMM).
- total
Amount Double - The sum of all budget entries' amounts.
- budget
Id string - The ID of the budget.
- budget
Lines CostBudget Budget Line[] - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - end
Month number - The month when the budget ends (YYYYMM).
- entries
Cost
Budget Entry[] - 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 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.
- start
Month number - The month when the budget starts (YYYYMM).
- total
Amount number - The sum of all budget entries' amounts.
- budget_
id str - The ID of the budget.
- budget_
lines Sequence[CostBudget Budget Line Args] - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - end_
month int - The month when the budget ends (YYYYMM).
- entries
Sequence[Cost
Budget Entry Args] - 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.
- budget
Id String - The ID of the budget.
- budget
Lines List<Property Map> - Budget lines that group monthly amounts by tag combination. Use this instead of
entriesfor a more convenient schema. Note: The order of budget*line blocks does not matter. - end
Month 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.
- metrics
Query 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.
- start
Month Number - The month when the budget starts (YYYYMM).
- total
Amount Number - The sum of all budget entries' amounts.
Supporting Types
CostBudgetBudgetLine, CostBudgetBudgetLineArgs
- Amounts Dictionary<string, double>
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- Child
Tag List<CostFilters Budget Budget Line Child Tag Filter> - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- Parent
Tag List<CostFilters Budget Budget Line Parent Tag Filter> - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- Tag
Filters List<CostBudget Budget Line Tag Filter> - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
- Amounts map[string]float64
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- Child
Tag []CostFilters Budget Budget Line Child Tag Filter - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- Parent
Tag []CostFilters Budget Budget Line Parent Tag Filter - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- Tag
Filters []CostBudget Budget Line Tag Filter - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
- amounts Map<String,Double>
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- child
Tag List<CostFilters Budget Budget Line Child Tag Filter> - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- parent
Tag List<CostFilters Budget Budget Line Parent Tag Filter> - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- tag
Filters List<CostBudget Budget Line Tag Filter> - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
- amounts {[key: string]: number}
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- child
Tag CostFilters Budget Budget Line Child Tag Filter[] - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- parent
Tag CostFilters Budget Budget Line Parent Tag Filter[] - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- tag
Filters CostBudget Budget Line Tag Filter[] - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
- amounts Mapping[str, float]
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- child_
tag_ Sequence[Costfilters Budget Budget Line Child Tag Filter] - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- parent_
tag_ Sequence[Costfilters Budget Budget Line Parent Tag Filter] - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- tag_
filters Sequence[CostBudget Budget Line Tag Filter] - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
- amounts Map<Number>
- Map of month (YYYYMM) to budget amount. Example: {"202601": 1000.0, "202602": 1200.0}
- child
Tag List<Property Map>Filters - Child tag filters for hierarchical budgets. Note: Must be used with parenttagfilters. Cannot be used with tag*filters.
- parent
Tag List<Property Map>Filters - Parent tag filters for hierarchical budgets. Note: Must be used with childtagfilters. Cannot be used with tag*filters.
- tag
Filters List<Property Map> - Tag filters for non-hierarchical budgets. Note: Cannot be used with parenttagfilters/childtagfilters.
CostBudgetBudgetLineChildTagFilter, CostBudgetBudgetLineChildTagFilterArgs
CostBudgetBudgetLineParentTagFilter, CostBudgetBudgetLineParentTagFilterArgs
CostBudgetBudgetLineTagFilter, CostBudgetBudgetLineTagFilterArgs
CostBudgetEntry, CostBudgetEntryArgs
- Amount float64
- Month int
- Tag
Filters []CostBudget Entry Tag Filter
- amount Double
- month Integer
- tag
Filters List<CostBudget Entry Tag Filter>
- amount number
- month number
- tag
Filters CostBudget Entry Tag Filter[]
- amount Number
- month Number
- tag
Filters List<Property Map>
CostBudgetEntryTagFilter, CostBudgetEntryTagFilterArgs
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
datadogTerraform Provider.
published on Wednesday, Feb 25, 2026 by Pulumi
