Skip to content

INTMDB-381: Add support to ignore export bucket when auto_export_enabled = false #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,17 +451,20 @@ 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))
if *req.AutoExportEnabled {
req.Export = &export
} else {
req.Export = nil
}
}

policy.ID = resp.Policies[0].ID
Expand Down