Closed vrej-abramian closed 8 months ago
Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:
The ticket INTMDB-1228 was created for internal tracking.
I have found out that the only workaround for successful termination is to:
Update the mongodbatlas_cloud_backup_schedule
resource code snippet and set auto_export_enabled
to false
like below:
resource "mongodbatlas_cloud_backup_schedule" "cluster1" {
count = var.custom_backup_policy ? 1 : 0
project_id = mongodbatlas_cluster.cluster1.project_id
cluster_name = mongodbatlas_cluster.cluster1.name
reference_hour_of_day = var.mcbs.reference_hour_of_day
reference_minute_of_hour = var.mcbs.reference_minute_of_hour
restore_window_days = var.mcbs.restore_window_days
#auto_export_enabled = var.auto_export_enabled ? var.auto_export_enabled : false
auto_export_enabled = false
...
terraform apply
to implement the change.terraform destroy
will destroy all resources smoothly.This is not documented in https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule or https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples/atlas-cloud-backup-schedule.
Also, it is a blocker for automated pipelines that run terraform apply
, run some tests, and then terraform destroy
.
Any solutions/fixes on this would be appreciated.
Thanks since you're unblocked going to resolve this issue, feel free to open another item incase you should need anything. thanks again!
Hello,
terraform apply
works fine and deploys all resources, but on runningterraform destroy
fails to destroy the resource and stuck onStill destroying...
as you may see in the following:Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Steps to Reproduce
Run the following and wait for all resources to be created.
Run the following to destroy resources and you will observe that it will stuck!
Expected Behavior
Destroying all the created resources successfully.
Actual Behavior
Fails to destroy the
mongodbatlas_cloud_backup_snapshot_export_bucket.cluster1[0]
resource and stuck onStill destroying...
as you may see in the following:Debug Output
Not available.
Crash Output
Not available.
Additional Context
I have attempted to remove all the
count = ...
and[count.index]
implementations from the code, but no luck.The only workaround I could use to destroy was going to MongoDB Atlas UI,
Edit config
of the relevant cluster, and disable the Cloud Backup so that within a few seconds (or on the nextterraform destroy
) it succeeds to destroy the stuck resource as well as all other remaining ones.References