diff --git a/azure/table_azure_cosmosdb_mongo_collection.go b/azure/table_azure_cosmosdb_mongo_collection.go index 581fbd88..8a561fa0 100644 --- a/azure/table_azure_cosmosdb_mongo_collection.go +++ b/azure/table_azure_cosmosdb_mongo_collection.go @@ -341,10 +341,12 @@ func mapCollectionThroughputSettings(result documentdb.ThroughputSettingsGetResu data.AutoscaleSettingsMaxThroughput = *result.Resource.AutoscaleSettings.MaxThroughput } - if result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy != nil { - data.AutoscaleSettingsThroughputPolicy = documentdb.ThroughputPolicyResource{ - IsEnabled: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IsEnabled, - IncrementPercent: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IncrementPercent, + if result.Resource.AutoscaleSettings.AutoUpgradePolicy != nil { + if result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy != nil { + data.AutoscaleSettingsThroughputPolicy = documentdb.ThroughputPolicyResource{ + IsEnabled: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IsEnabled, + IncrementPercent: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IncrementPercent, + } } } diff --git a/azure/table_azure_cosmosdb_mongo_database.go b/azure/table_azure_cosmosdb_mongo_database.go index 83ff66b0..688d5b91 100644 --- a/azure/table_azure_cosmosdb_mongo_database.go +++ b/azure/table_azure_cosmosdb_mongo_database.go @@ -288,10 +288,12 @@ func mapThroughputSettings(result documentdb.ThroughputSettingsGetResults) *Thro data.AutoscaleSettingsMaxThroughput = *result.Resource.AutoscaleSettings.MaxThroughput } - if result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy != nil { - data.AutoscaleSettingsThroughputPolicy = documentdb.ThroughputPolicyResource{ - IsEnabled: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IsEnabled, - IncrementPercent: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IncrementPercent, + if result.Resource.AutoscaleSettings.AutoUpgradePolicy != nil { + if result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy != nil { + data.AutoscaleSettingsThroughputPolicy = documentdb.ThroughputPolicyResource{ + IsEnabled: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IsEnabled, + IncrementPercent: result.Resource.AutoscaleSettings.AutoUpgradePolicy.ThroughputPolicy.IncrementPercent, + } } }