From b27000b33a7a7e34e1e2c6ca05ccb776620b9555 Mon Sep 17 00:00:00 2001 From: Riley Snyder Date: Mon, 31 Jul 2023 16:51:00 -0500 Subject: [PATCH] fix: azure ccm connector no billing export (#637) Co-authored-by: K Rohit Reddy --- .../platform/connector/azure_cloud_cost.go | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/platform/connector/azure_cloud_cost.go b/internal/service/platform/connector/azure_cloud_cost.go index 6cc368067..7cd8a5fb7 100644 --- a/internal/service/platform/connector/azure_cloud_cost.go +++ b/internal/service/platform/connector/azure_cloud_cost.go @@ -164,15 +164,17 @@ func readConnectorAzureCloudCost(d *schema.ResourceData, connector *nextgen.Conn d.Set("features_enabled", connector.AzureCloudCost.FeaturesEnabled) d.Set("tenant_id", connector.AzureCloudCost.TenantId) d.Set("subscription_id", connector.AzureCloudCost.SubscriptionId) - d.Set("billing_export_spec", []interface{}{ - map[string]interface{}{ - "storage_account_name": connector.AzureCloudCost.BillingExportSpec.StorageAccountName, - "container_name": connector.AzureCloudCost.BillingExportSpec.ContainerName, - "directory_name": connector.AzureCloudCost.BillingExportSpec.DirectoryName, - "report_name": connector.AzureCloudCost.BillingExportSpec.ReportName, - "subscription_id": connector.AzureCloudCost.BillingExportSpec.SubscriptionId, - }, - }) + if isFeatureEnabled("BILLING", connector.AzureCloudCost.FeaturesEnabled) { + d.Set("billing_export_spec", []interface{}{ + map[string]interface{}{ + "storage_account_name": connector.AzureCloudCost.BillingExportSpec.StorageAccountName, + "container_name": connector.AzureCloudCost.BillingExportSpec.ContainerName, + "directory_name": connector.AzureCloudCost.BillingExportSpec.DirectoryName, + "report_name": connector.AzureCloudCost.BillingExportSpec.ReportName, + "subscription_id": connector.AzureCloudCost.BillingExportSpec.SubscriptionId, + }, + }) + } return nil }