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 Completed
Categories Atlas
Created by Guest
Created on Jul 2, 2020

Possibility to change 'frequency_type' of snapshot backup policy item via Terraform

Hi, I’m facing an issue about Snapshot Backup Policy creation/modification via Terraform ( FYI, I open a case to the support of MongoDB  https://support.mongodb.com/case/00668262). Let me explain : When I want to create a MongoAtlas Cluster via terraform, I want to apply a custom Snahsphot Backup Policy with ONLY 2 items during the creation of the cluster : N° Item Frequency type Frequency Retention 0 Daily 1 7 Days 1 Weekly 1 (Saturday) 4 weeks However, during the creation of the mongo atlas cluster, I can see an error Error: Error applying plan: 1 error occurred: * module.cluster_contrib.module.dpjmongoatlas.module.tfmodule-gcp-mongo-atlas-cluster.mongodbatlas_cloud_provider_snapshot_backup_policy.snapshot_backup: 1 error occurred: * mongodbatlas_cloud_provider_snapshot_backup_policy.snapshot_backup: error updating a Cloud Provider Snapshot Backup Policy: PATCH https://cloud.mongodb.com/api/atlas/v1.0/groups/XXXXXXXXXXXXXXXXX/clusters/contrib/backup/schedule: 400 (request "Bad Request") The frequency type of a policy item must not be changed. Indeed, during the creation of the MongoAtlas cluster, MongoAtlas apply the default Snapshot Backup Policy first (with 4 items hourly, daily, weekly, monthly) and after try to apply the custom snapshot backup policy I want (described in the terraform code). But, as we can see above, it seems impossible to change the frequency_type of an existing policy’s item… To resume clearly with this spreadsheet : N° Item Frequency_type of default policy Frequency_type of custom policy I want COMMENT 0 Hourly Daily KO (because The frequency type of a policy item must not be changed) 1 Daily Weekly KO (because The frequency type of a policy item must not be changed) 2 Weekly NOTHING 3 Monthly NOTHING Can we purpose a evolution to have the possibilty to modify the frequency_type of an existing policy item via Terraform/API? Regards,
  • ADMIN RESPONSE
    Oct 18, 2025
    The Cloud Backup policy has been completely reworked as of provider version 1.0.0, with a few more fixes in 1.0.1 (coming shortly). This should address the pain points that have been raised here and elsewhere.
  • Guest
    Feb 4, 2021
    Want to update those voting here - we've discussed how the cloud backup policy was implemented and due to feedback plan to re-architect it. Will continue to provide updates as we get closer to that work. Thank you!
  • Guest
    Aug 4, 2020
    Thank you for posting your feedback. Based on this and other feedback we've updated the documentation with better examples of how to modify the backup policy, which will go out with our next release. However you can see the PR here: https://github.com/mongodb/terraform-provider-mongodbatlas/pull/259/files. If you have a chance to check it out we'd appreciate feedback!