Skip to content

INTMDB-472: Update_snapshots doesn't save at TF state with mongodbatlas_cloud_backup_schedule resource #1014

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 3 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ func resourceMongoDBAtlasCloudBackupScheduleRead(ctx context.Context, d *schema.
return diag.Errorf(errorSnapshotBackupScheduleSetting, "restore_window_days", clusterName, err)
}

if err := d.Set("update_snapshots", backupPolicy.UpdateSnapshots); err != nil {
return diag.Errorf(errorSnapshotBackupScheduleSetting, "update_snapshots", clusterName, err)
}

if err := d.Set("next_snapshot", backupPolicy.NextSnapshot); err != nil {
return diag.Errorf(errorSnapshotBackupScheduleSetting, "next_snapshot", clusterName, err)
}
Expand Down
5 changes: 4 additions & 1 deletion website/docs/r/cloud_backup_schedule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ resource "mongodbatlas_cloud_backup_schedule" "test" {
* `reference_hour_of_day` - (Optional) UTC Hour of day between 0 and 23, inclusive, representing which hour of the day that Atlas takes snapshots for backup policy items.
* `reference_minute_of_hour` - (Optional) UTC Minutes after `reference_hour_of_day` that Atlas takes snapshots for backup policy items. Must be between 0 and 59, inclusive.
* `restore_window_days` - (Optional) Number of days back in time you can restore to with point-in-time accuracy. Must be a positive, non-zero integer.
* `update_snapshots` - (Optional) Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.
* `update_snapshots` - (Optional) Specify true to apply the retention changes in the updated backup policy to snapshots that Atlas took previously.

**Note** This parameter does not return updates on return from API, this is a feature of the MongoDB Atlas Admin API itself and not Terraform. For more details about this resource see: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backup-Schedule

* `policy_item_hourly` - (Optional) Hourly policy item
* `policy_item_daily` - (Optional) Daily policy item
* `policy_item_weekly` - (Optional) Weekly policy item
Expand Down