From 8621849bf41af078c8b4cdbb2528824a73519344 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 12:06:40 -0500 Subject: [PATCH 01/16] Update backup_compliance_policy.html.markdown Doc Fix related HELP-53760. Offers alternative approaches to help unblock customers when they are unable to delete cluster and backup schedule with backup compliance policy enabled --- website/docs/r/backup_compliance_policy.html.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index e9fa49d210..06cd0356a4 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -17,6 +17,15 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** With Backup Compliance Policy enabled, cluster backups are retained after a cluster is deleted and backups can be used normally until retention expiration. When the Backup Compliance Policy is not enabled, Atlas deletes the cluster's associated backup snapshots when a cluster is terminated. By default, a Backup Compliance Policy is not enabled. For more details see [Back Up, Restore, and Archive Data](https://www.mongodb.com/docs/atlas/backup-restore-cluster/). +-> **NOTE:** If encountering errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource. We suggest the following: +* `mongodbatlas_cloud_backup_schedule` fails during delete because an existing backup compliancy policy is enabled. This error is expected. +We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. +* Second, if this is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefor has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). +* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This would enable deleting the cluster resource first, but requires obtaining values from the state to do the appropriate replacements. +* Lastly, as a final resort taking into account the limitations, we recondmend: + * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy` + * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. + ## Example Usage ```terraform From 21e3e7c298415923a1e36ef239288492c08c71eb Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:46:02 -0500 Subject: [PATCH 02/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 06cd0356a4..127e2c0b19 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -17,7 +17,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** With Backup Compliance Policy enabled, cluster backups are retained after a cluster is deleted and backups can be used normally until retention expiration. When the Backup Compliance Policy is not enabled, Atlas deletes the cluster's associated backup snapshots when a cluster is terminated. By default, a Backup Compliance Policy is not enabled. For more details see [Back Up, Restore, and Archive Data](https://www.mongodb.com/docs/atlas/backup-restore-cluster/). --> **NOTE:** If encountering errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource. We suggest the following: +-> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails during delete because an existing backup compliancy policy is enabled. This error is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if this is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefor has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). From cb161b8bb9c21c895b943e5cd1ce0cec438db522 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:46:28 -0500 Subject: [PATCH 03/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 127e2c0b19..ba4463fd26 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -18,7 +18,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** With Backup Compliance Policy enabled, cluster backups are retained after a cluster is deleted and backups can be used normally until retention expiration. When the Backup Compliance Policy is not enabled, Atlas deletes the cluster's associated backup snapshots when a cluster is terminated. By default, a Backup Compliance Policy is not enabled. For more details see [Back Up, Restore, and Archive Data](https://www.mongodb.com/docs/atlas/backup-restore-cluster/). -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: -* `mongodbatlas_cloud_backup_schedule` fails during delete because an existing backup compliancy policy is enabled. This error is expected. +* `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if this is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefor has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This would enable deleting the cluster resource first, but requires obtaining values from the state to do the appropriate replacements. From eae280abff2b855694d221e7b71d90c229b270f7 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:46:37 -0500 Subject: [PATCH 04/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index ba4463fd26..07af7fc3ad 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -19,7 +19,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. -We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. +We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if this is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefor has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This would enable deleting the cluster resource first, but requires obtaining values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recondmend: From 6f0687ae791042709d1df23edb9543d6496846b3 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:46:47 -0500 Subject: [PATCH 05/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 07af7fc3ad..4bac0c2a13 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -20,7 +20,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. -* Second, if this is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefor has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). +* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This would enable deleting the cluster resource first, but requires obtaining values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recondmend: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy` From fa8a532d4da2ee30fd6cd675a8169170ad3ea4d5 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:46:54 -0500 Subject: [PATCH 06/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 4bac0c2a13..4ee2fa6bfc 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -21,7 +21,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). -* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This would enable deleting the cluster resource first, but requires obtaining values from the state to do the appropriate replacements. +* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recondmend: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy` * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. From 9fdb52a11a02d7822d1077a2bb90288c4676f410 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:47:01 -0500 Subject: [PATCH 07/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 4ee2fa6bfc..d2ed09b5a5 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -22,7 +22,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. -* Lastly, as a final resort taking into account the limitations, we recondmend: +* Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy` * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. From e7f44df31ae7fe65f2e2efaf37584a859efaf30d Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 13:47:07 -0500 Subject: [PATCH 08/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index d2ed09b5a5..09e14a8ba0 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -23,7 +23,7 @@ We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource whic * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: - * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy` + * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. ## Example Usage From 7a818d7d84f4a45346b1b5a5d6625be82ef0821e Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 23:35:59 -0500 Subject: [PATCH 09/16] Update website/docs/r/backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 09e14a8ba0..3b4497e00b 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -20,7 +20,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. -* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster resource` and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). +* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster resource`) and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. From 27226fc3a8fe830fa6da2335cd0b616f95f4defe Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 23:36:05 -0500 Subject: [PATCH 10/16] Update website/docs/r/backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 3b4497e00b..e407f751b0 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -21,7 +21,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster resource`) and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). -* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. +* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster`) resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. From 8adf55118c82b606b9ace7e70376414bd17c4ce8 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 23:36:20 -0500 Subject: [PATCH 11/16] Update website/docs/r/backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index e407f751b0..39790fd327 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -24,7 +24,7 @@ We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource whic * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster`) resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. - * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` or `mongodbatlas_cluster` resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. + * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster`) resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. ## Example Usage From cb0ea5b534335a030d20cc69ef1c236c3206c196 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Tue, 26 Dec 2023 23:38:39 -0500 Subject: [PATCH 12/16] Update backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 39790fd327..39da585a06 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -20,11 +20,11 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. -* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster resource`) and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). -* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster`) resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. +* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). +* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. - * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster` (or `mongodbatlas_cluster`) resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. + * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully. ## Example Usage From 58fbe76a3860b20056f0cc102006e1074e59627f Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Wed, 27 Dec 2023 17:03:50 -0500 Subject: [PATCH 13/16] Update website/docs/r/backup_compliance_policy.html.markdown Co-authored-by: kyuan-mongodb <78768401+kyuan-mongodb@users.noreply.github.com> --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 39da585a06..45a01dcd09 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -19,7 +19,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. -We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource which requires contacting MongoDB Support and completing an extensive verification process. +We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource, which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: From 474408145ddb34473d65e0c766756d129c571f87 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Wed, 27 Dec 2023 17:06:52 -0500 Subject: [PATCH 14/16] Update website/docs/r/backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 45a01dcd09..5f61f9ab0a 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -20,7 +20,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource, which requires contacting MongoDB Support and completing an extensive verification process. -* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` in the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). +* Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` per the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. From 667981cb38c5180591987908a08b02ec2c5f6fc3 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Wed, 27 Dec 2023 17:19:19 -0500 Subject: [PATCH 15/16] Update website/docs/r/backup_compliance_policy.html.markdown --- website/docs/r/backup_compliance_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index 5f61f9ab0a..b3130c8a0c 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -19,7 +19,7 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup -> **NOTE:** If you encounter errors when deleting an Atlas Cluster which has an associated `mongodbatlas_cloud_backup_schedule` resource, we suggest the following: * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. -We first suggest disabling `mongodbatlas_backup_compliancy_policy` resource, which requires contacting MongoDB Support and completing an extensive verification process. +We first suggest disabling `mongodbatlas_backup_compliance_policy` resource, which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` per the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). * Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: From fcf7b8e49d1cf89679876a6b88a1866944a66ec3 Mon Sep 17 00:00:00 2001 From: Zuhair Ahmed Date: Thu, 28 Dec 2023 23:05:37 -0500 Subject: [PATCH 16/16] Update backup_compliance_policy.html.markdown --- .../r/backup_compliance_policy.html.markdown | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/website/docs/r/backup_compliance_policy.html.markdown b/website/docs/r/backup_compliance_policy.html.markdown index b3130c8a0c..478c815969 100644 --- a/website/docs/r/backup_compliance_policy.html.markdown +++ b/website/docs/r/backup_compliance_policy.html.markdown @@ -21,7 +21,22 @@ When enabled, the Backup Compliance Policy will be applied as the minimum backup * `mongodbatlas_cloud_backup_schedule` fails when you delete an Atlas cluster because an existing backup compliancy policy is enabled, which is expected. We first suggest disabling `mongodbatlas_backup_compliance_policy` resource, which requires contacting MongoDB Support and completing an extensive verification process. * Second, if the first suggestion is not possible, we suggest changing the order in which terraform deletes the resource. This might not always be possible since the `mongodbatlas_cloud_backup_schedule` resource is referencing attributes from the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster resource`, and therefore has to delete the backup schedule before deleting the cluster resource. This dependency must be defined as stated in the `mongodbatlas_cloud_backup_schedule` per the [documentation](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_backup_schedule). -* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. +* Third, another alternative is to modify the `mongodbatlas_cloud_backup_schedule` resource by replacing all the references to the `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource with the underlying values. This enables you to delete the cluster resource first, but you must obtain values from the state to do the appropriate replacements. Since there is no more reference to previous cluster resource, terraform will allow you to delete the cluster resource without having to delete the backup schedule previously. + * For example, replace: + ``` + resource "mongodbatlas_cloud_backup_schedule" "test" { + project_id = mongodbatlas_cluster.my_cluster.project_id + cluster_name = mongodbatlas_cluster.my_cluster.name + ... + } + ``` + with + ``` + resource "mongodbatlas_cloud_backup_schedule" "test" { + project_id = "65251446ae5f3f6ec7968b13" + cluster_name = "Cluster0" + ... + } * Lastly, as a final resort taking into account the limitations, we recommend you to do the following: * Remove the `mongodbatlas_cloud_backup_schedule` resource from the state using `terraform state rm mongodbatlas_cloud_backup_schedule.backup_retention_policy`. * Remove the `mongodbatlas_cloud_backup_schedule` and `mongodbatlas_advanced_cluster`, or `mongodbatlas_cluster`, resource for the terraform configuration script and apply changes. Now only the cluster delete operation is called and runs successfully.