It has been confirmed by MongoDB support, that in Atlas, there is no way to know the last point in time you can recover a cluster to using OpsLogs. Surely this is an oversight, as we should be able to tell, from the backup material available, what point in time we can recover to, and not just from.
I need to automate a restoration of a cluster into another cluster in another project in a second region. I copy backup material, including OpsLogs, to that region. I would like to be able to use Terraform to get the Unix Timestamp, matching the input of creating a restore job, based upon the backup material in the second region. I imagine it would look something like this:
data "mongodbatlas_cloud_pit_recovery_window" "example" {
project_id = var.project_id
cluster_name = var.cluster_name
copy_region_name = var.copy_region_name
}
Project ID and Cluster Name are self explanatory and mandatory, but copy_region_name would be optional and relate to the specific region hosting the backup material.
The outputs would be something along the lines of:
earliest_restore_point_utc
earliest_restore_point_unix # Because you require this to create restore jobs
earliest_snapshot_id # Because you require this to create restore jobs
latest_restore_point_utc
latest_restore_point_unix # Because you require this to create restore jobs
latest_snapshot_id # Because you require this to create restore jobs