diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go index bf8f3446bf..573ab203fd 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go @@ -451,17 +451,19 @@ func cloudBackupScheduleCreateOrUpdate(ctx context.Context, conn *matlas.Client, } } + if d.HasChange("auto_export_enabled") { + req.AutoExportEnabled = pointy.Bool(d.Get("auto_export_enabled").(bool)) + } + if v, ok := d.GetOk("export"); ok { item := v.([]interface{}) itemObj := item[0].(map[string]interface{}) export.ExportBucketID = itemObj["export_bucket_id"].(string) export.FrequencyType = itemObj["frequency_type"].(string) - - req.Export = &export - } - - if d.HasChange("auto_export_enabled") { - req.AutoExportEnabled = pointy.Bool(d.Get("auto_export_enabled").(bool)) + req.Export = nil + if *req.AutoExportEnabled { + req.Export = &export + } } policy.ID = resp.Policies[0].ID diff --git a/mongodbatlas/resource_mongodbatlas_project.go b/mongodbatlas/resource_mongodbatlas_project.go index 0ee585e8fc..6b3db7fad1 100644 --- a/mongodbatlas/resource_mongodbatlas_project.go +++ b/mongodbatlas/resource_mongodbatlas_project.go @@ -416,13 +416,13 @@ func resourceMongoDBAtlasProjectDelete(ctx context.Context, d *schema.ResourceDa } /* - This assumes the project CRUD outcome will be the same for any non-zero number of dependents +This assumes the project CRUD outcome will be the same for any non-zero number of dependents - If all dependents are deleting, wait to try and delete - Else consider the aggregate dependents idle. +If all dependents are deleting, wait to try and delete +Else consider the aggregate dependents idle. - If we get a defined error response, return that right away - Else retry +If we get a defined error response, return that right away +Else retry */ func resourceProjectDependentsDeletingRefreshFunc(ctx context.Context, projectID string, client *matlas.Client) resource.StateRefreshFunc { return func() (interface{}, string, error) {