hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

Support for billing data export behind firewall #25875

Open mlomat opened 6 months ago

mlomat commented 6 months ago

Is there an existing issue for this?

Community Note

Description

Hello,

Microsoft is now supporting on new API version Identity and allowing to assign permissions on management instance + allowing to access storage behind firewall. More details here -> https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-export-acm-data?tabs=azure-portal

Could you please add support for manage identity?

Thanks!

New or Affected Resource(s)/Data Source(s)

azurerm_billing_account_cost_management_export

Potential Terraform Configuration

resource "azurerm_billing_account_cost_management_export" "Daily_MonthToDate" {
  name                         = "MonthToDate"
  billing_account_id           = var.billing_account_id
  recurrence_type              = "Daily"
  recurrence_period_start_date = local.start_time
  recurrence_period_end_date   = "2030-09-20T00:00:00Z"

  export_data_storage_location {
    container_id     = azurerm_storage_container.cost_data.resource_manager_id
    root_folder_path = "daily"
  }

  export_data_options {
    type       = "ActualCost"
    time_frame = "MonthToDate"
  }

  identity = {
    type = "SystemAssigned"
  }

}

References

https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-export-acm-data?tabs=azure-portal

https://learn.microsoft.com/en-us/rest/api/cost-management/exports/create-or-update?view=rest-cost-management-2023-11-01&tabs=HTTP#systemassignedserviceidentity

singh-mandeep93 commented 1 month ago

Hi can you please plans this for early release. We are currently stuck due to this unavailability. We are trying create an export with storage account behind firewall.