mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
242 stars 168 forks source link

Point in Time Restore is not enabled when `should_copy_oplogs` is set to `true`, when copying backups to other regions #1134

Closed ericdalling closed 1 year ago

ericdalling commented 1 year ago

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform v1.3.7
MongoDB Atlas Provider v.1.8.2

Terraform Configuration File

resource "mongodbatlas_cloud_backup_schedule" "cluster_backup_schedule" {
  project_id   = var.mongodb_project_id
  cluster_name = var.mongodb_cluster_name

  copy_settings {
    cloud_provider = "AWS"
    frequencies = [
      "HOURLY",
      "DAILY",
      "WEEKLY",
      "MONTHLY",
      "ON_DEMAND",
    ]
    region_name         = "US_EAST_1"
    replication_spec_id = module.cluster.replication_specs.*.id[0]
    should_copy_oplogs  = true
  }
}

Steps to Reproduce

  1. terraform init
  2. terraform apply

Expected Behavior

After running apply, the backup schedule should be modified to copy the back to a 2nd region and enable Point In Time Restore, because we have set the should_copy_oplogs = true in the copy_settings block.

Actual Behavior

The copy to another region has been enabled for the desired snapshots, but Point In Time Restore say No, when it should be Yes

Debug Output

Crash Output

Additional Context

image

References

Documentation for the should_copy_oplogs: https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule#should_copy_oplogs

Zuhairahmed commented 1 year ago

Thanks @ericdalling we are investing and will revert back shortly

martinstibbe commented 1 year ago

@ericdalling This is a valid bug will be fixed in internal engineering ticket INTMDB-783

ericdalling commented 1 year ago

Thanks for the update! I recommend updating your docs for the copy_settings block as well. It only shows up in an example but not in the Argument Reference section.

Zuhairahmed commented 1 year ago

hi @ericdalling we have released fix to this issue as part of v1.10.0 release. can you test and let us know if this issue has been resolved?

Zuhairahmed commented 1 year ago

Closing issue since this has been resolved and feel free to open a new issue in case you need anything else. thank you.