Skip to content

Commit

Permalink
Add support for use_org_and_group_names_in_export_prefix parameter (#829
Browse files Browse the repository at this point in the history
)
  • Loading branch information
martinstibbe authored Sep 8, 2022
1 parent 6e00964 commit 4781cac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions mongodbatlas/resource_mongodbatlas_cloud_backup_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions mongodbatlas/resource_mongodbatlas_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4781cac

Please sign in to comment.