From 4781cac5be752a2b800cc0f29f9954e367685969 Mon Sep 17 00:00:00 2001 From: martinstibbe <33664051+martinstibbe@users.noreply.github.com> Date: Thu, 8 Sep 2022 12:47:17 -0500 Subject: [PATCH] Add support for use_org_and_group_names_in_export_prefix parameter (#829) --- .../resource_mongodbatlas_cloud_backup_schedule.go | 8 ++++++++ mongodbatlas/resource_mongodbatlas_project.go | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go index bf8f3446bf..6e2e689341 100644 --- a/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go +++ b/mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go @@ -309,6 +309,10 @@ func resourceMongoDBAtlasCloudBackupScheduleRead(ctx context.Context, d *schema. return diag.Errorf(errorSnapshotBackupScheduleSetting, "auto_export_enabled", clusterName, err) } + if err := d.Set("use_org_and_group_names_in_export_prefix", backupPolicy.UseOrgAndGroupNamesInExportPrefix); err != nil { + return diag.Errorf(errorSnapshotBackupScheduleSetting, "use_org_and_group_names_in_export_prefix", clusterName, err) + } + if err := d.Set("policy_item_hourly", flattenPolicyItem(backupPolicy.Policies[0].PolicyItems, snapshotScheduleHourly)); err != nil { return diag.Errorf(errorSnapshotBackupScheduleSetting, "policy_item_hourly", clusterName, err) } @@ -464,6 +468,10 @@ func cloudBackupScheduleCreateOrUpdate(ctx context.Context, conn *matlas.Client, req.AutoExportEnabled = pointy.Bool(d.Get("auto_export_enabled").(bool)) } + if d.HasChange("use_org_and_group_names_in_export_prefix") { + req.UseOrgAndGroupNamesInExportPrefix = pointy.Bool(d.Get("use_org_and_group_names_in_export_prefix").(bool)) + } + policy.ID = resp.Policies[0].ID policy.PolicyItems = policiesItem if len(policiesItem) > 0 { diff --git a/mongodbatlas/resource_mongodbatlas_project.go b/mongodbatlas/resource_mongodbatlas_project.go index 0ee585e8fc..6b3db7fad1 100644 --- a/mongodbatlas/resource_mongodbatlas_project.go +++ b/mongodbatlas/resource_mongodbatlas_project.go @@ -416,13 +416,13 @@ func resourceMongoDBAtlasProjectDelete(ctx context.Context, d *schema.ResourceDa } /* - This assumes the project CRUD outcome will be the same for any non-zero number of dependents +This assumes the project CRUD outcome will be the same for any non-zero number of dependents - If all dependents are deleting, wait to try and delete - Else consider the aggregate dependents idle. +If all dependents are deleting, wait to try and delete +Else consider the aggregate dependents idle. - If we get a defined error response, return that right away - Else retry +If we get a defined error response, return that right away +Else retry */ func resourceProjectDependentsDeletingRefreshFunc(ctx context.Context, projectID string, client *matlas.Client) resource.StateRefreshFunc { return func() (interface{}, string, error) {