azurerm_resource_group_cost_management_view

Manages an Azure Cost Management View for a Resource Group.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_resource_group_cost_management_view" "example" {
  name         = "example"
  display_name = "Cost View per Month"
  chart_type   = "StackedColumn"
  accumulated  = false

  resource_group_id = azurerm_resource_group.example.id

  report_type = "Usage"
  timeframe   = "MonthToDate"

  dataset {
    granularity = "Monthly"
    aggregation {
      name        = "totalCost"
      column_name = "Cost"
    }
  }
}

Arguments Reference

The following arguments are supported:



A aggregation block supports the following:


A dataset block supports the following:


A grouping block supports the following:


A kpi block supports the following:


A pivot block supports the following:


A sorting block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Cost Management View for a Resource Groups can be imported using the resource id, e.g.

terraform import azurerm_resource_group_cost_management_view.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.CostManagement/views/costmanagementview