Subscription Cost Management View Args
Manages an Azure Cost Management View for a Subscription.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.SubscriptionCostManagementView("example", {
name: "example",
displayName: "Cost View per Month",
chartType: "StackedColumn",
accumulated: false,
subscriptionId: "/subscription/00000000-0000-0000-0000-000000000000",
reportType: "Usage",
timeframe: "MonthToDate",
dataset: {
granularity: "Monthly",
aggregations: [{
name: "totalCost",
columnName: "Cost",
}],
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.SubscriptionCostManagementView("example",
name="example",
display_name="Cost View per Month",
chart_type="StackedColumn",
accumulated=False,
subscription_id="/subscription/00000000-0000-0000-0000-000000000000",
report_type="Usage",
timeframe="MonthToDate",
dataset={
"granularity": "Monthly",
"aggregations": [{
"name": "totalCost",
"column_name": "Cost",
}],
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.SubscriptionCostManagementView("example", new()
{
Name = "example",
DisplayName = "Cost View per Month",
ChartType = "StackedColumn",
Accumulated = false,
SubscriptionId = "/subscription/00000000-0000-0000-0000-000000000000",
ReportType = "Usage",
Timeframe = "MonthToDate",
Dataset = new Azure.Core.Inputs.SubscriptionCostManagementViewDatasetArgs
{
Granularity = "Monthly",
Aggregations = new[]
{
new Azure.Core.Inputs.SubscriptionCostManagementViewDatasetAggregationArgs
{
Name = "totalCost",
ColumnName = "Cost",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := core.NewSubscriptionCostManagementView(ctx, "example", &core.SubscriptionCostManagementViewArgs{
Name: pulumi.String("example"),
DisplayName: pulumi.String("Cost View per Month"),
ChartType: pulumi.String("StackedColumn"),
Accumulated: pulumi.Bool(false),
SubscriptionId: pulumi.String("/subscription/00000000-0000-0000-0000-000000000000"),
ReportType: pulumi.String("Usage"),
Timeframe: pulumi.String("MonthToDate"),
Dataset: &core.SubscriptionCostManagementViewDatasetArgs{
Granularity: pulumi.String("Monthly"),
Aggregations: core.SubscriptionCostManagementViewDatasetAggregationArray{
&core.SubscriptionCostManagementViewDatasetAggregationArgs{
Name: pulumi.String("totalCost"),
ColumnName: pulumi.String("Cost"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.SubscriptionCostManagementView;
import com.pulumi.azure.core.SubscriptionCostManagementViewArgs;
import com.pulumi.azure.core.inputs.SubscriptionCostManagementViewDatasetArgs;
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 example = new SubscriptionCostManagementView("example", SubscriptionCostManagementViewArgs.builder()
.name("example")
.displayName("Cost View per Month")
.chartType("StackedColumn")
.accumulated(false)
.subscriptionId("/subscription/00000000-0000-0000-0000-000000000000")
.reportType("Usage")
.timeframe("MonthToDate")
.dataset(SubscriptionCostManagementViewDatasetArgs.builder()
.granularity("Monthly")
.aggregations(SubscriptionCostManagementViewDatasetAggregationArgs.builder()
.name("totalCost")
.columnName("Cost")
.build())
.build())
.build());
}
}
resources:
example:
type: azure:core:SubscriptionCostManagementView
properties:
name: example
displayName: Cost View per Month
chartType: StackedColumn
accumulated: false
subscriptionId: /subscription/00000000-0000-0000-0000-000000000000
reportType: Usage
timeframe: MonthToDate
dataset:
granularity: Monthly
aggregations:
- name: totalCost
columnName: Cost
API Providers
This resource uses the following Azure API Providers:
Microsoft.CostManagement
: 2023-08-01
Import
Cost Management View for a Subscriptions can be imported using the resource id
, e.g.
$ pulumi import azure:core/subscriptionCostManagementView:SubscriptionCostManagementView example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/costmanagementview
Constructors
Properties
Whether the costs data in the Cost Management View are accumulated over time. Changing this forces a new Cost Management View for a Subscription to be created.
A dataset
block as defined below.
User visible input name of the Cost Management View.
One or more kpi
blocks as defined below, to show in Cost Analysis UI.
One or more pivot
blocks as defined below, containing the configuration of 3 sub-views in the Cost Analysis UI. Non table views should have three pivots.
The type of the report. The only possible value is Usage
.
The ID of the Subscription this View is scoped to. Changing this forces a new Cost Management View for a Subscription to be created.