Terraform data source for Point in Time Recovery
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 "mongodbatlascloudpitrecoverywindow" "example" {
projectid = var.projectid
clustername = var.clustername
copyregionname = var.copyregionname
}
Project ID and Cluster Name are self explanatory and mandatory, but copyregionname would be optional and relate to the specific region hosting the backup material.
The outputs would be something along the lines of:
earliestrestorepointutc
earliestrestorepointunix # Because you require this to create restore jobs
earliestsnapshotid # Because you require this to create restore jobs
latestrestorepointutc
latestrestorepointunix # Because you require this to create restore jobs
latestsnapshotid # Because you require this to create restore jobs
-
Dave Fournier commented
You don't accept _ as a literal, so it looks wrong, but that's because of markup.