I cannot find a way to add a filter creating a view using azurerm_subscription_cost_management_view
via Terraform
I tried using the dataset
grouping . But it's a way for grouping, not filtering.
resource "azurerm_subscription_cost_management_view" "example" {
name = "TerraformCostView"
display_name = "Terraform - Cost View"
subscription_id = "/subscriptions/${var.subscription_id}"
chart_type = "Area"
accumulated = true
report_type = "Usage"
timeframe = "MonthToDate"
dataset {
granularity = "Monthly"
aggregation {
name = "totalCost"
column_name = "Cost"
}
#grouping {
# name = "department"
# type = "TagKey"
#}
}
pivot {
name = "ServiceName"
type = "Dimension"
}
pivot {
name = "ResourceType"
type = "Dimension"
}
pivot {
name = "ResourceGroupName"
type = "Dimension"
}
}
How can I add a filter to the view?
Thanks!
Answering mysef. It can be done using
azapi_resource
. Example: