Skip to content

Commit

Permalink
INTMDB-472: Update_snapshots doesn't save at TF state with mongodbatl…
Browse files Browse the repository at this point in the history
…as_cloud_backup_schedule resource (#1014)

* skip update_snapshots on read as API does not return current value

* Doc update

* Update website/docs/r/cloud_backup_schedule.html.markdown

Co-authored-by: Zuhair Ahmed <[email protected]>
  • Loading branch information
martinstibbe and Zuhairahmed authored Jan 19, 2023
1 parent 3eecb33 commit 5ad90c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit 5ad90c1

Please sign in to comment.