diff --git a/internal/services/cosmos/common/autoscale_settings.go b/internal/services/cosmos/common/autoscale_settings.go index 9d8eded444db..c8e3644b21bb 100644 --- a/internal/services/cosmos/common/autoscale_settings.go +++ b/internal/services/cosmos/common/autoscale_settings.go @@ -55,8 +55,12 @@ func FlattenCosmosDbAutoscaleSettings(throughputResponse documentdb.ThroughputSe func ExpandCosmosDbAutoscaleSettingsResource(d *pluginsdk.ResourceData) *documentdb.AutoscaleSettingsResource { autoscaleSettings := ExpandCosmosDbAutoscaleSettings(d) - autoscaleSettingResource := documentdb.AutoscaleSettingsResource{} - autoscaleSettingResource.MaxThroughput = autoscaleSettings.MaxThroughput - return &autoscaleSettingResource + if autoscaleSettings == nil { + return nil + } + + return &documentdb.AutoscaleSettingsResource{ + MaxThroughput: autoscaleSettings.MaxThroughput, + } }