Budget
A budget resource. API Version: 2019-10-01.
Example Usage
CreateOrUpdateBudget
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var budget = new AzureNative.Consumption.Budget("budget", new()
{
Amount = 100.65,
BudgetName = "TestBudget",
Category = "Cost",
ETag = "\"1d34d016a593709\"",
Filter = new AzureNative.Consumption.Inputs.BudgetFilterArgs
{
And = new[]
{
new AzureNative.Consumption.Inputs.BudgetFilterPropertiesArgs
{
Dimensions = new AzureNative.Consumption.Inputs.BudgetComparisonExpressionArgs
{
Name = "ResourceId",
Operator = "In",
Values = new[]
{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1",
},
},
},
new AzureNative.Consumption.Inputs.BudgetFilterPropertiesArgs
{
Tags = new AzureNative.Consumption.Inputs.BudgetComparisonExpressionArgs
{
Name = "category",
Operator = "In",
Values = new[]
{
"Dev",
"Prod",
},
},
},
new AzureNative.Consumption.Inputs.BudgetFilterPropertiesArgs
{
Tags = new AzureNative.Consumption.Inputs.BudgetComparisonExpressionArgs
{
Name = "department",
Operator = "In",
Values = new[]
{
"engineering",
"sales",
},
},
},
},
},
Notifications =
{
{ "Actual_GreaterThan_80_Percent", new AzureNative.Consumption.Inputs.NotificationArgs
{
ContactEmails = new[]
{
"johndoe@contoso.com",
"janesmith@contoso.com",
},
ContactGroups = new[]
{
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup",
},
ContactRoles = new[]
{
"Contributor",
"Reader",
},
Enabled = true,
Locale = "en-us",
Operator = "GreaterThan",
Threshold = 80,
ThresholdType = "Actual",
} },
},
Scope = "subscriptions/00000000-0000-0000-0000-000000000000",
TimeGrain = "Monthly",
TimePeriod = new AzureNative.Consumption.Inputs.BudgetTimePeriodArgs
{
EndDate = "2018-10-31T00:00:00Z",
StartDate = "2017-10-01T00:00:00Z",
},
});
});
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.consumption.Budget;
import com.pulumi.azurenative.consumption.BudgetArgs;
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 budget = new Budget("budget", BudgetArgs.builder()
.amount(100.65)
.budgetName("TestBudget")
.category("Cost")
.eTag("\"1d34d016a593709\"")
.filter(Map.of("and",
Map.of("dimensions", Map.ofEntries(
Map.entry("name", "ResourceId"),
Map.entry("operator", "In"),
Map.entry("values",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2",
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1")
)),
Map.of("tags", Map.ofEntries(
Map.entry("name", "category"),
Map.entry("operator", "In"),
Map.entry("values",
"Dev",
"Prod")
)),
Map.of("tags", Map.ofEntries(
Map.entry("name", "department"),
Map.entry("operator", "In"),
Map.entry("values",
"engineering",
"sales")
))))
.notifications(Map.of("Actual_GreaterThan_80_Percent", Map.ofEntries(
Map.entry("contactEmails",
"johndoe@contoso.com",
"janesmith@contoso.com"),
Map.entry("contactGroups", "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup"),
Map.entry("contactRoles",
"Contributor",
"Reader"),
Map.entry("enabled", true),
Map.entry("locale", "en-us"),
Map.entry("operator", "GreaterThan"),
Map.entry("threshold", 80),
Map.entry("thresholdType", "Actual")
)))
.scope("subscriptions/00000000-0000-0000-0000-000000000000")
.timeGrain("Monthly")
.timePeriod(Map.ofEntries(
Map.entry("endDate", "2018-10-31T00:00:00Z"),
Map.entry("startDate", "2017-10-01T00:00:00Z")
))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:consumption:Budget TestBudget subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/TestBudget
Content copied to clipboard
Properties
Link copied to clipboard
The current amount of cost which is being tracked for a budget.
Link copied to clipboard
May be used to filter budgets by user-specified dimensions and/or tags.
Link copied to clipboard
The forecasted cost which is being tracked for a budget.
Link copied to clipboard
Dictionary of notifications associated with the budget. Budget can have up to five notifications.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Has start and end date of the budget. The start date must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date.