From dd30109f7a22c6aece4db45c24987ae871c50d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:35:13 -0500 Subject: [PATCH 1/3] Chore(deps): Bump github.com/gruntwork-io/terratest (#825) Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.40.20 to 0.40.21. - [Release notes](https://github.com/gruntwork-io/terratest/releases) - [Commits](https://github.com/gruntwork-io/terratest/compare/v0.40.20...v0.40.21) --- updated-dependencies: - dependency-name: github.com/gruntwork-io/terratest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b4b650003c..a1b46223f2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/go-test/deep v1.0.8 - github.com/gruntwork-io/terratest v0.40.20 + github.com/gruntwork-io/terratest v0.40.21 github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0 github.com/hashicorp/terraform-provider-google v1.20.1-0.20210625223728-379bcb41c06b github.com/mongodb-forks/digest v1.0.4 diff --git a/go.sum b/go.sum index 865028b68d..45528816ad 100644 --- a/go.sum +++ b/go.sum @@ -618,8 +618,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro= github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78= -github.com/gruntwork-io/terratest v0.40.20 h1:pco6s3b62h2Yd13N+HvHQVTAk3aPRz4sdoVwErPCBzQ= -github.com/gruntwork-io/terratest v0.40.20/go.mod h1:JGeIGgLbxbG9/Oqm06z6YXVr76CfomdmLkV564qov+8= +github.com/gruntwork-io/terratest v0.40.21 h1:BYN/CamnMIHPFqE2Jh+XwaFT0RSZhnlBCOXeImxWrBQ= +github.com/gruntwork-io/terratest v0.40.21/go.mod h1:JGeIGgLbxbG9/Oqm06z6YXVr76CfomdmLkV564qov+8= github.com/hashicorp/aws-sdk-go-base v0.7.1 h1:7s/aR3hFn74tYPVihzDyZe7y/+BorN70rr9ZvpV3j3o= github.com/hashicorp/aws-sdk-go-base v0.7.1/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= From a45f3ef819331bab958074a490673855f7ebc1b2 Mon Sep 17 00:00:00 2001 From: admin <33664051+martinstibbe@users.noreply.github.com> Date: Mon, 12 Sep 2022 11:21:39 -0500 Subject: [PATCH 2/3] Add support to migrate legacy backup parameter to cloud_backup value --- mongodbatlas/resource_mongodbatlas_cluster.go | 4 ++++ mongodbatlas/resource_mongodbatlas_project.go | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mongodbatlas/resource_mongodbatlas_cluster.go b/mongodbatlas/resource_mongodbatlas_cluster.go index 3e04ac6610..36f5b70cc7 100644 --- a/mongodbatlas/resource_mongodbatlas_cluster.go +++ b/mongodbatlas/resource_mongodbatlas_cluster.go @@ -1010,6 +1010,10 @@ func resourceMongoDBAtlasClusterImportState(ctx context.Context, d *schema.Resou log.Printf(errorClusterSetting, "name", u.ID, err) } + if err := d.Set("cloud_backup", u.ProviderBackupEnabled); err != nil { + return nil, fmt.Errorf("couldn't import cluster %s in project %s, error: %s", *name, *projectID, err) + } + d.SetId(encodeStateID(map[string]string{ "cluster_id": u.ID, "project_id": *projectID, 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) { From 4e209faa62441c6fff9f13fd058ea107c8582a68 Mon Sep 17 00:00:00 2001 From: admin <33664051+martinstibbe@users.noreply.github.com> Date: Wed, 14 Sep 2022 08:22:25 -0500 Subject: [PATCH 3/3] Update error message --- mongodbatlas/resource_mongodbatlas_cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongodbatlas/resource_mongodbatlas_cluster.go b/mongodbatlas/resource_mongodbatlas_cluster.go index 36f5b70cc7..b39dd6c45d 100644 --- a/mongodbatlas/resource_mongodbatlas_cluster.go +++ b/mongodbatlas/resource_mongodbatlas_cluster.go @@ -1011,7 +1011,7 @@ func resourceMongoDBAtlasClusterImportState(ctx context.Context, d *schema.Resou } if err := d.Set("cloud_backup", u.ProviderBackupEnabled); err != nil { - return nil, fmt.Errorf("couldn't import cluster %s in project %s, error: %s", *name, *projectID, err) + return nil, fmt.Errorf("couldn't import cluster backup configuration %s in project %s, error: %s", *name, *projectID, err) } d.SetId(encodeStateID(map[string]string{