Terraform -- Pause/Unpause Clusters via TF

We have been asked to create a process to pause/unpause MongoDB Clusters programmatically via Terraform. Does the current implementation in Terraform allow this

Otherwise, is there a clean way to do this via the API?

Hi @Thomas_Tenner,

Welcome to the MongoDB Community!

Does the current implementation in Terraform allow this

Currently you will not be able to pause / unpause an Atlas cluster via terraform. I believe this may be due to unknowns of how the state file will handle the automatic resume of a paused cluster after 30 days in Atlas.

Otherwise, is there a clean way to do this via the API?

Have you tried using the Atlas API changing the paused boolean value within the request body parameters to true (to pause) or false (to unpause)? The documents do note the following in regards to pausing / paused clusters:

You can’t modify a paused cluster other than to resume the cluster. Nor can you pause a cluster with pending changes.

Hope this helps.

Kind Regards,
Jason

1 Like