Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas
Created by Guest
Created on Jul 20, 2023

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 "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
  • Guest
    Jul 20, 2023
    You don't accept _ as a literal, so it looks wrong, but that's because of markup.