From 1bf2a1ceb8a93b504ea4312411f71e3354934f53 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:12:14 +0100 Subject: [PATCH 01/40] fix: Fixes `mongodbatlas_search_index` create and update when attribute `wait_for_index_build_completion` is used (#2887) * includes READY in target states for mongodbatlas_search_index * changelog * TestAccSearchIndex_withWaitForIndexBuildCompletion * add PENDING state * add BUILDING state * Revert "TestAccSearchIndex_withWaitForIndexBuildCompletion" This reverts commit 5b0fbe35ceeefa2a64c5ec063118c89dadac4316. --- .changelog/2887.txt | 3 +++ internal/service/searchindex/resource_search_index.go | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changelog/2887.txt diff --git a/.changelog/2887.txt b/.changelog/2887.txt new file mode 100644 index 0000000000..173cfda8bd --- /dev/null +++ b/.changelog/2887.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/mongodbatlas_search_index: Fixes resource create and update when `wait_for_index_build_completion` attribute is used +``` diff --git a/internal/service/searchindex/resource_search_index.go b/internal/service/searchindex/resource_search_index.go index db54d1f9ef..66a20e9912 100644 --- a/internal/service/searchindex/resource_search_index.go +++ b/internal/service/searchindex/resource_search_index.go @@ -275,8 +275,8 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. if d.Get("wait_for_index_build_completion").(bool) { timeout := d.Timeout(schema.TimeoutUpdate) stateConf := &retry.StateChangeConf{ - Pending: []string{"IN_PROGRESS", "MIGRATING"}, - Target: []string{"STEADY"}, + Pending: []string{"PENDING", "BUILDING", "IN_PROGRESS", "MIGRATING"}, + Target: []string{"READY", "STEADY"}, Refresh: resourceSearchIndexRefreshFunc(ctx, clusterName, projectID, indexID, connV2), Timeout: timeout, MinTimeout: 1 * time.Minute, @@ -449,8 +449,8 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. if d.Get("wait_for_index_build_completion").(bool) { timeout := d.Timeout(schema.TimeoutCreate) stateConf := &retry.StateChangeConf{ - Pending: []string{"IN_PROGRESS", "MIGRATING"}, - Target: []string{"STEADY"}, + Pending: []string{"PENDING", "BUILDING", "IN_PROGRESS", "MIGRATING"}, + Target: []string{"READY", "STEADY"}, Refresh: resourceSearchIndexRefreshFunc(ctx, clusterName, projectID, indexID, connV2), Timeout: timeout, MinTimeout: 1 * time.Minute, From a1ab136f8560a585a7058b5ded91cc93a4ebb59c Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Fri, 13 Dec 2024 21:13:57 +0000 Subject: [PATCH 02/40] chore: Updates CHANGELOG.md for #2887 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ee7e62bd..c1f2add6b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ BUG FIXES: * data-source/mongodbatlas_clusters: `mongo_db_major_version` attribute is populated with binary version when FCV pin is active ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) * resource/mongodbatlas_advanced_cluster: `mongo_db_major_version` attribute is populated with binary version when FCV pin is active ([#2789](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2789)) * resource/mongodbatlas_cluster: `mongo_db_major_version` attribute is populated with binary version when FCV pin is active ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) +* resource/mongodbatlas_search_index: Fixes resource create and update when `wait_for_index_build_completion` attribute is used ([#2887](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2887)) ## 1.22.0 (November 26, 2024) From cb5a729f074d3160055d436de8b3daf52ad6e3ec Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Sat, 14 Dec 2024 08:56:16 +0000 Subject: [PATCH 03/40] chore: Adds support for MacT capture using HTTP_MOCKER_CAPTURE (#2874) * test: Adds support for MacT capture using HTTP_MOCKER_CAPTURE * test: Refactor advanced cluster validation tests and remove obsolete unit tests (refactored/added in next PR) * refactor: Update type definitions to use 'any' and remove unused test main file * feat: apply latest changes from CLOUDP-287995_failure_recordings --- .../advancedclustertpf/move_state_test.go | 4 + .../resource_schema_test.go | 8 + .../advancedclustertpf/resource_test.go | 53 --- .../advancedclustertpf/resource_unit_test.go | 270 ----------- .../acc/advanced_cluster_schema_v2.go | 56 +-- internal/testutil/acc/atlas.go | 3 - internal/testutil/hcl/common.go | 96 ++++ internal/testutil/tc/advanced_cluster.go | 322 ------------- internal/testutil/unit/http_mocker.go | 445 ++++++------------ .../testutil/unit/http_mocker_api_paths.go | 134 ++++++ .../unit/http_mocker_api_paths_test.go | 23 + .../unit/http_mocker_config_capture.go | 185 ++++++++ .../unit/http_mocker_config_capture_test.go | 95 ++++ internal/testutil/unit/http_mocker_data.go | 385 +++++++++++++++ .../testutil/unit/http_mocker_data_test.go | 91 ++++ .../unit/http_mocker_round_tripper.go | 247 ++++++++++ .../unit/http_mocker_round_tripper_test.go | 128 +++++ internal/testutil/unit/http_mocker_test.go | 186 +++----- .../testutil/unit/http_path_normalizing.go | 132 ++++++ internal/testutil/unit/main_test.go | 14 + internal/testutil/unit/provider_mock.go | 39 +- .../testdata/CaptureTest/createCluster.json | 21 + .../CaptureTest/createClusterResponse.json | 61 +++ .../testdata/CaptureTest/getClusterIdle.json | 65 +++ .../CaptureTest/getContainersAws.json | 19 + .../CaptureTest/getContainersAzure.json | 20 + ...ckConfigClientModifier_clusterExample.yaml | 65 +++ .../TestMockRoundTripperAllowReRead.yaml | 1 - internal/testutil/unit/tf_config_modifier.go | 71 +++ .../testutil/unit/tf_config_modifier_test.go | 70 +++ 30 files changed, 2194 insertions(+), 1115 deletions(-) delete mode 100644 internal/service/advancedclustertpf/resource_test.go delete mode 100644 internal/service/advancedclustertpf/resource_unit_test.go create mode 100644 internal/testutil/hcl/common.go delete mode 100644 internal/testutil/tc/advanced_cluster.go create mode 100644 internal/testutil/unit/http_mocker_api_paths.go create mode 100644 internal/testutil/unit/http_mocker_api_paths_test.go create mode 100644 internal/testutil/unit/http_mocker_config_capture.go create mode 100644 internal/testutil/unit/http_mocker_config_capture_test.go create mode 100644 internal/testutil/unit/http_mocker_data.go create mode 100644 internal/testutil/unit/http_mocker_data_test.go create mode 100644 internal/testutil/unit/http_mocker_round_tripper.go create mode 100644 internal/testutil/unit/http_mocker_round_tripper_test.go create mode 100644 internal/testutil/unit/http_path_normalizing.go create mode 100644 internal/testutil/unit/main_test.go create mode 100644 internal/testutil/unit/testdata/CaptureTest/createCluster.json create mode 100644 internal/testutil/unit/testdata/CaptureTest/createClusterResponse.json create mode 100644 internal/testutil/unit/testdata/CaptureTest/getClusterIdle.json create mode 100644 internal/testutil/unit/testdata/CaptureTest/getContainersAws.json create mode 100644 internal/testutil/unit/testdata/CaptureTest/getContainersAzure.json create mode 100644 internal/testutil/unit/testdata/TestCaptureMockConfigClientModifier_clusterExample/TestCaptureMockConfigClientModifier_clusterExample.yaml create mode 100644 internal/testutil/unit/tf_config_modifier.go create mode 100644 internal/testutil/unit/tf_config_modifier_test.go diff --git a/internal/service/advancedclustertpf/move_state_test.go b/internal/service/advancedclustertpf/move_state_test.go index 5e8072491c..7df26cbbc5 100644 --- a/internal/service/advancedclustertpf/move_state_test.go +++ b/internal/service/advancedclustertpf/move_state_test.go @@ -10,6 +10,10 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) +const ( + resourceName = "mongodbatlas_advanced_cluster.test" +) + func TestAccAdvancedCluster_moveBasic(t *testing.T) { var ( projectID = acc.ProjectIDExecution(t) diff --git a/internal/service/advancedclustertpf/resource_schema_test.go b/internal/service/advancedclustertpf/resource_schema_test.go index 01f7cdf8fd..fdf578781b 100644 --- a/internal/service/advancedclustertpf/resource_schema_test.go +++ b/internal/service/advancedclustertpf/resource_schema_test.go @@ -10,6 +10,10 @@ import ( ) func TestAdvancedCluster_ValidationErrors(t *testing.T) { + const ( + projectID = "111111111111111111111111" + clusterName = "test" + ) resource.ParallelTest(t, resource.TestCase{ ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, Steps: []resource.TestStep{ @@ -26,6 +30,10 @@ func TestAdvancedCluster_ValidationErrors(t *testing.T) { } func TestAdvancedCluster_PlanModifierErrors(t *testing.T) { + const ( + projectID = "111111111111111111111111" + clusterName = "test" + ) resource.ParallelTest(t, resource.TestCase{ ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, Steps: []resource.TestStep{ diff --git a/internal/service/advancedclustertpf/resource_test.go b/internal/service/advancedclustertpf/resource_test.go deleted file mode 100644 index efe29be364..0000000000 --- a/internal/service/advancedclustertpf/resource_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package advancedclustertpf_test - -import ( - "os" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/tc" -) - -const ( - resourceName = "mongodbatlas_advanced_cluster.test" -) - -func TestAccClusterAdvancedCluster_basicTenant(t *testing.T) { - var ( - projectID = acc.ProjectIDExecution(t) - clusterName = acc.RandomClusterName() - clusterNameUpdated = acc.RandomClusterName() - ) - testCase := tc.BasicTenantTestCase(t, projectID, clusterName, clusterNameUpdated) - resource.ParallelTest(t, *testCase) -} - -func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T) { - var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acc.RandomProjectName() - clusterName = acc.RandomClusterName() - ) - testCase := tc.SymmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t, orgID, projectName, clusterName) - resource.ParallelTest(t, *testCase) -} - -func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchema(t *testing.T) { - var ( - orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") - projectName = acc.RandomProjectName() - clusterName = acc.RandomClusterName() - ) - testCase := tc.SymmetricShardedOldSchema(t, orgID, projectName, clusterName) - resource.ParallelTest(t, *testCase) -} - -func TestAccClusterAdvancedCluster_tenantUpgrade(t *testing.T) { - var ( - projectID = acc.ProjectIDExecution(t) - clusterName = acc.RandomClusterName() - ) - testCase := tc.TenantUpgrade(t, projectID, clusterName) - resource.ParallelTest(t, *testCase) -} diff --git a/internal/service/advancedclustertpf/resource_unit_test.go b/internal/service/advancedclustertpf/resource_unit_test.go deleted file mode 100644 index f1fcd2cad0..0000000000 --- a/internal/service/advancedclustertpf/resource_unit_test.go +++ /dev/null @@ -1,270 +0,0 @@ -package advancedclustertpf_test - -import ( - "fmt" - "strings" - "testing" - "time" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" - - "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedclustertpf" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/tc" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" -) - -const ( - processResponseOnly = "processResponseOnly" - projectID = "111111111111111111111111" - clusterName = "test" -) - -func TestMockAdvancedCluster_replicaset(t *testing.T) { - var ( - oneNewVariable = "backup_enabled = false" - fullUpdate = ` - backup_enabled = true - bi_connector_config = { - enabled = true - } - # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty - labels = [{ - key = "env" - value = "test" - }] - tags = [{ - key = "env" - value = "test" - }] - mongo_db_major_version = "8.0" - paused = true - pit_enabled = true - redact_client_log_data = true - replica_set_scaling_strategy = "NODE_TYPE" - # retain_backups_enabled = true # only set on delete - root_cert_type = "ISRGROOTX1" - # termination_protection_enabled = true # must be reset to false to enable delete - version_release_system = "CONTINUOUS" - ` - // # oplog_min_retention_hours = 5.5 - // # oplog_size_mb = 1000 - // # fail_index_key_too_long = true # only valid for MongoDB version 4.4 and earlier - advClusterConfig = ` - advanced_configuration = { - change_stream_options_pre_and_post_images_expire_after_seconds = 100 - default_read_concern = "available" - default_write_concern = "majority" - javascript_enabled = true - minimum_enabled_tls_protocol = "TLS1_0" - no_table_scan = true - sample_refresh_interval_bi_connector = 310 - sample_size_bi_connector = 110 - transaction_lifetime_limit_seconds = 300 - } - ` - fullUpdateResumed = strings.Replace(fullUpdate, "paused = true", "paused = false", 1) - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - } - ) - shortenRetries() - testCase := resource.TestCase{ - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - Steps: []resource.TestStep{ - { - Config: configBasic(projectID, clusterName, ""), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "state_name", "IDLE"), - resource.TestCheckResourceAttr(resourceName, "timeouts.create", "20s"), - resource.TestCheckResourceAttr(resourceName, "replication_specs.0.container_id.AWS:US_EAST_1", "67345bd9905b8c30c54fd220"), - ), - }, - { - Config: configBasic(projectID, clusterName, oneNewVariable), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "backup_enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "state_name", "IDLE"), - ), - }, - { - Config: configBasic(projectID, clusterName, fullUpdate), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "state_name", "IDLE"), - resource.TestCheckResourceAttr(resourceName, "mongo_db_major_version", "8.0"), - resource.TestCheckResourceAttr(resourceName, "backup_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "paused", "true"), - ), - }, - { - Config: configBasic(projectID, clusterName, fullUpdateResumed), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "state_name", "IDLE"), - resource.TestCheckResourceAttr(resourceName, "backup_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "paused", "false"), - ), - }, - { - Config: configBasic(projectID, clusterName, fullUpdateResumed+advClusterConfig), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "mongo_db_major_version", "8.0"), - resource.TestCheckResourceAttr(resourceName, "advanced_configuration.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), - ), - }, - acc.TestStepImportCluster(resourceName), - }, - } - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, &testCase) -} - -func shortenRetries() { - advancedclustertpf.RetryMinTimeout = 100 * time.Millisecond - advancedclustertpf.RetryDelay = 100 * time.Millisecond - advancedclustertpf.RetryPollInterval = 100 * time.Millisecond -} - -func TestMockAdvancedCluster_configSharded(t *testing.T) { - var ( - clusterName = "sharded-multi-replication" - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - } - ) - shortenRetries() - testCase := resource.TestCase{ - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - Steps: []resource.TestStep{ - { - Config: configSharded(projectID, clusterName, false), - Check: resource.TestCheckResourceAttr(resourceName, "project_id", projectID), - }, - { - Config: configSharded(projectID, clusterName, true), - Check: resource.TestCheckResourceAttr(resourceName, "name", clusterName), - }, - acc.TestStepImportCluster(resourceName), - }, - } - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, &testCase) -} - -func configSharded(projectID, clusterName string, withUpdate bool) string { - var autoScaling, analyticsSpecs string - if withUpdate { - autoScaling = ` - auto_scaling = { - disk_gb_enabled = true - }` - analyticsSpecs = ` - analytics_specs = { - instance_size = "M30" - node_count = 1 - ebs_volume_type = "PROVISIONED" - disk_iops = 2000 - }` - } - // SDK v2 Implementation receives many warnings, one of them: `.replication_specs[1].region_configs[0].analytics_specs[0].disk_iops: was cty.NumberIntVal(2000), but now cty.NumberIntVal(1000)` - // Therefore, in TPF we are forced to set the value that will be returned by the API (1000) - // The rule is: For any replication spec, the `(analytics|electable|read_only)_spec.disk_iops` must be the same across all region_configs - // The API raises no errors, but the response reflects this rule - analyticsSpecsForSpec2 := strings.ReplaceAll(analyticsSpecs, "2000", "1000") - return fmt.Sprintf(` - resource "mongodbatlas_advanced_cluster" "test" { - project_id = %[1]q - name = %[2]q - cluster_type = "SHARDED" - - replication_specs = [ - { # shard 1 - region_configs = [{ - electable_specs = { - instance_size = "M30" - disk_iops = 2000 - node_count = 3 - ebs_volume_type = "PROVISIONED" - } - %[3]s - %[4]s - provider_name = "AWS" - priority = 7 - region_name = "EU_WEST_1" - }] - }, - { # shard 2 - region_configs = [{ - electable_specs = { - instance_size = "M30" - ebs_volume_type = "PROVISIONED" - disk_iops = 1000 - node_count = 3 - } - %[3]s - %[5]s - provider_name = "AWS" - priority = 7 - region_name = "EU_WEST_1" - }] - }] - } - `, projectID, clusterName, autoScaling, analyticsSpecs, analyticsSpecsForSpec2) -} - -func TestMockClusterAdvancedCluster_basicTenant(t *testing.T) { - var ( - clusterName = "test-acc-tf-c-8049930413007488732" - clusterNameUpdated = "test-acc-tf-c-91771214182147246" - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - "clusterName2": clusterNameUpdated, - } - ) - shortenRetries() - testCase := tc.BasicTenantTestCase(t, projectID, clusterName, clusterNameUpdated) - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, testCase) -} - -func TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T) { - var ( - clusterName = "6746cee8aef48d1cb265882d" - projectName = "test-acc-tf-p-4311574251574843475" - orgID = "65def6ce0f722a1507105aa5" - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - } - ) - shortenRetries() - testCase := tc.SymmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t, orgID, projectName, clusterName) - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, testCase) -} - -func TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema(t *testing.T) { - var ( - clusterName = "test-acc-tf-c-6025103075771235151" - projectName = "test-acc-tf-p-7889034782442569766" - orgID = "65def6ce0f722a1507105aa5" - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - } - ) - shortenRetries() - testCase := tc.SymmetricShardedOldSchema(t, orgID, projectName, clusterName) - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, testCase) -} - -func TestMockClusterAdvancedCluster_tenantUpgrade(t *testing.T) { - var ( - clusterName = "test-acc-tf-c-878317177498266511" - vars = map[string]string{ - "groupId": projectID, - "clusterName": clusterName, - } - ) - shortenRetries() - testCase := tc.TenantUpgrade(t, projectID, clusterName) - unit.MockTestCaseAndRun(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true, AllowReReadGet: true}, testCase) -} diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index 59d8a2047c..9c89c1d2f6 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -4,17 +4,15 @@ import ( "strings" "testing" - "github.com/hashicorp/hcl/v2" - "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2/hclwrite" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/hcl" "github.com/zclconf/go-cty/cty" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCheckResourceAttrSchemaV2(isAcc bool, name, key, value string) resource.TestCheckFunc { @@ -123,7 +121,7 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri if !config.AdvancedClusterV2Schema() || !isAcc { return def } - parse := getDefParser(t, def) + parse := hcl.GetDefParser(t, def) for _, resource := range parse.Body().Blocks() { isResource := resource.Type() == "resource" resourceName := resource.Labels()[0] @@ -131,11 +129,11 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri continue } writeBody := resource.Body() - convertAttrs(t, "labels", writeBody, true, getAttrVal) - convertAttrs(t, "tags", writeBody, true, getAttrVal) + convertAttrs(t, "labels", writeBody, true, hcl.GetAttrVal) + convertAttrs(t, "tags", writeBody, true, hcl.GetAttrVal) convertAttrs(t, "replication_specs", writeBody, true, getReplicationSpecs) - convertAttrs(t, "advanced_configuration", writeBody, false, getAttrVal) - convertAttrs(t, "bi_connector_config", writeBody, false, getAttrVal) + convertAttrs(t, "advanced_configuration", writeBody, false, hcl.GetAttrVal) + convertAttrs(t, "bi_connector_config", writeBody, false, hcl.GetAttrVal) } content := parse.Bytes() return string(content) @@ -143,7 +141,7 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri func AssertEqualHCL(t *testing.T, expected, actual string, msgAndArgs ...interface{}) { t.Helper() - assert.Equal(t, canonicalHCL(t, expected), canonicalHCL(t, actual), msgAndArgs...) + assert.Equal(t, hcl.CanonicalHCL(t, expected), hcl.CanonicalHCL(t, actual), msgAndArgs...) } func convertAttrs(t *testing.T, name string, writeBody *hclwrite.Body, isList bool, getOneAttr func(*testing.T, *hclsyntax.Body) cty.Value) { @@ -154,7 +152,7 @@ func convertAttrs(t *testing.T, name string, writeBody *hclwrite.Body, isList bo if match == nil { break } - vals = append(vals, getOneAttr(t, getBlockBody(t, match))) + vals = append(vals, getOneAttr(t, hcl.GetBlockBody(t, match))) writeBody.RemoveBlock(match) // TODO: RemoveBlock doesn't remove newline just after the block so an extra line is added } if len(vals) == 0 { @@ -174,45 +172,9 @@ func getReplicationSpecs(t *testing.T, body *hclsyntax.Body) cty.Value { var vals []cty.Value for _, block := range body.Blocks { assert.Equal(t, name, block.Type, "unexpected block type: %s", block.Type) - vals = append(vals, getAttrVal(t, block.Body)) + vals = append(vals, hcl.GetAttrVal(t, block.Body)) } return cty.ObjectVal(map[string]cty.Value{ name: cty.TupleVal(vals), }) } - -func getAttrVal(t *testing.T, body *hclsyntax.Body) cty.Value { - t.Helper() - ret := make(map[string]cty.Value) - for name, attr := range body.Attributes { - val, diags := attr.Expr.Value(nil) - require.False(t, diags.HasErrors(), "failed to parse attribute %s: %s", name, diags.Error()) - ret[name] = val - } - for _, block := range body.Blocks { - ret[block.Type] = getAttrVal(t, block.Body) - } - return cty.ObjectVal(ret) -} - -func canonicalHCL(t *testing.T, def string) string { - t.Helper() - return string(getDefParser(t, def).Bytes()) -} - -func getDefParser(t *testing.T, def string) *hclwrite.File { - t.Helper() - parser, diags := hclwrite.ParseConfig([]byte(def), "", hcl.Pos{Line: 1, Column: 1}) - require.False(t, diags.HasErrors(), "failed to parse def: %s", diags.Error()) - return parser -} - -func getBlockBody(t *testing.T, block *hclwrite.Block) *hclsyntax.Body { - t.Helper() - parser, diags := hclparse.NewParser().ParseHCL(block.Body().BuildTokens(nil).Bytes(), "") - require.False(t, diags.HasErrors(), "failed to parse block: %s", diags.Error()) - - body, ok := parser.Body.(*hclsyntax.Body) - require.True(t, ok, "unexpected *hclsyntax.Body type: %T", parser.Body) - return body -} diff --git a/internal/testutil/acc/atlas.go b/internal/testutil/acc/atlas.go index 4ae0de5c24..df52eca773 100644 --- a/internal/testutil/acc/atlas.go +++ b/internal/testutil/acc/atlas.go @@ -102,9 +102,6 @@ func projectIDLocal(tb testing.TB) string { if id == "" { return "" } - if InCI() { - tb.Fatal("MONGODB_ATLAS_PROJECT_ID can't be used in CI") - } tb.Logf("Using MONGODB_ATLAS_PROJECT_ID: %s", id) return id } diff --git a/internal/testutil/hcl/common.go b/internal/testutil/hcl/common.go new file mode 100644 index 0000000000..79de5a4dab --- /dev/null +++ b/internal/testutil/hcl/common.go @@ -0,0 +1,96 @@ +package hcl + +import ( + "context" + "io" + "os" + "strings" + "sync" + "testing" + + "github.com/hashicorp/go-version" + "github.com/hashicorp/hc-install/product" + "github.com/hashicorp/hc-install/releases" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclparse" + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/hashicorp/terraform-exec/tfexec" + "github.com/zclconf/go-cty/cty" + + "github.com/stretchr/testify/require" +) + +var tf *tfexec.Terraform +var tfMutex sync.Mutex + +func getTF() *tfexec.Terraform { + tfMutex.Lock() + defer tfMutex.Unlock() + if tf != nil { + return tf + } + installer := &releases.ExactVersion{ + Product: product.Terraform, + Version: version.Must(version.NewVersion("1.10.1")), + } + execPath, err := installer.Install(context.Background()) + if err != nil { + panic(err) + } + tempDir, err := os.Getwd() + if err != nil { + panic(err) + } + tf, err = tfexec.NewTerraform(tempDir, execPath) + if err != nil { + panic(err) + } + return tf +} + +func GetAttrVal(t *testing.T, body *hclsyntax.Body) cty.Value { + t.Helper() + ret := make(map[string]cty.Value) + for name, attr := range body.Attributes { + val, diags := attr.Expr.Value(nil) + require.False(t, diags.HasErrors(), "failed to parse attribute %s: %s", name, diags.Error()) + ret[name] = val + } + for _, block := range body.Blocks { + ret[block.Type] = GetAttrVal(t, block.Body) + } + return cty.ObjectVal(ret) +} + +func PrettyHCL(t *testing.T, content string) string { + t.Helper() + builder := strings.Builder{} + fmt := getTF().Format(context.Background(), io.NopCloser(strings.NewReader(content)), &builder) + require.NoError(t, fmt) + formatted := builder.String() + return formatted +} + +func CanonicalHCL(t *testing.T, def string) string { + t.Helper() + return string(hclwrite.Format(GetDefParser(t, def).Bytes())) +} + +func GetDefParser(t *testing.T, def string) *hclwrite.File { + t.Helper() + parser, diags := hclwrite.ParseConfig([]byte(def), "", hcl.Pos{Line: 1, Column: 1}) + require.False(t, diags.HasErrors(), "failed to parse def: %s", diags.Error()) + return parser +} + +func GetBlockBody(t *testing.T, block *hclwrite.Block) *hclsyntax.Body { + t.Helper() + parser, diags := hclparse.NewParser().ParseHCL(block.Body().BuildTokens(nil).Bytes(), "") + require.False(t, diags.HasErrors(), "failed to parse block: %s", diags.Error()) + + body, ok := parser.Body.(*hclsyntax.Body) + require.True(t, ok, "unexpected *hclsyntax.Body type: %T", parser.Body) + return body +} diff --git a/internal/testutil/tc/advanced_cluster.go b/internal/testutil/tc/advanced_cluster.go deleted file mode 100644 index 78e40f6fec..0000000000 --- a/internal/testutil/tc/advanced_cluster.go +++ /dev/null @@ -1,322 +0,0 @@ -package tc - -import ( - "fmt" - "strconv" - "strings" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" -) - -const ( - resourceName = "mongodbatlas_advanced_cluster.test" - dataSourceName = "data.mongodbatlas_advanced_cluster.test" - dataSourcePluralName = "data.mongodbatlas_advanced_clusters.test" -) - -var ( - configServerManagementModeFixedToDedicated = "FIXED_TO_DEDICATED" - configServerManagementModeAtlasManaged = "ATLAS_MANAGED" -) - -func SymmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T, orgID, projectName, clusterName string) *resource.TestCase { - t.Helper() - return &resource.TestCase{ - PreCheck: func() { acc.PreCheckBasic(t) }, - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - CheckDestroy: acc.CheckDestroyCluster, - Steps: []resource.TestStep{ - { - Config: configShardedOldSchemaDiskSizeGBElectableLevel(orgID, projectName, clusterName, 50), - Check: checkShardedOldSchemaDiskSizeGBElectableLevel(50), - }, - { - Config: configShardedOldSchemaDiskSizeGBElectableLevel(orgID, projectName, clusterName, 55), - Check: checkShardedOldSchemaDiskSizeGBElectableLevel(55), - }, - }, - } -} - -func configShardedOldSchemaDiskSizeGBElectableLevel(orgID, projectName, name string, diskSizeGB int) string { - return fmt.Sprintf(` - resource "mongodbatlas_project" "cluster_project" { - org_id = %[1]q - name = %[2]q - } - - resource "mongodbatlas_advanced_cluster" "test" { - project_id = mongodbatlas_project.cluster_project.id - name = %[3]q - backup_enabled = false - mongo_db_major_version = "7.0" - cluster_type = "SHARDED" - - replication_specs = [{ - num_shards = 2 - - region_configs = [{ - electable_specs = { - instance_size = "M10" - node_count = 3 - disk_size_gb = %[4]d - } - analytics_specs = { - instance_size = "M10" - node_count = 0 - disk_size_gb = %[4]d - } - provider_name = "AWS" - priority = 7 - region_name = "US_EAST_1" - }, - ] - }] - } - `, orgID, projectName, name, diskSizeGB) -} - -func checkShardedOldSchemaDiskSizeGBElectableLevel(diskSizeGB int) resource.TestCheckFunc { - return checkAggr( - []string{}, - map[string]string{ - "replication_specs.0.num_shards": "2", - "disk_size_gb": fmt.Sprintf("%d", diskSizeGB), - "replication_specs.0.region_configs.0.electable_specs.disk_size_gb": fmt.Sprintf("%d", diskSizeGB), - "replication_specs.0.region_configs.0.analytics_specs.disk_size_gb": fmt.Sprintf("%d", diskSizeGB), - }) -} - -func checkAggr(attrsSet []string, attrsMap map[string]string, extra ...resource.TestCheckFunc) resource.TestCheckFunc { - checks := []resource.TestCheckFunc{} - checks = acc.AddAttrChecks(resourceName, checks, attrsMap) - checks = acc.AddAttrSetChecks(resourceName, checks, attrsSet...) - checks = append(checks, extra...) - return resource.ComposeAggregateTestCheckFunc(checks...) -} - -func SymmetricShardedOldSchema(t *testing.T, orgID, projectName, clusterName string) *resource.TestCase { - t.Helper() - return &resource.TestCase{ - PreCheck: func() { acc.PreCheckBasic(t) }, - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - CheckDestroy: acc.CheckDestroyCluster, - Steps: []resource.TestStep{ - { - Config: configShardedOldSchemaMultiCloud(orgID, projectName, clusterName, 2, "M10", &configServerManagementModeFixedToDedicated), - Check: checkShardedOldSchemaMultiCloud(clusterName, 2, "M10", false, &configServerManagementModeFixedToDedicated), - }, - { - Config: configShardedOldSchemaMultiCloud(orgID, projectName, clusterName, 2, "M20", &configServerManagementModeAtlasManaged), - Check: checkShardedOldSchemaMultiCloud(clusterName, 2, "M20", false, &configServerManagementModeAtlasManaged), - }, - }, - } -} - -func configShardedOldSchemaMultiCloud(orgID, projectName, name string, numShards int, analyticsSize string, configServerManagementMode *string) string { - var rootConfig string - if configServerManagementMode != nil { - // valid values: FIXED_TO_DEDICATED or ATLAS_MANAGED (default) - // only valid for Major version 8 and later - // cluster must be SHARDED - rootConfig = fmt.Sprintf(` - mongo_db_major_version = "8" - config_server_management_mode = %[1]q - `, *configServerManagementMode) - } - return fmt.Sprintf(` - resource "mongodbatlas_project" "cluster_project" { - org_id = %[1]q - name = %[2]q - } - - resource "mongodbatlas_advanced_cluster" "test" { - project_id = mongodbatlas_project.cluster_project.id - name = %[3]q - cluster_type = "SHARDED" - %[6]s - - replication_specs = [{ - num_shards = %[4]d - region_configs = [{ - electable_specs = { - instance_size = "M10" - node_count = 3 - } - analytics_specs = { - instance_size = %[5]q - node_count = 1 - } - provider_name = "AWS" - priority = 7 - region_name = "EU_WEST_1" - }, { - electable_specs = { - instance_size = "M10" - node_count = 2 - } - provider_name = "AZURE" - priority = 6 - region_name = "US_EAST_2" - },] - },] - } - `, orgID, projectName, name, numShards, analyticsSize, rootConfig) -} - -func checkShardedOldSchemaMultiCloud(name string, numShards int, analyticsSize string, verifyExternalID bool, configServerManagementMode *string) resource.TestCheckFunc { - additionalChecks := []resource.TestCheckFunc{ - resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.0.electable_specs.disk_iops", acc.IntGreatThan(0)), - resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.0.analytics_specs.disk_iops", acc.IntGreatThan(0)), - resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.1.electable_specs.disk_iops", acc.IntGreatThan(0)), - } - - if verifyExternalID { - additionalChecks = append( - additionalChecks, - resource.TestCheckResourceAttrSet(resourceName, "replication_specs.0.external_id")) - } - if configServerManagementMode != nil { - additionalChecks = append( - additionalChecks, - resource.TestCheckResourceAttr(resourceName, "config_server_management_mode", *configServerManagementMode), - resource.TestCheckResourceAttrSet(resourceName, "config_server_type"), - ) - } - - return checkAggr( - []string{"project_id", "replication_specs.#", "replication_specs.0.id", "replication_specs.0.region_configs.#"}, - map[string]string{ - "name": name, - "replication_specs.0.num_shards": strconv.Itoa(numShards), - "replication_specs.0.region_configs.0.analytics_specs.instance_size": analyticsSize, - }, - additionalChecks...) -} - -func BasicTenantTestCase(t *testing.T, projectID, clusterName, clusterNameUpdated string) *resource.TestCase { - t.Helper() - return &resource.TestCase{ - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - CheckDestroy: acc.CheckDestroyCluster, - PreCheck: acc.PreCheckBasicSleep(t, nil, projectID, clusterName), - Steps: []resource.TestStep{ - { - Config: configTenant(t, true, projectID, clusterName), - Check: checkTenant(projectID, clusterName), - }, - { - Config: configTenant(t, true, projectID, clusterNameUpdated), - Check: checkTenant(projectID, clusterNameUpdated), - }, - acc.TestStepImportCluster(resourceName), - }, - } -} - -func configTenant(t *testing.T, isAcc bool, projectID, name string) string { - t.Helper() - return acc.ConvertAdvancedClusterToSchemaV2(t, isAcc, fmt.Sprintf(` - resource "mongodbatlas_advanced_cluster" "test" { - project_id = %[1]q - name = %[2]q - cluster_type = "REPLICASET" - - replication_specs = [{ - region_configs = [{ - electable_specs = { - instance_size = "M5" - } - provider_name = "TENANT" - backing_provider_name = "AWS" - region_name = "US_EAST_1" - priority = 7 - }] - }] - } - `, projectID, name)) -} - -func checkTenant(projectID, name string) resource.TestCheckFunc { - attrsSet := []string{"replication_specs.#", "replication_specs.0.id", "replication_specs.0.region_configs.#"} - attrsMap := map[string]string{ - "project_id": projectID, - "name": name, - "termination_protection_enabled": "false", - "global_cluster_self_managed_sharding": "false", - "labels.#": "0", - } - checks := acc.AddAttrSetChecks(resourceName, nil, attrsSet...) - checks = acc.AddAttrChecks(resourceName, checks, attrsMap) - return resource.ComposeAggregateTestCheckFunc(checks...) -} - -func TenantUpgrade(t *testing.T, projectID, clusterName string) *resource.TestCase { - t.Helper() - return &resource.TestCase{ - PreCheck: acc.PreCheckBasicSleep(t, nil, projectID, clusterName), - ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - CheckDestroy: acc.CheckDestroyCluster, - Steps: []resource.TestStep{ - { - Config: configTenant(t, true, projectID, clusterName), - Check: checkTenant(projectID, clusterName), - }, - { - Config: configTenantUpgraded(t, true, projectID, clusterName), - Check: checksTenantUpgraded(projectID, clusterName), - }, - }, - } -} - -func configTenantUpgraded(t *testing.T, isAcc bool, projectID, name string) string { - t.Helper() - return acc.ConvertAdvancedClusterToSchemaV2(t, isAcc, fmt.Sprintf(` - resource "mongodbatlas_advanced_cluster" "test" { - project_id = %[1]q - name = %[2]q - cluster_type = "REPLICASET" - - replication_specs { - region_configs { - priority = 7 - provider_name = "AWS" - region_name = "US_EAST_1" - electable_specs { - node_count = 3 - instance_size = "M10" - } - } - } - } - `, projectID, name)) -} - -func enableChecksLatestTpf(checkMap map[string]string) map[string]string { - newMap := map[string]string{} - for k, v := range checkMap { - modifiedKey := strings.ReplaceAll(k, "electable_specs.0", "electable_specs") - newMap[modifiedKey] = v - } - return newMap -} - -func checksTenantUpgraded(projectID, name string) resource.TestCheckFunc { - originalChecks := checkTenant(projectID, name) - checks := []resource.TestCheckFunc{originalChecks} - checkMap := map[string]string{ - "replication_specs.0.region_configs.0.electable_specs.0.node_count": "3", - "replication_specs.0.region_configs.0.electable_specs.0.instance_size": "M10", - "replication_specs.0.region_configs.0.provider_name": "AWS", - } - if config.AdvancedClusterV2Schema() { - checkMap = enableChecksLatestTpf(checkMap) - } - checks = acc.AddAttrChecks(resourceName, checks, checkMap) - return resource.ComposeAggregateTestCheckFunc(originalChecks, resource.ComposeAggregateTestCheckFunc(checks...)) -} diff --git a/internal/testutil/unit/http_mocker.go b/internal/testutil/unit/http_mocker.go index 749e65aba0..77090ac102 100644 --- a/internal/testutil/unit/http_mocker.go +++ b/internal/testutil/unit/http_mocker.go @@ -1,354 +1,221 @@ package unit import ( - "encoding/json" - "fmt" - "io" "net/http" "os" "path" - "regexp" + "slices" "strings" + "sync" "testing" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/jarcoal/httpmock" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - "github.com/sebdah/goldie/v2" - "github.com/stretchr/testify/assert" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/hcl" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" ) -func replaceVars(text string, vars map[string]string) string { - for key, value := range vars { - text = strings.ReplaceAll(text, fmt.Sprintf("{%s}", key), value) - } - return text -} - -type statusText struct { - Text string `yaml:"text"` - Status int `yaml:"status"` - ResponseIndex int `yaml:"response_index"` -} +const ( + EnvNameHTTPMockerCapture = "HTTP_MOCKER_CAPTURE" + EnvNameHTTPMockerReplay = "HTTP_MOCKER_REPLAY" + configFileExtension = ".yaml" +) -type RequestInfo struct { - Version string `yaml:"version"` - Method string `yaml:"method"` - Path string `yaml:"path"` - Text string `yaml:"text"` - Responses []statusText `yaml:"responses"` +type MockHTTPDataConfig struct { + SideEffect func() error + IsDiffSkipSuffixes []string + IsDiffMustSubstrings []string + QueryVars []string + AllowMissingRequests bool } -func (i *RequestInfo) id() string { - return fmt.Sprintf("%s_%s_%s_%s", i.Method, i.Path, i.Version, i.Text) +func IsCapture() bool { + return slices.Contains([]string{"yes", "1", "true"}, strings.ToLower(os.Getenv(EnvNameHTTPMockerCapture))) } -func (i *RequestInfo) idShort() string { - return fmt.Sprintf("%s_%s_%s", i.Method, i.Path, i.Version) +func IsReplay() bool { + return slices.Contains([]string{"yes", "1", "true"}, strings.ToLower(os.Getenv(EnvNameHTTPMockerReplay))) } -func (i *RequestInfo) Match(method, urlPath, version string, vars map[string]string) bool { - if i.Method != method { - return false +func CaptureOrMockTestCaseAndRun(t *testing.T, config MockHTTPDataConfig, testCase *resource.TestCase) { //nolint: gocritic // Want each test run to have its own config (hugeParam: config is heavy (112 bytes); consider passing it by pointer) + t.Helper() + var err error + noneSet := !IsCapture() && !IsReplay() + bothSet := IsCapture() && IsReplay() + switch { + case bothSet: + t.Fatalf("Both %s and %s are set, only one of them should be set", EnvNameHTTPMockerCapture, EnvNameHTTPMockerReplay) + case noneSet: + t.Logf("Neither %s nor %s is set, running test case without modifications", EnvNameHTTPMockerCapture, EnvNameHTTPMockerReplay) + case IsReplay(): + err = enableReplayForTestCase(t, &config, testCase) + case IsCapture(): + err = enableCaptureForTestCase(t, &config, testCase) } - selfPath := replaceVars(i.Path, vars) - return selfPath == urlPath && i.Version == version -} - -type stepRequests struct { - DiffRequests []RequestInfo `yaml:"diff_requests"` - RequestResponses []RequestInfo `yaml:"request_responses"` + require.NoError(t, err) + resource.ParallelTest(t, *testCase) } -type mockHTTPData struct { - Variables map[string]string `yaml:"variables"` - Steps []stepRequests `yaml:"steps"` - StepCount int `yaml:"step_count"` +type mockClientModifier struct { + config *MockHTTPDataConfig + mockRoundTripper http.RoundTripper + oldRoundTripper http.RoundTripper } -type MockHTTPDataConfig struct { - AllowMissingRequests bool - AllowReReadGet bool +func (c *mockClientModifier) ModifyHTTPClient(httpClient *http.Client) error { + c.oldRoundTripper = httpClient.Transport + httpClient.Transport = c.mockRoundTripper + return nil } -func parseTestDataConfigYAML(filePath string) (*mockHTTPData, error) { - data, err := os.ReadFile(filePath) - if err != nil { - return nil, err - } - var testData mockHTTPData - err = yaml.Unmarshal(data, &testData) - if err != nil { - return nil, err +func (c *mockClientModifier) ResetHTTPClient(httpClient *http.Client) { + if c.oldRoundTripper != nil { + httpClient.Transport = c.oldRoundTripper } - return &testData, nil } -func MockTestCaseAndRun(t *testing.T, vars map[string]string, config *MockHTTPDataConfig, testCase *resource.TestCase) { +func enableReplayForTestCase(t *testing.T, config *MockHTTPDataConfig, testCase *resource.TestCase) error { t.Helper() - roundTripper, checkFunc := MockRoundTripper(t, vars, config) - testCase.ProtoV6ProviderFactories = TestAccProviderV6FactoriesWithMock(t, roundTripper) - testCase.PreCheck = nil - stepCount := len(testCase.Steps) - for i := range stepCount - 1 { + tfConfigs := extractAndNormalizeConfig(t, testCase) + data := ReadMockData(t, tfConfigs) + roundTripper, mockRoundTripper := NewMockRoundTripper(t, config, data) + httpClientModifier := mockClientModifier{config: config, mockRoundTripper: roundTripper} + testCase.ProtoV6ProviderFactories = TestAccProviderV6FactoriesWithMock(t, &httpClientModifier) + testCase.PreCheck = func() { + if config.SideEffect != nil { + require.NoError(t, config.SideEffect()) + } + } + require.Equal(t, len(testCase.Steps), len(data.Steps), "Number of steps in test case and mock data should match") + checkFunc := mockRoundTripper.CheckStepRequests + for i := range testCase.Steps { step := &testCase.Steps[i] - if oldCheck := step.Check; oldCheck != nil { - step.Check = resource.ComposeAggregateTestCheckFunc(oldCheck, checkFunc) - } - } - // Using CheckDestroy for the final step assertions to allow mocked responses in cleanup - oldCheckDestroy := testCase.CheckDestroy - newCheckDestroy := func(s *terraform.State) error { - if oldCheckDestroy != nil { - if err := oldCheckDestroy(s); err != nil { - return err + oldSkip := step.SkipFunc + step.SkipFunc = func() (bool, error) { + mockRoundTripper.IncreaseStepNumberAndInit() + if os.Getenv("TF_LOG") == "DEBUG" && tfConfigs[i] != "" { + t.Logf("Step %d:\n%s\n", i+1, tfConfigs[i]) + } + var shouldSkip bool + var err error + if oldSkip != nil { + shouldSkip, err = oldSkip() } + return shouldSkip, err + } + if i == len(testCase.Steps)-1 { + // Last check done in checkDestroy to support checking DELETE calls + step.Check = wrapClientDuringCheck(step.Check, &httpClientModifier) + } else { + step.Check = wrapClientDuringCheck(step.Check, &httpClientModifier, checkFunc) } - return checkFunc(s) } - testCase.CheckDestroy = newCheckDestroy - resource.ParallelTest(t, *testCase) + testCase.CheckDestroy = wrapClientDuringCheck(testCase.CheckDestroy, &httpClientModifier, checkFunc) + return nil } -func MockRoundTripper(t *testing.T, vars map[string]string, config *MockHTTPDataConfig) (http.RoundTripper, resource.TestCheckFunc) { +func ReadMockData(t *testing.T, tfConfigs []string) *MockHTTPData { t.Helper() - testDir := "testdata" - httpDataPath := path.Join(testDir, t.Name()+".yaml") - data, err := parseTestDataConfigYAML(httpDataPath) - require.NoError(t, err) - myTransport := httpmock.NewMockTransport() - var mockTransport http.RoundTripper = myTransport - g := goldie.New(t, goldie.WithTestNameForDir(true), goldie.WithNameSuffix(".json")) - tracker := requestTracker{data: data, g: g, vars: vars, t: t} - if config != nil { - tracker.allowMissingRequests = config.AllowMissingRequests - tracker.allowReReadGet = config.AllowReReadGet - } - err = tracker.initStep() + httpDataPath := MockConfigFilePath(t) + data, err := ParseTestDataConfigYAML(httpDataPath) require.NoError(t, err) - for _, method := range []string{"GET", "POST", "PUT", "DELETE", "PATCH"} { - myTransport.RegisterRegexpResponder(method, regexp.MustCompile(".*"), tracker.receiveRequest(method)) - } - return mockTransport, tracker.checkStepRequests -} - -var versionDatePattern = regexp.MustCompile(`(\d{4}-\d{2}-\d{2})`) - -func ExtractVersion(contentType string) (string, error) { - match := versionDatePattern.FindStringSubmatch(contentType) - if len(match) > 1 { - return match[1], nil - } - return "", fmt.Errorf("could not extract version from %s header", contentType) -} - -type requestTracker struct { - t *testing.T - g *goldie.Goldie - data *mockHTTPData - vars map[string]string - usedResponses map[string]int - foundsDiffs map[int]string - currentStepIndex int - diffResponseIndex int - allowMissingRequests bool - allowReReadGet bool -} - -func (r *requestTracker) allowReUse(method string) bool { - return r.allowReReadGet && method == "GET" -} - -func (r *requestTracker) requestFilename(requestID string, index int) string { - return strings.ReplaceAll(fmt.Sprintf("%02d_%02d_%s", r.currentStepIndex+1, index+1, requestID), "/", "_") -} - -func (r *requestTracker) manualFilenameIfExist(requestID string, index int) string { - defaultFilestem := strings.ReplaceAll(fmt.Sprintf("%02d_%02d_%s", r.currentStepIndex+1, index+1, requestID), "/", "_") - manualFilestem := defaultFilestem + "_manual" - if _, err := os.Stat("testdata" + "/" + r.t.Name() + "/" + manualFilestem + ".json"); err == nil { - return manualFilestem - } - return defaultFilestem -} - -func (r *requestTracker) initStep() error { - require.Len(r.t, r.data.Steps, r.data.StepCount, "step count didn't match steps") - usedKeys := strings.Join(acc.SortStringMapKeys(r.vars), ", ") - expectedKeys := strings.Join(acc.SortStringMapKeys(r.data.Variables), ", ") - require.Equal(r.t, expectedKeys, usedKeys, "mock variables didn't match mock data variables") - r.usedResponses = map[string]int{} - r.foundsDiffs = map[int]string{} - step := r.currentStep() - if step == nil { - return nil - } - for index, req := range step.DiffRequests { - err := r.g.Update(r.t, r.requestFilename(req.idShort(), index), []byte(replaceVars(req.Text, r.vars))) - if err != nil { - return err + oldVariables := data.Variables + data.Variables = map[string]string{} + data.useTFConfigs(t, tfConfigs) + newVariables := data.Variables + for key, value := range oldVariables { + if _, ok := newVariables[key]; !ok { + t.Logf("Variable %s=%s not found from TF Config, probably discovered in request path", key, value) } } - r.nextDiffResponseIndex() - return nil -} - -func (r *requestTracker) nextDiffResponseIndex() { - step := r.currentStep() - if step == nil { - r.t.Fatal("no more steps, in testCase") - } - for index, req := range step.DiffRequests { - if _, ok := r.foundsDiffs[index]; !ok { - r.diffResponseIndex = req.Responses[0].ResponseIndex - return + for key, value := range newVariables { + if _, ok := oldVariables[key]; !ok { + t.Logf("Variable %s=%s not found in Mock Data, has the TF Config updated?", key, value) } } - // no more diffs in current step, any response index will do, assuming never more than 100k responses - r.diffResponseIndex = 99999 -} - -func (r *requestTracker) currentStep() *stepRequests { - if r.currentStepIndex >= r.data.StepCount { - return nil - } - return &r.data.Steps[r.currentStepIndex] + return data } -func (r *requestTracker) checkStepRequests(_ *terraform.State) error { - missingRequests := []string{} - step := r.currentStep() - for _, req := range step.RequestResponses { - missingRequestsCount := len(req.Responses) - r.usedResponses[req.id()] - if missingRequestsCount > 0 { - missingIndexes := []string{} - for i := 0; i < missingRequestsCount; i++ { - missingResponse := (len(req.Responses) - missingRequestsCount) + i - missingIndexes = append(missingIndexes, fmt.Sprintf("%d", req.Responses[missingResponse].ResponseIndex)) +func enableCaptureForTestCase(t *testing.T, config *MockHTTPDataConfig, testCase *resource.TestCase) error { + t.Helper() + stepCount := len(testCase.Steps) + tfConfigs := extractAndNormalizeConfig(t, testCase) + capturedData := NewMockHTTPData(t, stepCount, tfConfigs) + clientModifier := NewCaptureMockConfigClientModifier(t, config, capturedData) + testCase.ProtoV6ProviderFactories = TestAccProviderV6FactoriesWithMock(t, clientModifier) + for i := range stepCount { + step := &testCase.Steps[i] + oldSkip := step.SkipFunc + step.SkipFunc = func() (bool, error) { + clientModifier.IncreaseStepNumber() + var shouldSkip bool + var err error + if oldSkip != nil { + shouldSkip, err = oldSkip() } - missingIndexesStr := strings.Join(missingIndexes, ", ") - missingRequests = append(missingRequests, fmt.Sprintf("missing %d requests of %s (%s)", missingRequestsCount, req.idShort(), missingIndexesStr)) - } - } - if r.allowMissingRequests { - if len(missingRequests) > 0 { - r.t.Logf("missing requests:\n%s", strings.Join(missingRequests, "\n")) + return shouldSkip, err } - } else { - assert.Empty(r.t, missingRequests) + step.Check = wrapClientDuringCheck(step.Check, clientModifier) } - missingDiffs := []string{} - for i, req := range step.DiffRequests { - if _, ok := r.foundsDiffs[i]; !ok { - missingDiffs = append(missingDiffs, fmt.Sprintf("missing diff request %s", req.idShort())) + + writeCapturedData := func() { + clientModifier.NormalizeCapturedData() + filePath := MockConfigFilePath(t) + if t.Failed() { + filePath = FailedFilename(filePath) } + err := clientModifier.WriteCapturedData(filePath) + require.NoError(t, err) } - assert.Empty(r.t, missingDiffs) - for index, payload := range r.foundsDiffs { - diff := step.DiffRequests[index] - filename := r.manualFilenameIfExist(diff.idShort(), index) - r.t.Logf("checking diff %s", filename) - r.g.Assert(r.t, filename, []byte(payload)) - } - r.currentStepIndex++ - return r.initStep() + t.Cleanup(writeCapturedData) + testCase.CheckDestroy = wrapClientDuringCheck(testCase.CheckDestroy, clientModifier) + return nil } -func (r *requestTracker) receiveRequest(method string) func(req *http.Request) (*http.Response, error) { - return func(req *http.Request) (*http.Response, error) { - acceptHeader := req.Header.Get("Accept") - version, err := ExtractVersion(acceptHeader) - if err != nil { - return nil, err - } - var payload string - if req.Body != nil { - payloadBytes, err := io.ReadAll(req.Body) - if err != nil { - return nil, err - } - payload = string(payloadBytes) - } - text, status, err := r.matchRequest(method, req.URL.Path, version, payload) - if err != nil { - return nil, err - } - response := httpmock.NewStringResponse(status, text) - response.Header.Set("Content-Type", fmt.Sprintf("application/vnd.atlas.%s+json;charset=utf-8", version)) - return response, nil +func extractAndNormalizeConfig(t *testing.T, testCase *resource.TestCase) []string { + t.Helper() + stepCount := len(testCase.Steps) + tfConfigs := make([]string, stepCount) + for i := range testCase.Steps { + tfConfigs[i] = hcl.PrettyHCL(t, testCase.Steps[i].Config) } + return tfConfigs } -func normalizePayload(payload string) (string, error) { - if payload == "" { - return "", nil - } - var tempHolder any - err := json.Unmarshal([]byte(payload), &tempHolder) - if err != nil { - return "", err - } - sb := strings.Builder{} - encoder := json.NewEncoder(&sb) - encoder.SetIndent("", " ") - err = encoder.Encode(tempHolder) - if err != nil { - return "", err - } - return strings.TrimSuffix(sb.String(), "\n"), nil +func MockConfigFilePath(t *testing.T) string { + t.Helper() + testDir := "testdata" + return path.Join(testDir, t.Name()+configFileExtension) } -func (r *requestTracker) matchRequest(method, urlPath, version, payload string) (response string, statusCode int, err error) { - step := r.currentStep() - if step == nil { - return "", 0, fmt.Errorf("no more steps in mock data") - } - for index, request := range step.DiffRequests { - if !request.Match(method, urlPath, version, r.vars) { - continue - } - if _, ok := r.foundsDiffs[index]; ok { - continue - } - normalizedPayload, err := normalizePayload(payload) - if err != nil { - return "", 0, err - } - r.foundsDiffs[index] = normalizedPayload - r.nextDiffResponseIndex() - break - } - nextDiffResponse := r.diffResponseIndex +var accClientLock = &sync.Mutex{} - for _, request := range step.RequestResponses { - if !request.Match(method, urlPath, version, r.vars) { - continue - } - requestID := request.id() - nextIndex := r.usedResponses[requestID] - if nextIndex >= len(request.Responses) { - if r.allowReReadGet && method == "GET" { - nextIndex = len(request.Responses) - 1 - } else { - continue +func wrapClientDuringCheck(oldCheck resource.TestCheckFunc, clientModifier HTTPClientModifier, extraChecks ...resource.TestCheckFunc) resource.TestCheckFunc { + if oldCheck == nil && len(extraChecks) == 0 { + return nil + } + return func(s *terraform.State) error { + accClientLock.Lock() + accClient := acc.ConnV2().GetConfig().HTTPClient + modifyErr := clientModifier.ModifyHTTPClient(accClient) + defer func() { + clientModifier.ResetHTTPClient(accClient) + accClientLock.Unlock() + }() + if modifyErr != nil { + return modifyErr + } + if oldCheck != nil { + if err := oldCheck(s); err != nil { + return err } - } - response := request.Responses[nextIndex] - // cannot return a response that is sent after a diff response - if response.ResponseIndex > nextDiffResponse { - prevIndex := nextIndex - 1 - if prevIndex >= 0 && r.allowReUse(method) { - response = request.Responses[prevIndex] - r.t.Logf("re-reading GET request with response_index=%d as diff hasn't been returned yet (%d)", response.ResponseIndex, nextDiffResponse) - return replaceVars(response.Text, r.vars), response.Status, nil + for _, check := range extraChecks { + if err := check(s); err != nil { + return err + } } - continue } - r.usedResponses[requestID]++ - return replaceVars(response.Text, r.vars), response.Status, nil + return nil } - return "", 0, fmt.Errorf("no matching request found %s %s %s", method, urlPath, version) } diff --git a/internal/testutil/unit/http_mocker_api_paths.go b/internal/testutil/unit/http_mocker_api_paths.go new file mode 100644 index 0000000000..a8c89718b8 --- /dev/null +++ b/internal/testutil/unit/http_mocker_api_paths.go @@ -0,0 +1,134 @@ +package unit + +import ( + "context" + "fmt" + "io" + "net/http" + "os" + "path" + "strings" + "time" + + "gopkg.in/yaml.v3" +) + +type OpenapiSchema struct { + Paths map[string]map[string]interface{} `yaml:"paths"` +} + +func parseModel(apiSpecPath string) (OpenapiSchema, error) { + data, err := os.ReadFile(apiSpecPath) + if err != nil { + return OpenapiSchema{}, err + } + + var model OpenapiSchema + err = yaml.Unmarshal(data, &model) + if err != nil { + return OpenapiSchema{}, err + } + + return model, nil +} + +func parseAPISpecPaths(apiSpecPath string) (map[string][]APISpecPath, error) { + model, err := parseModel(apiSpecPath) + if err != nil { + return nil, err + } + paths := make(map[string][]APISpecPath) + for path, pathDict := range model.Paths { + for method := range pathDict { + methodUpper := strings.ToUpper(method) + paths[methodUpper] = append(paths[methodUpper], APISpecPath{Path: path}) + } + } + return paths, nil +} + +// copied from tools/codegen/openapi/parser.go +const ( + atlasAdminAPISpecURL = "https://raw.githubusercontent.com/mongodb/atlas-sdk-go/main/openapi/atlas-api-transformed.yaml" + specFileRelPath = "tools/codegen/open-api-spec.yml" +) + +func DownloadOpenAPISpec(url, specFilePath string) (err error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody) + if err != nil { + return err + } + + client := http.Client{} + res, getErr := client.Do(req) + if getErr != nil { + return getErr + } + + if res.Body != nil { + defer res.Body.Close() + } + + body, readErr := io.ReadAll(res.Body) + if readErr != nil { + return readErr + } + + err = os.WriteFile(specFilePath, body, 0o600) + return err +} + +var apiSpecPaths map[string][]APISpecPath + +func ReadAPISpecPaths() map[string][]APISpecPath { + return apiSpecPaths +} + +func fileExist(fullPath string) bool { + _, err := os.Stat(fullPath) + if err == nil { + return true + } + return !os.IsNotExist(err) +} + +func fullPath(relPath string) string { + workDir, err := os.Getwd() + if err != nil { + panic(fmt.Sprintf("error getting working directory: %s", err)) + } + workdDirParts := strings.Split(workDir, "/") + workdDirParts[0] = "/" + workdDirParts[0] + for i := range workdDirParts { + parentCandidate := workdDirParts[:len(workdDirParts)-i] + parentCandidate = append(parentCandidate, ".git") + gitDir := path.Join(parentCandidate...) + if fileExist(gitDir) { + repoPath, _ := strings.CutSuffix(gitDir, ".git") + return path.Join(repoPath, relPath) + } + } + panic("could not find repo root") +} + +func init() { + InitializeAPISpecPaths() +} + +func InitializeAPISpecPaths() { + specPath := fullPath(specFileRelPath) + var err error + if !fileExist(specPath) { + err = DownloadOpenAPISpec(atlasAdminAPISpecURL, specPath) + if err != nil { + panic(fmt.Sprintf("error downloading OpenAPI spec: %s", err)) + } + } + apiSpecPaths, err = parseAPISpecPaths(specPath) + if err != nil { + panic(fmt.Sprintf("error parsing OpenAPI spec: %s", err)) + } +} diff --git a/internal/testutil/unit/http_mocker_api_paths_test.go b/internal/testutil/unit/http_mocker_api_paths_test.go new file mode 100644 index 0000000000..e5239d9cf7 --- /dev/null +++ b/internal/testutil/unit/http_mocker_api_paths_test.go @@ -0,0 +1,23 @@ +package unit_test + +import ( + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestApiPathsParsing(t *testing.T) { + specParts := unit.ReadAPISpecPaths() + assert.Len(t, specParts, 5) + assert.Contains(t, specParts, "GET") + processArgsPath := "/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/processArgs" + getPaths := specParts["GET"] + found1, err := unit.FindNormalizedPath(processArgsPath, &getPaths) + require.NoError(t, err) + assert.Equal(t, "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs", found1.Path) + variables := found1.Variables(processArgsPath) + assert.Equal(t, "6746ceed6f62fc3c122a3e0e", variables["groupId"]) + assert.Equal(t, "test-acc-tf-c-7871793563057636102", variables["clusterName"]) +} diff --git a/internal/testutil/unit/http_mocker_config_capture.go b/internal/testutil/unit/http_mocker_config_capture.go new file mode 100644 index 0000000000..3a35ae5da4 --- /dev/null +++ b/internal/testutil/unit/http_mocker_config_capture.go @@ -0,0 +1,185 @@ +package unit + +import ( + "fmt" + "io" + "net/http" + "os" + "path" + "sort" + "strings" + "testing" + "time" + + "gopkg.in/yaml.v3" +) + +func configureIsDiff(config *MockHTTPDataConfig) func(*RoundTrip) bool { + return func(rt *RoundTrip) bool { + if rt.Request.Method == "GET" { + return false + } + if config == nil { + return true + } + if config.IsDiffSkipSuffixes != nil { + for _, suffix := range config.IsDiffSkipSuffixes { + if strings.HasSuffix(rt.Request.Path, suffix) { + return false + } + } + } + if config.IsDiffMustSubstrings != nil { + for _, substring := range config.IsDiffMustSubstrings { + if !strings.Contains(rt.Request.Path, substring) { + return false + } + } + } + return true + } +} + +func configureQueryVars(config *MockHTTPDataConfig) []string { + if config == nil { + return nil + } + vars := config.QueryVars + sort.Strings(vars) + return vars +} + +func NewCaptureMockConfigClientModifier(t *testing.T, config *MockHTTPDataConfig, data *MockHTTPData) *CaptureMockConfigClientModifier { + t.Helper() + return &CaptureMockConfigClientModifier{ + t: t, + isDiff: configureIsDiff(config), + queryVars: configureQueryVars(config), + capturedData: data, + } +} + +type CaptureMockConfigClientModifier struct { + oldTransport http.RoundTripper + t *testing.T + isDiff func(*RoundTrip) bool + capturedData *MockHTTPData + queryVars []string + responseIndex int + stepNumber int +} + +func (c *CaptureMockConfigClientModifier) IncreaseStepNumber() { + c.stepNumber++ +} + +func (c *CaptureMockConfigClientModifier) ModifyHTTPClient(httpClient *http.Client) error { + c.oldTransport = httpClient.Transport + httpClient.Transport = c + return nil +} + +func (c *CaptureMockConfigClientModifier) ResetHTTPClient(httpClient *http.Client) { + if c.oldTransport != nil { + httpClient.Transport = c.oldTransport + } +} + +func (c *CaptureMockConfigClientModifier) RoundTrip(req *http.Request) (*http.Response, error) { + // Capture request body to avoid it being consumed + originalBody, normalizedBody, err := extractAndNormalizePayload(req.Body) + if err != nil { + return nil, err + } + req.Body = io.NopCloser(strings.NewReader(originalBody)) + + resp, err := c.oldTransport.RoundTrip(req) + if err != nil { + return nil, err + } + + c.responseIndex++ + specPaths := apiSpecPaths[req.Method] + rt, parseError := parseRoundTrip(req, resp, c.responseIndex, c.stepNumber, &specPaths, normalizedBody, c.queryVars) + if parseError != nil { + c.t.Logf("error parsing round trip: %s", parseError) + return resp, err + } + addError := c.capturedData.AddRoundtrip(c.t, rt, c.isDiff(rt)) + if addError != nil { + c.t.Logf("error adding round trip: %s", addError) + } + return resp, err +} + +func (c *CaptureMockConfigClientModifier) NormalizeCapturedData() { + c.capturedData.Normalize() +} + +func (c *CaptureMockConfigClientModifier) ConfigYaml() (string, error) { + initialYaml := strings.Builder{} + e := yaml.NewEncoder(&initialYaml) + e.SetIndent(1) + err := e.Encode(c.capturedData) + return initialYaml.String(), err +} + +func (c *CaptureMockConfigClientModifier) WriteCapturedData(filePath string) error { + configYaml, err := c.ConfigYaml() + if err != nil { + return err + } + dirPath := path.Dir(filePath) + if !fileExist(dirPath) { + err := os.Mkdir(dirPath, 0o755) + if err != nil { + return err + } + } + // will override content if file exists + err = os.WriteFile(filePath, []byte(configYaml), 0o600) + if err != nil { + return err + } + return nil +} + +func FailedFilename(filePath string) string { + dirName := path.Dir(filePath) + formattedTime := time.Now().Format("2006-01-02-15-04") + stem, _ := strings.CutSuffix(path.Base(filePath), configFileExtension) + return path.Join(dirName, fmt.Sprintf("%s_failed_%s", stem, formattedTime)) + configFileExtension +} + +func parseRoundTrip(req *http.Request, resp *http.Response, responseIndex, stepNumber int, specPaths *[]APISpecPath, requestPayload string, queryVars []string) (*RoundTrip, error) { + version := ExtractVersionRequestResponse(req.Header.Get("Accept"), resp.Header.Get("Content-Type")) + if version == "" { + return nil, fmt.Errorf("could not find version in request or response headers for responseIndex %d", responseIndex) + } + normalizedPath, err := FindNormalizedPath(req.URL.Path, specPaths) + if err != nil { + return nil, err + } + originalResponsePayload, responsePayload, err := extractAndNormalizePayload(resp.Body) + if err != nil { + return nil, err + } + // Write back response body to support reading it again + resp.Body = io.NopCloser(strings.NewReader(originalResponsePayload)) + return &RoundTrip{ + QueryString: relevantQuery(queryVars, req.URL.Query()), + Variables: normalizedPath.Variables(req.URL.Path), + StepNumber: stepNumber, + Request: RequestInfo{ + Version: version, + Path: removeQueryParamsAndTrim(req.URL.Path), + Method: req.Method, + Text: requestPayload, + }, + Response: statusText{ + Text: responsePayload, + Status: resp.StatusCode, + ResponseIndex: responseIndex, + }, + }, nil +} diff --git a/internal/testutil/unit/http_mocker_config_capture_test.go b/internal/testutil/unit/http_mocker_config_capture_test.go new file mode 100644 index 0000000000..68e58e43a6 --- /dev/null +++ b/internal/testutil/unit/http_mocker_config_capture_test.go @@ -0,0 +1,95 @@ +package unit_test + +import ( + _ "embed" + "net/http" + "regexp" + "testing" + + "github.com/jarcoal/httpmock" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" + "github.com/sebdah/goldie/v2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + //go:embed testdata/CaptureTest/createCluster.json + createClusterReqBody string + //go:embed testdata/CaptureTest/createClusterResponse.json + createClusterRespBody string + //go:embed testdata/CaptureTest/getClusterIdle.json + getClusterIdleRespBody string + //go:embed testdata/CaptureTest/getContainersAws.json + getContainersAws string + //go:embed testdata/CaptureTest/getContainersAzure.json + getContainersAzure string +) + +func TestFailedFilename(t *testing.T) { + normalName := unit.MockConfigFilePath(t) + assert.Equal(t, "testdata/TestFailedFilename.yaml", normalName) + failedName := unit.FailedFilename(normalName) + assert.Contains(t, failedName, "testdata/TestFailedFilename_failed") +} + +func TestCaptureMockConfigClientModifier_clusterExample(t *testing.T) { + capturedData := unit.NewMockHTTPData(t, 3, []string{"resource \"dummy\" \"test\"{\n step = 1\n someString = \"my-string\"\n}", "", "resource \"dummy\" \"test\"{\n step = 3\n}"}) + clientModifier := unit.NewCaptureMockConfigClientModifier(t, &unit.MockHTTPDataConfig{QueryVars: []string{"providerName"}}, capturedData) + transport := httpmock.NewMockTransport() + client := http.Client{Transport: transport} + err := clientModifier.ModifyHTTPClient(&client) + require.NoError(t, err) + + // Step 1: Create a cluster + clientModifier.IncreaseStepNumber() + responder1 := httpmock.NewStringResponder(201, createClusterRespBody) + transport.RegisterRegexpResponder("POST", regexp.MustCompile(".*"), responder1) + createRequest := request("POST", "/api/atlas/v2/groups/g1/clusters", createClusterReqBody) + resp, err := client.Do(createRequest) + require.NoError(t, err) + assert.Equal(t, 201, resp.StatusCode) + createResponse := parseMapStringAny(t, resp) + assert.Equal(t, "test-acc-tf-c-7871793563057636102", createResponse["name"]) + + // Step 2: Read cluster + clientModifier.IncreaseStepNumber() + getResponses := []string{createClusterRespBody, getClusterIdleRespBody, getClusterIdleRespBody} + expectedState := []string{"CREATING", "IDLE", "IDLE"} + for i := range getResponses { + transport.Reset() + responder2 := httpmock.NewStringResponder(200, getResponses[i]) + transport.RegisterRegexpResponder("GET", regexp.MustCompile(".*"), responder2) + getRequest := request("GET", "/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102", "") + resp, err = client.Do(getRequest) + require.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + getResponse := parseMapStringAny(t, resp) + assert.Equal(t, expectedState[i], getResponse["stateName"]) + } + + // Step 3: Read containers, capture query args + clientModifier.IncreaseStepNumber() + containersGetResponses := []string{getContainersAws, getContainersAzure} + containersExpectedIDs := []string{"6746ceedaef48d1cb265896b", "6746cefbaef48d1cb2658bbb"} + containersGetPaths := []string{ + "/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?includeCount=true&itemsPerPage=100&pageNum=1&providerName=AWS", + "/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?includeCount=true&itemsPerPage=100&pageNum=1&providerName=AZURE", + } + for i := range containersGetResponses { + transport.Reset() + responder3 := httpmock.NewStringResponder(200, containersGetResponses[i]) + transport.RegisterRegexpResponder("GET", regexp.MustCompile(".*"), responder3) + getRequest := request("GET", containersGetPaths[i], "") + resp, err = client.Do(getRequest) + require.NoError(t, err) + assert.Equal(t, 200, resp.StatusCode) + getResponse := parseMapStringAny(t, resp) + assert.Equal(t, containersExpectedIDs[i], getResponse["results"].([]any)[0].(map[string]any)["id"]) + } + + g := goldie.New(t, goldie.WithTestNameForDir(true), goldie.WithNameSuffix(".yaml")) + configYaml, err := clientModifier.ConfigYaml() + require.NoError(t, err) + g.Assert(t, t.Name(), []byte(configYaml)) +} diff --git a/internal/testutil/unit/http_mocker_data.go b/internal/testutil/unit/http_mocker_data.go new file mode 100644 index 0000000000..b21a54cbb2 --- /dev/null +++ b/internal/testutil/unit/http_mocker_data.go @@ -0,0 +1,385 @@ +package unit + +import ( + "fmt" + "net/url" + "regexp" + "sort" + "strings" + "testing" + + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" +) + +type statusText struct { + Text string `yaml:"text"` + ResponseIndex int `yaml:"response_index"` + Status int `yaml:"status"` + DuplicateResponses int `yaml:"duplicate_responses"` +} + +func (s statusText) MarshalYAML() (interface{}, error) { + childNodes := []*yaml.Node{ + {Kind: yaml.ScalarNode, Value: "response_index"}, + {Kind: yaml.ScalarNode, Value: fmt.Sprintf("%d", s.ResponseIndex)}, + + {Kind: yaml.ScalarNode, Value: "status"}, + {Kind: yaml.ScalarNode, Value: fmt.Sprintf("%d", s.Status)}, + } + if s.DuplicateResponses > 0 { + childNodes = append(childNodes, + &yaml.Node{Kind: yaml.ScalarNode, Value: "duplicate_responses"}, + &yaml.Node{Kind: yaml.ScalarNode, Value: fmt.Sprintf("%d", s.DuplicateResponses)}, + ) + } + childNodes = append(childNodes, + &yaml.Node{Kind: yaml.ScalarNode, Value: "text"}, + &yaml.Node{Kind: yaml.ScalarNode, Value: s.Text, Tag: "!!str", Style: yaml.DoubleQuotedStyle}, + ) + return &yaml.Node{ + Kind: yaml.MappingNode, + Content: childNodes, + }, nil +} + +func (s *statusText) IncreaseDuplicateResponses() { + s.DuplicateResponses++ +} + +type RequestInfo struct { + Path string `yaml:"path"` + Method string `yaml:"method"` + Version string `yaml:"version"` + Text string `yaml:"text"` + Responses []statusText `yaml:"responses"` +} + +// Custom marshaling is necessary to use `flow` style only on response fields (text and responses.*.text) +func (i RequestInfo) MarshalYAML() (any, error) { //nolint:gocritic // Using a pointer method leads to inconsistent dump results + responseNode := []*yaml.Node{} + for _, response := range i.Responses { + node, err := response.MarshalYAML() + if err != nil { + return nil, err + } + responseNode = append(responseNode, node.(*yaml.Node)) + } + childNodes := []*yaml.Node{ + {Kind: yaml.ScalarNode, Value: "path"}, + {Kind: yaml.ScalarNode, Value: i.Path}, + {Kind: yaml.ScalarNode, Value: "method"}, + {Kind: yaml.ScalarNode, Value: i.Method}, + {Kind: yaml.ScalarNode, Value: "version"}, + {Kind: yaml.ScalarNode, Value: i.Version, Tag: "!!str", Style: yaml.SingleQuotedStyle}, + {Kind: yaml.ScalarNode, Value: "text"}, + {Kind: yaml.ScalarNode, Value: i.Text, Tag: "!!str", Style: yaml.DoubleQuotedStyle}, + {Kind: yaml.ScalarNode, Value: "responses"}, + {Kind: yaml.SequenceNode, Content: responseNode}, + } + return &yaml.Node{ + Kind: yaml.MappingNode, + Style: yaml.FoldedStyle, + Content: childNodes, + }, nil +} + +func (i *RequestInfo) id() string { + return fmt.Sprintf("%s_%s", i.idShort(), i.Text) +} + +func (i *RequestInfo) idShort() string { + return fmt.Sprintf("%s_%s_%s", i.Method, i.Path, i.Version) +} + +func (i *RequestInfo) NormalizePath(reqURL *url.URL) string { + queryVars := i.QueryVars() + if len(queryVars) == 0 { + return reqURL.Path + } + queryString := relevantQuery(queryVars, reqURL.Query()) + if queryString == "" { + return removeQueryParamsAndTrim(reqURL.Path) + } + return removeQueryParamsAndTrim(reqURL.Path) + "?" + queryString +} + +func (i *RequestInfo) QueryVars() []string { + selfURL, _ := url.Parse("http://localhost" + i.Path) + query := selfURL.Query() + queryVars := []string{} + for key := range query { + queryVars = append(queryVars, key) + } + return queryVars +} + +func (i *RequestInfo) Match(t *testing.T, method, version string, reqURL *url.URL, mockData *MockHTTPData) bool { + t.Helper() + if i.Method != method || i.Version != version { + return false + } + reqPath := i.NormalizePath(reqURL) + if replaceVars(i.Path, mockData.Variables) == reqPath { + return true + } + apiPath := APISpecPath{Path: removeQueryParamsAndTrim(i.Path)} + if !apiPath.Match(reqURL.Path) { + return false + } + pathVars := apiPath.Variables(reqURL.Path) + err := mockData.UpdateVariablesIgnoreChanges(t, pathVars) + if err != nil { + t.Error(err) + return false + } + return replaceVars(i.Path, mockData.Variables) == reqPath +} + +// There is an issue when dumping the yaml, if the \n \n sequence is found it will always dump using the DoubleQuotedStyle, workaround by using this custom dumping. +type Literal string + +func (l Literal) MarshalYAML() (any, error) { + if l == "" { + return "", nil + } + return &yaml.Node{ + Kind: yaml.ScalarNode, + Value: strings.ReplaceAll(string(l), "\n \n", "\n\n"), + Style: yaml.LiteralStyle, + Tag: "!!str", + }, nil +} + +type stepRequests struct { + Config Literal `yaml:"config,omitempty"` + DiffRequests []RequestInfo `yaml:"diff_requests"` + RequestResponses []RequestInfo `yaml:"request_responses"` +} + +func (s *stepRequests) findRequest(request *RequestInfo) (*RequestInfo, bool) { + for i := range s.RequestResponses { + if s.RequestResponses[i].id() == request.id() { + return &s.RequestResponses[i], true + } + } + return nil, false +} + +func (s *stepRequests) AddRequest(request *RequestInfo, isDiff bool) { + if isDiff { + s.DiffRequests = append(s.DiffRequests, *request) + } + existing, found := s.findRequest(request) + if found { + lastResponse := existing.Responses[len(existing.Responses)-1] + newResponse := request.Responses[0] + if lastResponse.Status == newResponse.Status && lastResponse.Text == newResponse.Text { + existing.Responses[len(existing.Responses)-1].IncreaseDuplicateResponses() + } else { + existing.Responses = append(existing.Responses, newResponse) + } + } else { + s.RequestResponses = append(s.RequestResponses, *request) + } +} + +type RoundTrip struct { + Variables map[string]string + QueryString string + Request RequestInfo + Response statusText + StepNumber int +} + +func NewMockHTTPData(t *testing.T, stepCount int, tfConfigs []string) *MockHTTPData { + t.Helper() + steps := make([]stepRequests, stepCount) + data := MockHTTPData{ + Steps: steps, + Variables: map[string]string{}, + } + data.useTFConfigs(t, tfConfigs) + return &data +} + +type VariableChange struct { + OldName string + NewName string + OldValue string + NewValue string +} + +type VariablesChangedError struct { + Changes []VariableChange +} + +func (e VariablesChangedError) Error() string { + return fmt.Sprintf("variables changed: %v", e.Changes) +} + +func (e VariablesChangedError) ChangedNamesMap() map[string]string { + result := map[string]string{} + for _, change := range e.Changes { + result[change.OldName] = change.NewName + } + return result +} + +func (e VariablesChangedError) ChangedValuesMap() map[string]string { + result := map[string]string{} + for _, change := range e.Changes { + result[change.OldValue] = change.NewValue + } + return result +} + +type MockHTTPData struct { + Variables map[string]string `yaml:"variables"` + Steps []stepRequests `yaml:"steps"` +} + +func (m *MockHTTPData) useTFConfigs(t *testing.T, tfConfigs []string) { + t.Helper() + require.Equal(t, len(tfConfigs), len(m.Steps), "Number of steps in test case and mock data should match") + for i := range tfConfigs { + tfConfig := tfConfigs[i] + configVars := ExtractConfigVariables(t, tfConfig) + err := m.UpdateVariablesIgnoreChanges(t, configVars) + require.NoError(t, err) + m.Steps[i].Config = Literal(tfConfig) + } +} + +// Normalize happens after all data is captured, as a cluster.name might only be discovered as a variable in later steps +func (m *MockHTTPData) Normalize() { + for i := range m.Steps { + step := &m.Steps[i] + for j := range step.RequestResponses { + request := &step.RequestResponses[j] + m.normalizeRequest(request) + } + for j := range step.DiffRequests { + request := &step.DiffRequests[j] + m.normalizeRequest(request) + } + } +} + +func (m *MockHTTPData) normalizeRequest(request *RequestInfo) { + request.Text = useVars(m.Variables, request.Text) + for k := range request.Responses { + response := &request.Responses[k] + response.Text = useVars(m.Variables, response.Text) + } +} + +func (m *MockHTTPData) AddRoundtrip(t *testing.T, rt *RoundTrip, isDiff bool) error { + t.Helper() + rtVariables := rt.Variables + err := m.UpdateVariables(t, rtVariables) + if vce, ok := err.(*VariablesChangedError); ok { + for _, change := range vce.Changes { + delete(rtVariables, change.OldName) + rtVariables[change.NewName] = change.NewValue + } + } else if err != nil { + return err + } + normalizedPath := useVars(rtVariables, rt.Request.Path) + if rt.QueryString != "" { + normalizedPath += "?" + useVars(rtVariables, rt.QueryString) + } + if rt.StepNumber > len(m.Steps) { + return fmt.Errorf("step number %d is out of bounds, are you re-running the same test case?", rt.StepNumber) + } + step := &m.Steps[rt.StepNumber-1] + requestInfo := RequestInfo{ + Version: rt.Request.Version, + Method: rt.Request.Method, + Path: normalizedPath, + Text: useVars(rtVariables, rt.Request.Text), + Responses: []statusText{ + { + Text: useVars(rtVariables, rt.Response.Text), + Status: rt.Response.Status, + ResponseIndex: rt.Response.ResponseIndex, + }, + }, + } + step.AddRequest(&requestInfo, isDiff) + return nil +} + +func (m *MockHTTPData) UpdateVariablesIgnoreChanges(t *testing.T, variables map[string]string) error { + t.Helper() + err := m.UpdateVariables(t, variables) + if _, ok := err.(*VariablesChangedError); ok { + return nil + } + return err +} +func (m *MockHTTPData) UpdateVariables(t *testing.T, variables map[string]string) error { + t.Helper() + var missingValue []string + for name, value := range variables { + if value == "" { + missingValue = append(missingValue, name) + } + } + if len(missingValue) > 0 { + sort.Strings(missingValue) + return fmt.Errorf("missing values for variables: %v", missingValue) + } + changes := []VariableChange{} + for name, value := range variables { + oldValue, exists := m.Variables[name] + if !exists { + t.Logf("Adding variable %s=%s", name, value) + } + if exists && oldValue != value { + change, err := findVariableChange(t, name, m.Variables, oldValue, value) + if err != nil { + return err + } + changes = append(changes, *change) + m.Variables[change.NewName] = change.NewValue + } else { + m.Variables[name] = value + } + } + if len(changes) > 0 { + return &VariablesChangedError{Changes: changes} + } + return nil +} + +func findVariableChange(t *testing.T, name string, vars map[string]string, oldValue, newValue string) (*VariableChange, error) { + t.Helper() + for suffix := 2; suffix < 10; suffix++ { + newName := fmt.Sprintf("%s%d", name, suffix) + oldValue2, exists := vars[newName] + if exists && oldValue2 != newValue { + continue + } + if !exists { + t.Logf("Adding variable %s to %s=%s", name, newName, newValue) + } + return &VariableChange{name, newName, oldValue, newValue}, nil + } + return nil, fmt.Errorf("too many variables with the same name and different values: %s", name) +} + +func useVars(vars map[string]string, text string) string { + for key, value := range vars { + replaceInRegex := regexp.MustCompile(fmt.Sprintf(`\W(%s)\W?`, value)) + text = replaceInRegex.ReplaceAllStringFunc(text, func(old string) string { + lastChar := old[len(old)-1] + if lastChar == value[len(value)-1] { + return fmt.Sprintf("%c{%s}", old[0], key) + } + return fmt.Sprintf("%c{%s}%c", old[0], key, lastChar) + }) + } + return text +} diff --git a/internal/testutil/unit/http_mocker_data_test.go b/internal/testutil/unit/http_mocker_data_test.go new file mode 100644 index 0000000000..d9f521a410 --- /dev/null +++ b/internal/testutil/unit/http_mocker_data_test.go @@ -0,0 +1,91 @@ +package unit_test + +import ( + "strings" + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" +) + +func TestMockHTTPData_UpdateVariables(t *testing.T) { + mockData := unit.NewMockHTTPData(t, 1, []string{""}) + err := mockData.UpdateVariables(t, map[string]string{"groupId": "g1", "clusterName": "c1"}) + require.NoError(t, err) + require.Equal(t, "g1", mockData.Variables["groupId"]) + require.Equal(t, "c1", mockData.Variables["clusterName"]) + err = mockData.UpdateVariables(t, map[string]string{"groupId": "g2", "clusterName": "c2"}) + changeError, ok := err.(*unit.VariablesChangedError) + require.True(t, ok) + require.Len(t, changeError.Changes, 2) + assert.Equal(t, map[string]string{"groupId": "groupId2", "clusterName": "clusterName2"}, changeError.ChangedNamesMap()) + assert.Equal(t, map[string]string{"g1": "g2", "c1": "c2"}, changeError.ChangedValuesMap()) + assert.Equal(t, map[string]string{"clusterName": "c1", "clusterName2": "c2", "groupId": "g1", "groupId2": "g2"}, mockData.Variables) +} + +func TestMockHTTPData_AddRoundtrip(t *testing.T) { + mockData := unit.NewMockHTTPData(t, 1, []string{""}) + rt := &unit.RoundTrip{ + Variables: map[string]string{"groupId": "g1", "clusterName": "c1"}, + StepNumber: 1, + Request: unit.RequestInfo{}, + } + err := mockData.AddRoundtrip(t, rt, false) + require.NoError(t, err) + require.Equal(t, "g1", mockData.Variables["groupId"]) + require.Equal(t, "c1", mockData.Variables["clusterName"]) + rt2 := &unit.RoundTrip{ + Variables: map[string]string{"groupId": "g2", "clusterName": "c2"}, + StepNumber: 1, + Request: unit.RequestInfo{}, + } + err = mockData.AddRoundtrip(t, rt2, false) + require.NoError(t, err) + assert.Equal(t, map[string]string{"clusterName": "c1", "clusterName2": "c2", "groupId": "g1", "groupId2": "g2"}, mockData.Variables) +} + +func TestMockDataExtractVars(t *testing.T) { + config1 := projectAdvClusterExample + config2 := strings.ReplaceAll(config1, "test-acc-tf-c-8022584361920682288", "test-acc-tf-c-8022584361920682289") + mockData := unit.NewMockHTTPData(t, 2, []string{config1, config2}) + expected := map[string]string{ + "clusterName": "test-acc-tf-c-8022584361920682288", + "clusterName2": "test-acc-tf-c-8022584361920682289", + "orgId": "65def6ce0f722a1507105aa5", + "projectName": "test-acc-tf-p-664077766951329406", + } + assert.Equal(t, expected, mockData.Variables) +} + +var expectedDump = `variables: {} +steps: + - diff_requests: [] + request_responses: [] + - config: |2+ + data "mongodbatlas_advanced_cluster" "test" { + project_id = mongodbatlas_advanced_cluster.test.project_id + name = mongodbatlas_advanced_cluster.test.name + use_replication_spec_per_shard = true + } + data "mongodbatlas_advanced_clusters" "test" { + project_id = mongodbatlas_advanced_cluster.test.project_id + use_replication_spec_per_shard = true + } + + diff_requests: [] + request_responses: [] +` + +var tfDsString = "\ndata \"mongodbatlas_advanced_cluster\" \"test\" {\n project_id = mongodbatlas_advanced_cluster.test.project_id\n name = mongodbatlas_advanced_cluster.test.name\n use_replication_spec_per_shard = true\n}\ndata \"mongodbatlas_advanced_clusters\" \"test\" {\n project_id = mongodbatlas_advanced_cluster.test.project_id\n use_replication_spec_per_shard = true\n}\n \n" + +func TestDumpingConfigUsesLiteralStyle(t *testing.T) { + mockData := unit.NewMockHTTPData(t, 2, []string{"", tfDsString}) + initialYaml := strings.Builder{} + e := yaml.NewEncoder(&initialYaml) + e.SetIndent(1) + err := e.Encode(mockData) + require.NoError(t, err) + assert.Equal(t, expectedDump, initialYaml.String()) +} diff --git a/internal/testutil/unit/http_mocker_round_tripper.go b/internal/testutil/unit/http_mocker_round_tripper.go new file mode 100644 index 0000000000..be0d6bfe1c --- /dev/null +++ b/internal/testutil/unit/http_mocker_round_tripper.go @@ -0,0 +1,247 @@ +package unit + +import ( + "fmt" + "net/http" + "net/url" + "os" + "regexp" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/jarcoal/httpmock" + "github.com/sebdah/goldie/v2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" +) + +func NewMockRoundTripper(t *testing.T, config *MockHTTPDataConfig, data *MockHTTPData) (http.RoundTripper, *MockRoundTripper) { + t.Helper() + myTransport := httpmock.NewMockTransport() + var mockTransport http.RoundTripper = myTransport + tracker := newMockRoundTripper(t, data) + if config != nil { + tracker.allowMissingRequests = config.AllowMissingRequests + } + for _, method := range []string{"GET", "POST", "PUT", "DELETE", "PATCH"} { + myTransport.RegisterRegexpResponder(method, regexp.MustCompile(".*"), tracker.receiveRequest(method)) + } + return mockTransport, tracker +} +func ParseTestDataConfigYAML(filePath string) (*MockHTTPData, error) { + data, err := os.ReadFile(filePath) + if err != nil { + return nil, err + } + var testData MockHTTPData + err = yaml.Unmarshal(data, &testData) + if err != nil { + return nil, err + } + return &testData, nil +} + +func newMockRoundTripper(t *testing.T, data *MockHTTPData) *MockRoundTripper { + t.Helper() + return &MockRoundTripper{ + t: t, + g: goldie.New(t, goldie.WithTestNameForDir(true), goldie.WithNameSuffix(".json")), + data: data, + logRequests: os.Getenv("TF_LOG") == "DEBUG", + currentStepIndex: -1, // increased on the start of the test + } +} + +type MockRoundTripper struct { + t *testing.T + g *goldie.Goldie + data *MockHTTPData + + usedResponses map[string]int + foundsDiffs map[int]string + currentStepIndex int + diffResponseIndex int + allowMissingRequests bool + logRequests bool +} + +func (r *MockRoundTripper) IncreaseStepNumberAndInit() { + r.currentStepIndex++ + err := r.initStep() + require.NoError(r.t, err) +} + +func (r *MockRoundTripper) allowReUse(req *RequestInfo) bool { + isGet := req.Method == "GET" + customReReadOk := req.Method == "POST" && strings.HasSuffix(req.Path, ":validate") + return isGet || customReReadOk +} + +func (r *MockRoundTripper) requestFilename(requestID string, index int) string { + return strings.ReplaceAll(fmt.Sprintf("%02d_%02d_%s", r.currentStepIndex+1, index+1, requestID), "/", "_") +} + +func (r *MockRoundTripper) manualFilenameIfExist(requestID string, index int) string { + defaultFilestem := strings.ReplaceAll(fmt.Sprintf("%02d_%02d_%s", r.currentStepIndex+1, index+1, requestID), "/", "_") + manualFilestem := defaultFilestem + "_manual" + if _, err := os.Stat("testdata" + "/" + r.t.Name() + "/" + manualFilestem + ".json"); err == nil { + return manualFilestem + } + return defaultFilestem +} + +func (r *MockRoundTripper) initStep() error { + r.usedResponses = map[string]int{} + r.foundsDiffs = map[int]string{} + step := r.currentStep() + if step == nil { + return nil + } + for index, req := range step.DiffRequests { + err := r.g.Update(r.t, r.requestFilename(req.idShort(), index), []byte(req.Text)) + if err != nil { + return err + } + } + r.nextDiffResponseIndex() + return nil +} + +func (r *MockRoundTripper) nextDiffResponseIndex() { + step := r.currentStep() + if step == nil { + r.t.Fatal("no more steps, in testCase") + } + for index, req := range step.DiffRequests { + if _, ok := r.foundsDiffs[index]; !ok { + r.diffResponseIndex = req.Responses[0].ResponseIndex + return + } + } + // no more diffs in current step, any response index will do, assuming never more than 100k responses + r.diffResponseIndex = 99999 +} + +func (r *MockRoundTripper) currentStep() *stepRequests { + if r.currentStepIndex >= len(r.data.Steps) { + return nil + } + return &r.data.Steps[r.currentStepIndex] +} + +func (r *MockRoundTripper) CheckStepRequests(_ *terraform.State) error { + missingRequests := []string{} + step := r.currentStep() + for _, req := range step.RequestResponses { + missingRequestsCount := len(req.Responses) - r.usedResponses[req.id()] + if missingRequestsCount > 0 { + missingIndexes := []string{} + for i := 0; i < missingRequestsCount; i++ { + missingResponse := (len(req.Responses) - missingRequestsCount) + i + missingIndexes = append(missingIndexes, fmt.Sprintf("%d", req.Responses[missingResponse].ResponseIndex)) + } + missingIndexesStr := strings.Join(missingIndexes, ", ") + missingRequests = append(missingRequests, fmt.Sprintf("missing %d requests of %s (%s)", missingRequestsCount, req.idShort(), missingIndexesStr)) + } + } + if r.allowMissingRequests { + if len(missingRequests) > 0 { + r.t.Logf("missing requests:\n%s", strings.Join(missingRequests, "\n")) + } + } else { + assert.Empty(r.t, missingRequests) + } + missingDiffs := []string{} + for i, req := range step.DiffRequests { + if _, ok := r.foundsDiffs[i]; !ok { + missingDiffs = append(missingDiffs, fmt.Sprintf("missing diff request %s", req.idShort())) + } + } + assert.Empty(r.t, missingDiffs) + for index, payload := range r.foundsDiffs { + diff := step.DiffRequests[index] + filename := r.manualFilenameIfExist(diff.idShort(), index) + r.t.Logf("checking diff %s", filename) + payloadWithVars := useVars(r.data.Variables, payload) + r.g.Assert(r.t, filename, []byte(payloadWithVars)) + } + return nil +} + +func (r *MockRoundTripper) receiveRequest(method string) func(req *http.Request) (*http.Response, error) { + return func(req *http.Request) (*http.Response, error) { + acceptHeader := req.Header.Get("Accept") + version, err := ExtractVersion(acceptHeader) + if err != nil { + return nil, err + } + _, payload, err := extractAndNormalizePayload(req.Body) + if r.logRequests { + r.t.Logf("received request\n %s %s %s\n%s\n", method, req.URL.Path, version, payload) + } + if err != nil { + return nil, err + } + text, status, err := r.matchRequest(method, version, payload, req.URL) + if err != nil { + return nil, err + } + if r.logRequests { + r.t.Logf("responding with\n%d\n%s\n", status, text) + } + response := httpmock.NewStringResponse(status, text) + response.Header.Set("Content-Type", fmt.Sprintf("application/vnd.atlas.%s+json;charset=utf-8", version)) + return response, nil + } +} +func (r *MockRoundTripper) matchRequest(method, version, payload string, reqURL *url.URL) (response string, statusCode int, err error) { + step := r.currentStep() + if step == nil { + return "", 0, fmt.Errorf("no more steps in mock data") + } + isDiff := false + for index, request := range step.DiffRequests { + if !request.Match(r.t, method, version, reqURL, r.data) { + continue + } + if _, ok := r.foundsDiffs[index]; ok { + continue + } + r.foundsDiffs[index] = payload + r.nextDiffResponseIndex() + isDiff = true + break + } + nextDiffResponse := r.diffResponseIndex + + for _, request := range step.RequestResponses { + if !request.Match(r.t, method, version, reqURL, r.data) { + continue + } + requestID := request.id() + nextIndex := r.usedResponses[requestID] + if nextIndex >= len(request.Responses) { + if r.allowReUse(&request) { + nextIndex = len(request.Responses) - 1 + } else { + continue + } + } + response := request.Responses[nextIndex] + // cannot return a response that is sent after a diff response, unless it is a diff + if response.ResponseIndex > nextDiffResponse && !isDiff { + prevIndex := nextIndex - 1 + if prevIndex >= 0 && r.allowReUse(&request) { + response = request.Responses[prevIndex] + r.t.Logf("re-reading %s request with response_index=%d as diff hasn't been returned yet (%d)", request.Method, response.ResponseIndex, nextDiffResponse) + return replaceVars(response.Text, r.data.Variables), response.Status, nil + } + continue + } + r.usedResponses[requestID]++ + return replaceVars(response.Text, r.data.Variables), response.Status, nil + } + return "", 0, fmt.Errorf("no matching request found %s %s\n%s\nnextDiffResponse=%d", method, version, reqURL.Path, nextDiffResponse) +} diff --git a/internal/testutil/unit/http_mocker_round_tripper_test.go b/internal/testutil/unit/http_mocker_round_tripper_test.go new file mode 100644 index 0000000000..cf2aae8b3c --- /dev/null +++ b/internal/testutil/unit/http_mocker_round_tripper_test.go @@ -0,0 +1,128 @@ +package unit_test + +import ( + "encoding/json" + "fmt" + "net/http" + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "go.mongodb.org/atlas-sdk/v20241113003/admin" +) + +const reqPoliciesCreateBody = `{ + "name": "test-policy", + "policies": [ + { + "body": "\t\t\t\n\tforbid (\n\tprincipal,\n\taction == cloud::Action::\"cluster.createEdit\",\n\tresource\n\t) when {\n\tcontext.cluster.cloudProviders.containsAny([cloud::cloudProvider::\"aws\"])\n\t};\n" + } + ] +}` +const reqPoliciesUpdateBody = `{ + "name": "updated-policy", + "policies": [ + { + "body": "\t\t\t\n\tforbid (\n\tprincipal,\n\taction == cloud::Action::\"cluster.createEdit\",\n\tresource\n\t) when {\n\tcontext.cluster.cloudProviders.containsAny([cloud::cloudProvider::\"aws\"])\n\t};\n" + } + ] +}` + +const reqPoliciesManualValidateDelete = `{}` + +func TestMockRoundTripper(t *testing.T) { + orgID := "123" + resourcePolicyID := "456" + data := unit.ReadMockData(t, []string{"", "", ""}) + mockTransport, tracker := unit.NewMockRoundTripper(t, &unit.MockHTTPDataConfig{AllowMissingRequests: true}, data) + client := &http.Client{ + Transport: mockTransport, + } + // Error check + tracker.IncreaseStepNumberAndInit() + unknownRequest := request("GET", "/v1/cluster/123", "") + resp, err := client.Do(unknownRequest) + require.ErrorContains(t, err, "no matching request found") + assert.Nil(t, resp) + + // Step 1 + createRequest := request("POST", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID), reqPoliciesCreateBody) + resp, err = client.Do(createRequest) + + require.NoError(t, err) + require.Equal(t, 201, resp.StatusCode) + err = tracker.CheckStepRequests(nil) + require.NoError(t, err) + // Step 2 + tracker.IncreaseStepNumberAndInit() + patchRequest := request("PATCH", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID), reqPoliciesUpdateBody) + resp, err = client.Do(patchRequest) + require.NoError(t, err) + err = tracker.CheckStepRequests(nil) + require.NoError(t, err) + var policyResp admin.ApiAtlasResourcePolicy + err = json.NewDecoder(resp.Body).Decode(&policyResp) + require.NoError(t, err) + assert.Equal(t, resourcePolicyID, policyResp.GetId()) + + // Step 3 + tracker.IncreaseStepNumberAndInit() + // First GET request OK + // Second GET request OK + getRequest := request("GET", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID), "") + _, err = client.Do(getRequest) + require.NoError(t, err) + _, err = client.Do(getRequest) + require.NoError(t, err) + // Third GET request is re-read, since we have not gotten the diff + require.NoError(t, err) + okResp, err := client.Do(getRequest) + require.NoError(t, err) + require.Equal(t, 200, okResp.StatusCode) + + // Test _manual diff file (set to {} instead of '') + validateRequest := request("DELETE", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID), reqPoliciesManualValidateDelete) + _, err = client.Do(validateRequest) + require.NoError(t, err) + // Fourth GET request OK, since we have gotten the diff + notFoundResp, err := client.Do(getRequest) + require.NoError(t, err) + notFoundMap := parseMapStringAny(t, notFoundResp) + assert.Equal(t, "RESOURCE_POLICY_NOT_FOUND", notFoundMap["errorCode"]) + + err = tracker.CheckStepRequests(nil) + require.NoError(t, err) +} + +func parseMapStringAny(t *testing.T, resp *http.Response) map[string]any { + t.Helper() + stringMap := map[string]any{} + err := json.NewDecoder(resp.Body).Decode(&stringMap) + require.NoError(t, err) + return stringMap +} + +func TestMockRoundTripperAllowReRead(t *testing.T) { + orgID := "123" + data := unit.ReadMockData(t, []string{""}) + mockTransport, tracker := unit.NewMockRoundTripper(t, &unit.MockHTTPDataConfig{AllowMissingRequests: true}, data) + client := &http.Client{ + Transport: mockTransport, + } + tracker.IncreaseStepNumberAndInit() + for range []int{0, 1, 2} { + getRequest := request("GET", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID), "") + resp, err := client.Do(getRequest) + require.NoError(t, err) + assert.Equal(t, "returned again", parseMapStringAny(t, resp)["expect"]) + } + createRequest := request("POST", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID), reqPoliciesCreateBody) + resp, err := client.Do(createRequest) + + require.NoError(t, err) + require.Equal(t, 201, resp.StatusCode) + err = tracker.CheckStepRequests(nil) + require.NoError(t, err) +} diff --git a/internal/testutil/unit/http_mocker_test.go b/internal/testutil/unit/http_mocker_test.go index 03f8fe7079..6a274863c9 100644 --- a/internal/testutil/unit/http_mocker_test.go +++ b/internal/testutil/unit/http_mocker_test.go @@ -1,8 +1,6 @@ package unit_test import ( - "encoding/json" - "fmt" "io" "net/http" "net/url" @@ -12,8 +10,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "go.mongodb.org/atlas-sdk/v20241113003/admin" ) func TestExtractVersion(t *testing.T) { @@ -21,141 +17,83 @@ func TestExtractVersion(t *testing.T) { require.NoError(t, err) require.Equal(t, "2022-06-01", version) } + +func TestExtractVersionRequestResponse(t *testing.T) { + version := unit.ExtractVersionRequestResponse("application/json;", "application/vnd.atlas.2023-01-01+json;charset=utf-8") + require.Equal(t, "2023-01-01", version) +} + +func TestExtractVersionRequestResponseNotFound(t *testing.T) { + version := unit.ExtractVersionRequestResponse("application/json;", "application/vnd.atlas.2023-01+json;charset=utf-8") + require.Equal(t, "", version) +} + +func asURL(t *testing.T, reqPath string) *url.URL { + t.Helper() + u, err := url.Parse("http://localhost" + reqPath) + require.NoError(t, err) + return u +} + func TestRequestInfo_Match(t *testing.T) { req := unit.RequestInfo{ Version: "2022-06-01", Method: "GET", Path: "/v1/cluster/{cluster_id}", } - assert.True(t, req.Match("GET", "/v1/cluster/123", "2022-06-01", map[string]string{"cluster_id": "123"})) - assert.False(t, req.Match("GET", "/v1/cluster/123", "2022-06-01", map[string]string{"cluster_id": "456"})) -} - -func request(method, path string) *http.Request { - return &http.Request{ - Method: method, - URL: &url.URL{Path: path}, - Header: http.Header{ - "Accept": []string{"application/json; version=2024-08-05"}, - }, + mockData := unit.MockHTTPData{ + Variables: map[string]string{"cluster_id": "123"}, } + assert.True(t, req.Match(t, "GET", "2022-06-01", asURL(t, "/v1/cluster/123"), &mockData)) // Exact match + mockData2 := unit.MockHTTPData{ + Variables: map[string]string{"cluster_id": "456"}, + } + // Doesn't match the current request, but adds the new variable mapping cluster_id2=123 + assert.False(t, req.Match(t, "GET", "2022-06-01", asURL(t, "/v1/cluster/123"), &mockData2)) // API Spec match + assert.Equal(t, map[string]string{"cluster_id": "456", "cluster_id2": "123"}, mockData2.Variables) } - -const reqPoliciesCreateBody = `{ - "name": "test-policy", - "policies": [ - { - "body": "\t\t\t\n\tforbid (\n\tprincipal,\n\taction == cloud::Action::\"cluster.createEdit\",\n\tresource\n\t) when {\n\tcontext.cluster.cloudProviders.containsAny([cloud::cloudProvider::\"aws\"])\n\t};\n" - } - ] -}` -const reqPoliciesUpdateBody = `{ - "name": "updated-policy", - "policies": [ - { - "body": "\t\t\t\n\tforbid (\n\tprincipal,\n\taction == cloud::Action::\"cluster.createEdit\",\n\tresource\n\t) when {\n\tcontext.cluster.cloudProviders.containsAny([cloud::cloudProvider::\"aws\"])\n\t};\n" - } - ] -}` - -const reqPoliciesManualValidateDelete = `{}` - -func TestMockRoundTripper(t *testing.T) { - orgID := "123" - resourcePolicyID := "456" - vars := map[string]string{ - "orgId": orgID, - "resourcePolicyId": resourcePolicyID, +func TestRequestInfo_MatchQuery(t *testing.T) { + reqAzure := unit.RequestInfo{ + Version: "2022-06-01", + Method: "GET", + Path: "/api/atlas/v2/groups/{groupId3}/containers?providerName=AZURE", } - mockTransport, checkFunc := unit.MockRoundTripper(t, vars, &unit.MockHTTPDataConfig{AllowMissingRequests: true}) - client := &http.Client{ - Transport: mockTransport, + assert.Equal(t, []string{"providerName"}, reqAzure.QueryVars()) + expectedNormalized := "/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?providerName=AZURE" + reqURLAzure := asURL(t, "/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?includeCount=true&itemsPerPage=100&pageNum=1&providerName=AZURE") + assert.Equal(t, expectedNormalized, reqAzure.NormalizePath(reqURLAzure)) + mockData := unit.MockHTTPData{ + Variables: map[string]string{"groupId3": "6746cee66f62fc3c122a3b82"}, } - // Error check - unknownRequest := request("GET", "/v1/cluster/123") - resp, err := client.Do(unknownRequest) - require.ErrorContains(t, err, "no matching request found") - assert.Nil(t, resp) + assert.True(t, reqAzure.Match(t, "GET", "2022-06-01", reqURLAzure, &mockData)) - // Step 1 - createRequest := request("POST", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID)) - createRequest.Body = io.NopCloser(strings.NewReader(reqPoliciesCreateBody)) - resp, err = client.Do(createRequest) + assert.Equal(t, map[string]string{"groupId3": "6746cee66f62fc3c122a3b82"}, mockData.Variables) + reqURLAws := asURL(t, "/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?includeCount=true&itemsPerPage=100&pageNum=1&providerName=AWS") + assert.False(t, reqAzure.Match(t, "GET", "2022-06-01", reqURLAws, &mockData)) + assert.Equal(t, map[string]string{"groupId3": "6746cee66f62fc3c122a3b82"}, mockData.Variables) - require.NoError(t, err) - require.Equal(t, 201, resp.StatusCode) - err = checkFunc(nil) - require.NoError(t, err) - // Step 2 - patchRequest := request("PATCH", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID)) - patchRequest.Body = io.NopCloser(strings.NewReader(reqPoliciesUpdateBody)) - resp, err = client.Do(patchRequest) - require.NoError(t, err) - err = checkFunc(nil) - require.NoError(t, err) - var policyResp admin.ApiAtlasResourcePolicy - err = json.NewDecoder(resp.Body).Decode(&policyResp) - require.NoError(t, err) - assert.Equal(t, resourcePolicyID, policyResp.GetId()) - - // Step 3 - // First GET request OK - // Second GET request OK - getRequest := request("GET", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID)) - _, err = client.Do(getRequest) - require.NoError(t, err) - _, err = client.Do(getRequest) - require.NoError(t, err) - // Third GET request FAIL with no match as there are no more responses until after DELETE - _, err = client.Do(getRequest) - require.ErrorContains(t, err, "no matching request found") - - // Test _manual diff file (set to {} instead of '') - validateRequest := request("DELETE", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies/%s", orgID, resourcePolicyID)) - validateRequest.Body = io.NopCloser(strings.NewReader(reqPoliciesManualValidateDelete)) - _, err = client.Do(validateRequest) - require.NoError(t, err) - // Fourth GET request OK, since we have gotten the diff - notFoundResp, err := client.Do(getRequest) - require.NoError(t, err) - notFoundMap := parseMapStringAny(t, notFoundResp) - assert.Equal(t, "RESOURCE_POLICY_NOT_FOUND", notFoundMap["errorCode"]) - - err = checkFunc(nil) - require.NoError(t, err) -} - -func parseMapStringAny(t *testing.T, resp *http.Response) map[string]any { - t.Helper() - stringMap := map[string]any{} - err := json.NewDecoder(resp.Body).Decode(&stringMap) - require.NoError(t, err) - return stringMap + reqAws := unit.RequestInfo{ + Version: "2022-06-01", + Method: "GET", + Path: "/api/atlas/v2/groups/{groupId3}/containers?providerName=AWS", + } + assert.True(t, reqAws.Match(t, "GET", "2022-06-01", reqURLAws, &mockData)) } -func TestMockRoundTripperAllowReRead(t *testing.T) { - orgID := "123" - resourcePolicyID := "456" - vars := map[string]string{ - "orgId": orgID, - "resourcePolicyId": resourcePolicyID, +func request(method, path, body string) *http.Request { + reqURL, err := url.Parse("http://localhost" + path) + if err != nil { + panic(err) } - mockTransport, checkFunc := unit.MockRoundTripper(t, vars, &unit.MockHTTPDataConfig{AllowReReadGet: true, AllowMissingRequests: true}) - client := &http.Client{ - Transport: mockTransport, + req := http.Request{ + Method: method, + URL: reqURL, + Header: http.Header{ + "Accept": []string{"application/json; version=2024-08-05"}, + }, } - for range []int{0, 1, 2} { - getRequest := request("GET", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID)) - resp, err := client.Do(getRequest) - require.NoError(t, err) - assert.Equal(t, "returned again", parseMapStringAny(t, resp)["expect"]) + if body != "" { + req.Body = io.NopCloser(strings.NewReader(body)) } - createRequest := request("POST", fmt.Sprintf("/api/atlas/v2/orgs/%s/resourcePolicies", orgID)) - createRequest.Body = io.NopCloser(strings.NewReader(reqPoliciesCreateBody)) - resp, err := client.Do(createRequest) - - require.NoError(t, err) - require.Equal(t, 201, resp.StatusCode) - err = checkFunc(nil) - require.NoError(t, err) + return &req } diff --git a/internal/testutil/unit/http_path_normalizing.go b/internal/testutil/unit/http_path_normalizing.go new file mode 100644 index 0000000000..650532f7eb --- /dev/null +++ b/internal/testutil/unit/http_path_normalizing.go @@ -0,0 +1,132 @@ +package unit + +import ( + "encoding/json" + "fmt" + "io" + "net/url" + "regexp" + "strings" +) + +type APISpecPath struct { + Path string +} + +func (a *APISpecPath) Variables(path string) map[string]string { + variables := make(map[string]string) + expectedParts := strings.Split(a.Path, "/") + actualParts := strings.Split(path, "/") + for i, part := range expectedParts { + if strings.HasPrefix(part, "{") && strings.HasSuffix(part, "}") { + variables[part[1:len(part)-1]] = actualParts[i] + } + } + return variables +} + +func (a *APISpecPath) Match(path string) bool { + expectedParts := strings.Split(a.Path, "/") + actualParts := strings.Split(path, "/") + if len(expectedParts) != len(actualParts) { + return false + } + for i, expected := range expectedParts { + actual := actualParts[i] + if expected == actual { + continue + } + if strings.HasPrefix(expected, "{") && strings.HasSuffix(expected, "}") { + continue + } + return false + } + return true +} + +func removeQueryParamsAndTrim(path string) string { + if strings.Contains(path, "?") { + path = strings.Split(path, "?")[0] + } + return strings.TrimRight(path, "/") +} + +func FindNormalizedPath(path string, apiSpecPaths *[]APISpecPath) (APISpecPath, error) { + path = removeQueryParamsAndTrim(path) + for _, apiSpecPath := range *apiSpecPaths { + if apiSpecPath.Match(path) { + return apiSpecPath, nil + } + } + return APISpecPath{}, fmt.Errorf("could not find path: %s", path) +} + +func replaceVars(text string, vars map[string]string) string { + for key, value := range vars { + text = strings.ReplaceAll(text, fmt.Sprintf("{%s}", key), value) + } + return text +} + +var versionDatePattern = regexp.MustCompile(`(\d{4}-\d{2}-\d{2})`) + +func ExtractVersion(contentType string) (string, error) { + match := versionDatePattern.FindStringSubmatch(contentType) + if len(match) > 1 { + return match[1], nil + } + return "", fmt.Errorf("could not extract version from %s header", contentType) +} + +func ExtractVersionRequestResponse(headerValueRequest, headerValueResponse string) string { + found := versionDatePattern.FindString(headerValueRequest) + if found != "" { + return found + } + return versionDatePattern.FindString(headerValueResponse) +} + +func extractAndNormalizePayload(body io.Reader) (originalPayload, normalizedPayload string, err error) { + if body != nil { + payloadBytes, err := io.ReadAll(body) + if err != nil { + return "", "", err + } + originalPayload = string(payloadBytes) + } + normalizedPayload, err = normalizePayload(originalPayload) + if err != nil { + return "", "", err + } + return originalPayload, normalizedPayload, nil +} + +func normalizePayload(payload string) (string, error) { + if payload == "" { + return "", nil + } + var tempHolder any + err := json.Unmarshal([]byte(payload), &tempHolder) + if err != nil { + return "", err + } + sb := strings.Builder{} + encoder := json.NewEncoder(&sb) + encoder.SetIndent("", " ") + err = encoder.Encode(tempHolder) + if err != nil { + return "", err + } + return strings.TrimSuffix(sb.String(), "\n"), nil +} + +func relevantQuery(queryVars []string, queryValues url.Values) string { + queryStrings := []string{} + for _, queryVar := range queryVars { + foundValue := queryValues.Get(queryVar) + if foundValue != "" { + queryStrings = append(queryStrings, fmt.Sprintf("%s=%s", queryVar, foundValue)) + } + } + return strings.Join(queryStrings, "&") +} diff --git a/internal/testutil/unit/main_test.go b/internal/testutil/unit/main_test.go new file mode 100644 index 0000000000..670797ecdb --- /dev/null +++ b/internal/testutil/unit/main_test.go @@ -0,0 +1,14 @@ +package unit_test + +import ( + "os" + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" +) + +func TestMain(m *testing.M) { + unit.InitializeAPISpecPaths() + exitCode := m.Run() + os.Exit(exitCode) +} diff --git a/internal/testutil/unit/provider_mock.go b/internal/testutil/unit/provider_mock.go index 7afadd8640..18ec2fd897 100644 --- a/internal/testutil/unit/provider_mock.go +++ b/internal/testutil/unit/provider_mock.go @@ -16,12 +16,20 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/provider" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + fwProvider "github.com/hashicorp/terraform-plugin-framework/provider" ) +type HTTPClientModifier interface { + ModifyHTTPClient(*http.Client) error + ResetHTTPClient(*http.Client) +} + type ProviderMocked struct { OriginalProvider *provider.MongodbtlasProvider - MockRoundTripper http.RoundTripper + ClientModifier HTTPClientModifier t *testing.T } @@ -42,7 +50,12 @@ func (p *ProviderMocked) Configure(ctx context.Context, req fwProvider.Configure if httpClient == nil { p.t.Fatal("HTTPClient is nil, mocking will fail") } - httpClient.Transport = p.MockRoundTripper + if p.ClientModifier != nil { + err := p.ClientModifier.ModifyHTTPClient(httpClient) + if err != nil { + p.t.Fatal(err) + } + } } func (p *ProviderMocked) DataSources(ctx context.Context) []func() datasource.DataSource { @@ -53,9 +66,23 @@ func (p *ProviderMocked) Resources(ctx context.Context) []func() resource.Resour } // Similar to provider.go#muxProviderFactory -func muxProviderFactory(t *testing.T, mockRoundTripper http.RoundTripper) func() tfprotov6.ProviderServer { +func muxProviderFactory(t *testing.T, clientModifier HTTPClientModifier) func() tfprotov6.ProviderServer { t.Helper() v2Provider := provider.NewSdkV2Provider(nil) + v2ProviderConfigureContextFunc := v2Provider.ConfigureContextFunc + v2Provider.ConfigureContextFunc = func(ctx context.Context, d *schema.ResourceData) (any, diag.Diagnostics) { + resp, diags := v2ProviderConfigureContextFunc(ctx, d) + client, ok := resp.(*config.MongoDBClient) + if !ok { + t.Fatalf("Failed to cast response to MongoDBClient, Got type %T", resp) + } + httpClient := client.AtlasV2.GetConfig().HTTPClient + err := clientModifier.ModifyHTTPClient(httpClient) + if err != nil { + t.Fatalf("Failed to modify HTTPClient: %s", err) + } + return resp, diags + } fwProviderInstance := provider.NewFrameworkProvider(nil) fwProviderInstanceTyped, ok := fwProviderInstance.(*provider.MongodbtlasProvider) if !ok { @@ -63,7 +90,7 @@ func muxProviderFactory(t *testing.T, mockRoundTripper http.RoundTripper) func() } mockedProvider := &ProviderMocked{ OriginalProvider: fwProviderInstanceTyped, - MockRoundTripper: mockRoundTripper, + ClientModifier: clientModifier, t: t, } ctx := context.Background() @@ -81,11 +108,11 @@ func muxProviderFactory(t *testing.T, mockRoundTripper http.RoundTripper) func() return muxServer.ProviderServer } -func TestAccProviderV6FactoriesWithMock(t *testing.T, mockRoundTripper http.RoundTripper) map[string]func() (tfprotov6.ProviderServer, error) { +func TestAccProviderV6FactoriesWithMock(t *testing.T, clientModifier HTTPClientModifier) map[string]func() (tfprotov6.ProviderServer, error) { t.Helper() return map[string]func() (tfprotov6.ProviderServer, error){ acc.ProviderNameMongoDBAtlas: func() (tfprotov6.ProviderServer, error) { - return muxProviderFactory(t, mockRoundTripper)(), nil + return muxProviderFactory(t, clientModifier)(), nil }, } } diff --git a/internal/testutil/unit/testdata/CaptureTest/createCluster.json b/internal/testutil/unit/testdata/CaptureTest/createCluster.json new file mode 100644 index 0000000000..778003df1c --- /dev/null +++ b/internal/testutil/unit/testdata/CaptureTest/createCluster.json @@ -0,0 +1,21 @@ +{ + "clusterType": "REPLICASET", + "name": "test-acc-tf-c-7871793563057636102", + "replicationSpecs": [ + { + "regionConfigs": [ + { + "electableSpecs": { + "instanceSize": "M5", + "nodeCount": 0 + }, + "priority": 7, + "providerName": "TENANT", + "regionName": "US_EAST_1", + "backingProviderName": "AWS" + } + ], + "zoneName": "ZoneName managed by Terraform" + } + ] +} \ No newline at end of file diff --git a/internal/testutil/unit/testdata/CaptureTest/createClusterResponse.json b/internal/testutil/unit/testdata/CaptureTest/createClusterResponse.json new file mode 100644 index 0000000000..0ee52a72d7 --- /dev/null +++ b/internal/testutil/unit/testdata/CaptureTest/createClusterResponse.json @@ -0,0 +1,61 @@ +{ + "backupEnabled": true, + "biConnector": { + "enabled": false, + "readPreference": "secondary" + }, + "clusterType": "REPLICASET", + "connectionStrings": {}, + "createDate": "2024-11-27T07:49:10Z", + "diskWarmingMode": "FULLY_WARMED", + "encryptionAtRestProvider": "NONE", + "featureCompatibilityVersion": "8.0", + "globalClusterSelfManagedSharding": false, + "groupId": "6746ceed6f62fc3c122a3e0e", + "id": "6746cef66f62fc3c122a3fe9", + "labels": [], + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102", + "rel": "self" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/restoreJobs", + "rel": "https://cloud.mongodb.com/restoreJobs" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/snapshots", + "rel": "https://cloud.mongodb.com/snapshots" + } + ], + "mongoDBMajorVersion": "8.0", + "mongoDBVersion": "8.0.3", + "name": "test-acc-tf-c-7871793563057636102", + "paused": false, + "pitEnabled": false, + "redactClientLogData": false, + "replicationSpecs": [ + { + "id": "6746cef66f62fc3c122a3fcb", + "regionConfigs": [ + { + "electableSpecs": { + "effectiveInstanceSize": "M5", + "instanceSize": "M5", + "diskSizeGB": 5.0 + }, + "backingProviderName": "AWS", + "priority": 7, + "providerName": "TENANT", + "regionName": "US_EAST_1" + } + ], + "zoneId": "6746cef66f62fc3c122a3fc9", + "zoneName": "ZoneName managed by Terraform" + } + ], + "rootCertType": "ISRGROOTX1", + "stateName": "CREATING", + "terminationProtectionEnabled": false, + "versionReleaseSystem": "LTS" +} \ No newline at end of file diff --git a/internal/testutil/unit/testdata/CaptureTest/getClusterIdle.json b/internal/testutil/unit/testdata/CaptureTest/getClusterIdle.json new file mode 100644 index 0000000000..49eab3acac --- /dev/null +++ b/internal/testutil/unit/testdata/CaptureTest/getClusterIdle.json @@ -0,0 +1,65 @@ +{ + "backupEnabled": true, + "biConnector": { + "enabled": false, + "readPreference": "secondary" + }, + "clusterType": "REPLICASET", + "connectionStrings": { + "standard": "mongodb://ac-a43sbzi-shard-00-00.efwnixe.mongodb-dev.net:27017,ac-a43sbzi-shard-00-01.efwnixe.mongodb-dev.net:27017,ac-a43sbzi-shard-00-02.efwnixe.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-13c9xc-shard-0", + "standardSrv": "mongodb+srv://test-acc-tf-c-787179356.efwnixe.mongodb-dev.net" + }, + "createDate": "2024-11-27T07:49:10Z", + "diskWarmingMode": "FULLY_WARMED", + "encryptionAtRestProvider": "NONE", + "featureCompatibilityVersion": "8.0", + "globalClusterSelfManagedSharding": false, + "groupId": "6746ceed6f62fc3c122a3e0e", + "id": "6746cef66f62fc3c122a3fe9", + "labels": [], + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102", + "rel": "self" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/restoreJobs", + "rel": "https://cloud.mongodb.com/restoreJobs" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/snapshots", + "rel": "https://cloud.mongodb.com/snapshots" + } + ], + "mongoDBMajorVersion": "8.0", + "mongoDBVersion": "8.0.3", + "name": "test-acc-tf-c-7871793563057636102", + "paused": false, + "pitEnabled": false, + "redactClientLogData": false, + "replicationSpecs": [ + { + "id": "6746cef66f62fc3c122a3fcb", + "regionConfigs": [ + { + "electableSpecs": { + "effectiveInstanceSize": "M5", + "instanceSize": "M5", + "diskSizeGB": 5.0 + }, + "backingProviderName": "AWS", + "priority": 7, + "providerName": "TENANT", + "regionName": "US_EAST_1" + } + ], + "zoneId": "6746cef66f62fc3c122a3fc9", + "zoneName": "ZoneName managed by Terraform" + } + ], + "rootCertType": "ISRGROOTX1", + "stateName": "IDLE", + "tags": [], + "terminationProtectionEnabled": false, + "versionReleaseSystem": "LTS" +} \ No newline at end of file diff --git a/internal/testutil/unit/testdata/CaptureTest/getContainersAws.json b/internal/testutil/unit/testdata/CaptureTest/getContainersAws.json new file mode 100644 index 0000000000..203af21a8f --- /dev/null +++ b/internal/testutil/unit/testdata/CaptureTest/getContainersAws.json @@ -0,0 +1,19 @@ +{ + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746cee66f62fc3c122a3b82/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100", + "rel": "self" + } + ], + "results": [ + { + "atlasCidrBlock": "192.168.248.0/21", + "id": "6746ceedaef48d1cb265896b", + "providerName": "AWS", + "provisioned": true, + "regionName": "EU_WEST_1", + "vpcId": "vpc-00b20ecca20a410e2" + } + ], + "totalCount": 1 +} \ No newline at end of file diff --git a/internal/testutil/unit/testdata/CaptureTest/getContainersAzure.json b/internal/testutil/unit/testdata/CaptureTest/getContainersAzure.json new file mode 100644 index 0000000000..c5837403b2 --- /dev/null +++ b/internal/testutil/unit/testdata/CaptureTest/getContainersAzure.json @@ -0,0 +1,20 @@ +{ + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746cef5aef48d1cb2658a7f/containers?includeCount=true&providerName=AZURE&pageNum=1&itemsPerPage=100", + "rel": "self" + } + ], + "results": [ + { + "atlasCidrBlock": "192.168.248.0/21", + "azureSubscriptionId": "591236d43d098d433845860f", + "id": "6746cefbaef48d1cb2658bbb", + "providerName": "AZURE", + "provisioned": true, + "region": "US_EAST_2", + "vnetName": "vnet_6746cefbaef48d1cb2658bbb_ykngkrlx" + } + ], + "totalCount": 1 +} \ No newline at end of file diff --git a/internal/testutil/unit/testdata/TestCaptureMockConfigClientModifier_clusterExample/TestCaptureMockConfigClientModifier_clusterExample.yaml b/internal/testutil/unit/testdata/TestCaptureMockConfigClientModifier_clusterExample/TestCaptureMockConfigClientModifier_clusterExample.yaml new file mode 100644 index 0000000000..562b09f8d5 --- /dev/null +++ b/internal/testutil/unit/testdata/TestCaptureMockConfigClientModifier_clusterExample/TestCaptureMockConfigClientModifier_clusterExample.yaml @@ -0,0 +1,65 @@ +variables: + clusterName: test-acc-tf-c-7871793563057636102 + groupId: g1 + groupId2: 6746ceed6f62fc3c122a3e0e + groupId3: 6746cee66f62fc3c122a3b82 +steps: + - config: |- + resource "dummy" "test"{ + step = 1 + someString = "my-string" + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-08-05' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"name\": \"test-acc-tf-c-7871793563057636102\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-27T07:49:10Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"6746ceed6f62fc3c122a3e0e\",\n \"id\": \"6746cef66f62fc3c122a3fe9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"test-acc-tf-c-7871793563057636102\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cef66f62fc3c122a3fcb\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746cef66f62fc3c122a3fc9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-08-05' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"name\": \"test-acc-tf-c-7871793563057636102\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-27T07:49:10Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"6746ceed6f62fc3c122a3e0e\",\n \"id\": \"6746cef66f62fc3c122a3fe9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746ceed6f62fc3c122a3e0e/clusters/test-acc-tf-c-7871793563057636102/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"test-acc-tf-c-7871793563057636102\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cef66f62fc3c122a3fcb\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746cef66f62fc3c122a3fc9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - diff_requests: [] + request_responses: + - path: /api/atlas/v2/groups/{groupId2}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 2 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-27T07:49:10Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId2}\",\n \"id\": \"6746cef66f62fc3c122a3fe9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cef66f62fc3c122a3fcb\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746cef66f62fc3c122a3fc9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 3 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-a43sbzi-shard-00-00.efwnixe.mongodb-dev.net:27017,ac-a43sbzi-shard-00-01.efwnixe.mongodb-dev.net:27017,ac-a43sbzi-shard-00-02.efwnixe.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-13c9xc-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-787179356.efwnixe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:10Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId2}\",\n \"id\": \"6746cef66f62fc3c122a3fe9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId2}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cef66f62fc3c122a3fcb\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746cef66f62fc3c122a3fc9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - config: |- + resource "dummy" "test"{ + step = 3 + } + diff_requests: [] + request_responses: + - path: /api/atlas/v2/groups/{groupId3}/containers?providerName=AWS + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 5 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId3}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746ceedaef48d1cb265896b\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-00b20ecca20a410e2\"\n }\n ],\n \"totalCount\": 1\n}" + - path: /api/atlas/v2/groups/{groupId3}/containers?providerName=AZURE + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 6 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/6746cef5aef48d1cb2658a7f/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"6746cefbaef48d1cb2658bbb\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_6746cefbaef48d1cb2658bbb_ykngkrlx\"\n }\n ],\n \"totalCount\": 1\n}" diff --git a/internal/testutil/unit/testdata/TestMockRoundTripperAllowReRead.yaml b/internal/testutil/unit/testdata/TestMockRoundTripperAllowReRead.yaml index a24f4b8c3a..7f5c4c6fdd 100644 --- a/internal/testutil/unit/testdata/TestMockRoundTripperAllowReRead.yaml +++ b/internal/testutil/unit/testdata/TestMockRoundTripperAllowReRead.yaml @@ -1,4 +1,3 @@ -step_count: 1 steps: - diff_requests: - version: '2024-08-05' diff --git a/internal/testutil/unit/tf_config_modifier.go b/internal/testutil/unit/tf_config_modifier.go new file mode 100644 index 0000000000..1213e8319b --- /dev/null +++ b/internal/testutil/unit/tf_config_modifier.go @@ -0,0 +1,71 @@ +package unit + +import ( + "strings" + "testing" + + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/hashicorp/hcl/v2/hclwrite" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/hcl" +) + +type TFConfigReplacementType int + +const ( + TFConfigReplacementString TFConfigReplacementType = iota +) + +// Current assumption, variable name must match API Spec Path Param name +var variableAttributes = map[string]func(string, string) string{ + "name": func(resourceName string, attrName string) string { + return shortName(resourceName) + "Name" + }, + "org_id": func(resourceName string, attrName string) string { + return "orgId" + }, + "project_id": func(resourceName string, attrName string) string { + return "groupId" + }, +} + +func ExtractConfigVariables(t *testing.T, config string) map[string]string { + t.Helper() + if config == "" { + return nil + } + vars := map[string]string{} + parse := hcl.GetDefParser(t, config) + for _, resource := range parse.Body().Blocks() { + if resource.Type() != "resource" { + continue + } + for name, attr := range resource.Body().Attributes() { + varNameFunc, ok := variableAttributes[name] + if !ok { + continue + } + varName := varNameFunc(resource.Labels()[0], name) + varValue := extractStringValue(attr.BuildTokens(nil)) + if varValue != "" { + vars[varName] = varValue + } + } + } + return vars +} + +func shortName(resourceName string) string { + parts := strings.Split(resourceName, "_") + return parts[len(parts)-1] +} + +func extractStringValue(tokens hclwrite.Tokens) string { + var str string + for _, token := range tokens { + if token.Type == hclsyntax.TokenQuotedLit { + str = string(token.Bytes) + break + } + } + return str +} diff --git a/internal/testutil/unit/tf_config_modifier_test.go b/internal/testutil/unit/tf_config_modifier_test.go new file mode 100644 index 0000000000..78a89f5a8b --- /dev/null +++ b/internal/testutil/unit/tf_config_modifier_test.go @@ -0,0 +1,70 @@ +package unit_test + +import ( + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" + "github.com/stretchr/testify/require" +) + +var projectAdvClusterExample = ` +resource "mongodbatlas_project" "test" { + org_id = "65def6ce0f722a1507105aa5" + name = "test-acc-tf-p-664077766951329406" +} + +resource "mongodbatlas_advanced_cluster" "test" { + project_id = mongodbatlas_project.test.id + name = "test-acc-tf-c-8022584361920682288" + cluster_type = "REPLICASET" + backup_enabled = false + + replication_specs { + region_configs { + provider_name = "AWS" + priority = 6 + region_name = "US_WEST_2" + electable_specs { + node_count = 1 + instance_size = "M10" + } + } + + region_configs { + provider_name = "AWS" + priority = 7 + region_name = "US_EAST_1" + electable_specs { + node_count = 2 + instance_size = "M10" + } + } + } +}` + +func TestExtractConfigVariables(t *testing.T) { + tests := map[string]struct { + expected map[string]string + config string + }{ + "Extract variables from a long example": { + config: projectAdvClusterExample, + expected: map[string]string{ + "orgId": "65def6ce0f722a1507105aa5", + "projectName": "test-acc-tf-p-664077766951329406", + "clusterName": "test-acc-tf-c-8022584361920682288", + }, + }, + "Extract variables from an empty config": { + config: "", + expected: nil, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + result := unit.ExtractConfigVariables(t, tc.config) + require.Equal(t, tc.expected, result) + }) + } +} From e8417946105866960fbc337669acf55be472e66d Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Sat, 14 Dec 2024 09:18:48 +0000 Subject: [PATCH 04/40] chore: Adds Advanced Cluster TPF Test Coverage and fixes (#2875) * test: Adds support for MacT capture using HTTP_MOCKER_CAPTURE * test: Refactor advanced cluster validation tests and remove obsolete unit tests (refactored/added in next PR) * chore: Adapts updated mocking config and fixes a few issues with adv_cluster tpf implementation * test: Refactor advanced cluster test cases to use CaptureOrMockTestCaseAndRun and delete unnecessary resource_unit_test.go * test: Enhance HTTP mocking functionality with replay support and add helper calls in test cases * test: Simplify env var logic and use env vars in CI * test: Add SkipInReplayMode helper to skip tests when in replay mode * test: Update ReplicasetAdvConfigUpdate to use TestCheckResourceAttrSet for container_id * refactor: Update type definitions to use 'any' and remove unused test main file * address PR comments * feat: apply latest changes from CLOUDP-287995_failure_recordings * feat: apply changes from CLOUDP-287995_failure_recordings * test: update replication specs and remove outdated manual test data * chore: Adds validation for descending priority order in region_configs for adv_cluster TPF (#2889) * feat: add validation for descending priority order in region_configs * Update internal/service/advancedclustertpf/validate_schema.go Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * fix: suggested commit --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * chore: Uses zero values for computed attributes and avoids `""` in payloads (#2888) * refactor: Use zero values instead of null values * feat: Add NilForUnknownOrEmpty function for improved string handling * refactor: Replace NilForUnknown with NilForUnknownOrEmpty for EbsVolumeType handling * apply PR suggestions * chore: Fixes rename of ConvertAdvancedClusterToSchemaV2 * chore: Support trimming spaces and linebreaks in dumped data * chore: only one resourceName --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> --- .github/workflows/acceptance-tests-runner.yml | 5 +- internal/common/conversion/type_conversion.go | 18 + .../common/conversion/type_conversion_test.go | 20 + .../model_ClusterDescription20240805.go | 104 ++-- .../model_to_ClusterDescription20240805.go | 8 +- .../advancedclustertpf/move_state_test.go | 4 - .../service/advancedclustertpf/resource.go | 29 +- .../advancedclustertpf/resource_schema.go | 3 + .../resource_schema_test.go | 36 +- .../advancedclustertpf/resource_test.go | 50 ++ .../resource_test_cases_test.go | 477 ++++++++++++++++++ ...ccMockableAdvancedCluster_basicTenant.yaml | 254 ++++++++++ ...groups_{groupId}_clusters_2024-10-23.json} | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 0 ..._groups_{groupId}_clusters_2024-10-23.json | 5 +- ...d}_clusters_{clusterName2}_2023-02-01.json | 0 ...ncedCluster_replicasetAdvConfigUpdate.yaml | 340 +++++++++++++ ..._groups_{groupId}_clusters_2024-10-23.json | 2 +- ...d}_clusters_{clusterName}_2024-10-23.json} | 1 - ..._{clusterName}_processArgs_2024-08-05.json | 9 + ..._{clusterName}_processArgs_2023-01-01.json | 3 + ...d}_clusters_{clusterName}_2023-02-01.json} | 0 ...d}_clusters_{clusterName}_2023-02-01.json} | 0 ...cMockableAdvancedCluster_shardedBasic.yaml | 303 +++++++++++ ..._groups_{groupId}_clusters_2024-10-23.json | 2 +- ...Id}_clusters_{clusterName}_2024-08-05.json | 6 +- ...d}_clusters_{clusterName}_2023-02-01.json} | 0 ...ncedCluster_symmetricShardedOldSchema.yaml | 350 +++++++++++++ ..._groups_{groupId}_clusters_2024-10-23.json | 2 +- ...d}_clusters_{clusterName}_2023-02-01.json} | 2 +- ...Id}_clusters_{clusterName}_2024-10-23.json | 0 ...d}_clusters_{clusterName}_2023-02-01.json} | 0 ...edOldSchemaDiskSizeGBAtElectableLevel.yaml | 316 ++++++++++++ ...groups_{groupId}_clusters_2024-10-23.json} | 2 +- ..._groups_{groupId}_settings_2023-01-01.json | 0 ..._groups_{groupId}_clusters_2024-08-05.json | 0 ...d}_clusters_{clusterName}_2023-02-01.json} | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 0 ...MockableAdvancedCluster_tenantUpgrade.yaml | 202 ++++++++ ...groups_{groupId}_clusters_2024-10-23.json} | 2 +- ...Id}_clusters_tenantUpgrade_2023-01-01.json | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 0 ...TestMockAdvancedCluster_configSharded.yaml | 216 -------- ...sters_{clusterName}_2024-08-05_manual.json | 72 --- .../TestMockAdvancedCluster_replicaset.yaml | 431 ---------------- ...Id}_clusters_{clusterName}_2024-10-23.json | 3 - ...Id}_clusters_{clusterName}_2024-10-23.json | 3 - ..._{clusterName}_processArgs_2024-08-05.json | 4 - ...usterConfig_symmetricShardedOldSchema.yaml | 371 -------------- ...Id}_clusters_{clusterName}_2023-02-01.json | 36 -- ...edOldSchemaDiskSizeGBAtElectableLevel.yaml | 318 ------------ ..._groups_{groupId}_clusters_2024-10-23.json | 49 -- ...Id}_clusters_{clusterName}_2023-02-01.json | 27 - ...ockClusterAdvancedCluster_basicTenant.yaml | 286 ----------- ..._groups_{groupId}_clusters_2024-10-23.json | 23 - ..._{groupId}_clusters_2024-10-23_manual.json | 22 - ...kClusterAdvancedCluster_tenantUpgrade.yaml | 186 ------- ..._groups_{groupId}_clusters_2024-10-23.json | 23 - .../advancedclustertpf/validate_schema.go | 23 + .../unit/http_mocker_config_capture_test.go | 32 ++ internal/testutil/unit/http_mocker_data.go | 5 +- .../testutil/unit/http_mocker_data_test.go | 3 +- 62 files changed, 2523 insertions(+), 2171 deletions(-) create mode 100644 internal/service/advancedclustertpf/resource_test.go create mode 100644 internal/service/advancedclustertpf/resource_test_cases_test.go create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant.yaml rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json => TestAccMockableAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json} (89%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_basicTenant => TestAccMockableAdvancedCluster_basicTenant}/02_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json (100%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_basicTenant => TestAccMockableAdvancedCluster_basicTenant}/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json (78%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_basicTenant => TestAccMockableAdvancedCluster_basicTenant}/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName2}_2023-02-01.json (100%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_replicaset => TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate}/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json (95%) rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_replicaset/03_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json => TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json} (91%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_03_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_configSharded/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json => TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_04_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (100%) rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_replicaset/06_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json => TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (100%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_configSharded => TestAccMockableAdvancedCluster_shardedBasic}/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json (95%) rename internal/service/advancedclustertpf/testdata/{TestMockAdvancedCluster_configSharded => TestAccMockableAdvancedCluster_shardedBasic}/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json (89%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json => TestAccMockableAdvancedCluster_shardedBasic/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (100%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema => TestAccMockableAdvancedCluster_symmetricShardedOldSchema}/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json (96%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json => TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (96%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema => TestAccMockableAdvancedCluster_symmetricShardedOldSchema}/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json (100%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json => TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (100%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json => TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json} (96%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel => TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel}/01_02_PATCH__api_atlas_v2_groups_{groupId}_settings_2023-01-01.json (100%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel => TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel}/01_03_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json (100%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json => TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json} (94%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_tenantUpgrade => TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel}/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json (100%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade.yaml rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json => TestAccMockableAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json} (88%) rename internal/service/advancedclustertpf/testdata/{TestMockClusterAdvancedCluster_tenantUpgrade => TestAccMockableAdvancedCluster_tenantUpgrade}/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json (71%) create mode 100644 internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05_manual.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/04_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/05_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade.yaml delete mode 100644 internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index c1d7c199d3..5eb9232b82 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -371,12 +371,15 @@ jobs: run: go test -v ./internal/testutil/acc/advanced_cluster_schema_v2_test.go - name: Mocked Acceptance Tests env: - ACCTEST_REGEX_RUN: '^TestMock' + ACCTEST_REGEX_RUN: '^TestAccMockable' ACCTEST_PACKAGES: ./internal/service/advancedclustertpf + MONGODB_ATLAS_PROJECT_ID: '111111111111111111111111' # 24 chars used for skipping acc.ProjectIDExecution(t) in mocked tests + HTTP_MOCKER_REPLAY: 'true' run: make testacc - name: Acceptance Tests env: MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }} + HTTP_MOCKER_CAPTURE: 'true' ACCTEST_PACKAGES: | ./internal/service/advancedcluster ./internal/service/advancedclustertpf diff --git a/internal/common/conversion/type_conversion.go b/internal/common/conversion/type_conversion.go index 67d9c5f1f7..b88f7cdf48 100644 --- a/internal/common/conversion/type_conversion.go +++ b/internal/common/conversion/type_conversion.go @@ -3,8 +3,18 @@ package conversion import ( "strings" "time" + + "github.com/hashicorp/terraform-plugin-framework/types" ) +func SafeValue[T any](v *T) T { + if v != nil { + return *v + } + var emptyValue T + return emptyValue +} + func SafeString(s *string) string { if s != nil { return *s @@ -86,3 +96,11 @@ func NilForUnknown[T any](primitiveAttr TFPrimitiveType, value *T) *T { } return value } + +func NilForUnknownOrEmptyString(primitiveAttr types.String) *string { + value := NilForUnknown(primitiveAttr, primitiveAttr.ValueStringPointer()) + if value == nil || *value == "" { + return nil + } + return value +} diff --git a/internal/common/conversion/type_conversion_test.go b/internal/common/conversion/type_conversion_test.go index 028d7d163a..95234d26bd 100644 --- a/internal/common/conversion/type_conversion_test.go +++ b/internal/common/conversion/type_conversion_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/stretchr/testify/assert" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -95,3 +96,22 @@ func TestAWSRegionToMongoDBRegion(t *testing.T) { } } } + +func TestSafeValue(t *testing.T) { + var boolPointer *bool + assert.False(t, conversion.SafeValue(boolPointer)) + trueBool := true + assert.True(t, conversion.SafeValue(&trueBool)) + var intPointer *int + assert.Equal(t, 0, conversion.SafeValue(intPointer)) + var stringPointer *string + assert.Equal(t, "", conversion.SafeValue(stringPointer)) +} + +func TestNilForUnknownOrEmpty(t *testing.T) { + assert.Nil(t, conversion.NilForUnknownOrEmptyString(types.StringPointerValue(nil))) + emptyString := "" + assert.Nil(t, conversion.NilForUnknownOrEmptyString(types.StringPointerValue(&emptyString))) + testString := "test" + assert.Equal(t, "test", *conversion.NilForUnknownOrEmptyString(types.StringPointerValue(&testString))) +} diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index 6491fc2879..8df35183b4 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -38,32 +38,32 @@ func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, ti } return &TFModel{ AcceptDataRisksAndForceReplicaSetReconfig: types.StringPointerValue(conversion.TimePtrToStringPtr(input.AcceptDataRisksAndForceReplicaSetReconfig)), - BackupEnabled: types.BoolPointerValue(input.BackupEnabled), + BackupEnabled: types.BoolValue(conversion.SafeValue(input.BackupEnabled)), BiConnectorConfig: biConnector, - ClusterType: types.StringPointerValue(input.ClusterType), - ConfigServerManagementMode: types.StringPointerValue(input.ConfigServerManagementMode), - ConfigServerType: types.StringPointerValue(input.ConfigServerType), + ClusterType: types.StringValue(conversion.SafeValue(input.ClusterType)), + ConfigServerManagementMode: types.StringValue(conversion.SafeValue(input.ConfigServerManagementMode)), + ConfigServerType: types.StringValue(conversion.SafeValue(input.ConfigServerType)), ConnectionStrings: connectionStrings, - CreateDate: types.StringPointerValue(conversion.TimePtrToStringPtr(input.CreateDate)), + CreateDate: types.StringValue(conversion.SafeValue(conversion.TimePtrToStringPtr(input.CreateDate))), DiskSizeGB: types.Float64PointerValue(findRegionRootDiskSize(input.ReplicationSpecs)), - EncryptionAtRestProvider: types.StringPointerValue(input.EncryptionAtRestProvider), - GlobalClusterSelfManagedSharding: types.BoolPointerValue(input.GlobalClusterSelfManagedSharding), - ProjectID: types.StringPointerValue(input.GroupId), - ClusterID: types.StringPointerValue(input.Id), + EncryptionAtRestProvider: types.StringValue(conversion.SafeValue(input.EncryptionAtRestProvider)), + GlobalClusterSelfManagedSharding: types.BoolValue(conversion.SafeValue(input.GlobalClusterSelfManagedSharding)), + ProjectID: types.StringValue(conversion.SafeValue(input.GroupId)), + ClusterID: types.StringValue(conversion.SafeValue(input.Id)), Labels: labels, - MongoDBMajorVersion: types.StringPointerValue(input.MongoDBMajorVersion), - MongoDBVersion: types.StringPointerValue(input.MongoDBVersion), - Name: types.StringPointerValue(input.Name), - Paused: types.BoolPointerValue(input.Paused), - PitEnabled: types.BoolPointerValue(input.PitEnabled), - RedactClientLogData: types.BoolPointerValue(input.RedactClientLogData), - ReplicaSetScalingStrategy: types.StringPointerValue(input.ReplicaSetScalingStrategy), + MongoDBMajorVersion: types.StringValue(conversion.SafeValue(input.MongoDBMajorVersion)), + MongoDBVersion: types.StringValue(conversion.SafeValue(input.MongoDBVersion)), + Name: types.StringValue(conversion.SafeValue(input.Name)), + Paused: types.BoolValue(conversion.SafeValue(input.Paused)), + PitEnabled: types.BoolValue(conversion.SafeValue(input.PitEnabled)), + RedactClientLogData: types.BoolValue(conversion.SafeValue(input.RedactClientLogData)), + ReplicaSetScalingStrategy: types.StringValue(conversion.SafeValue(input.ReplicaSetScalingStrategy)), ReplicationSpecs: replicationSpecs, - RootCertType: types.StringPointerValue(input.RootCertType), - StateName: types.StringPointerValue(input.StateName), + RootCertType: types.StringValue(conversion.SafeValue(input.RootCertType)), + StateName: types.StringValue(conversion.SafeValue(input.StateName)), Tags: tags, - TerminationProtectionEnabled: types.BoolPointerValue(input.TerminationProtectionEnabled), - VersionReleaseSystem: types.StringPointerValue(input.VersionReleaseSystem), + TerminationProtectionEnabled: types.BoolValue(conversion.SafeValue(input.TerminationProtectionEnabled)), + VersionReleaseSystem: types.StringValue(conversion.SafeValue(input.VersionReleaseSystem)), PinnedFCV: types.ObjectNull(PinnedFCVObjType.AttrTypes), // TODO static object Timeouts: timeout, } @@ -74,8 +74,8 @@ func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, return types.ObjectNull(BiConnectorConfigObjType.AttrTypes) } tfModel := TFBiConnectorModel{ - Enabled: types.BoolPointerValue(input.Enabled), - ReadPreference: types.StringPointerValue(input.ReadPreference), + Enabled: types.BoolValue(conversion.SafeValue(input.Enabled)), + ReadPreference: types.StringValue(conversion.SafeValue(input.ReadPreference)), } objType, diagsLocal := types.ObjectValueFrom(ctx, BiConnectorConfigObjType.AttrTypes, tfModel) diags.Append(diagsLocal...) @@ -88,11 +88,11 @@ func NewConnectionStringsObjType(ctx context.Context, input *admin.ClusterConnec } privateEndpoint := NewPrivateEndpointObjType(ctx, input.PrivateEndpoint, diags) tfModel := TFConnectionStringsModel{ - Private: types.StringPointerValue(input.Private), + Private: types.StringValue(conversion.SafeValue(input.Private)), PrivateEndpoint: privateEndpoint, - PrivateSrv: types.StringPointerValue(input.PrivateSrv), - Standard: types.StringPointerValue(input.Standard), - StandardSrv: types.StringPointerValue(input.StandardSrv), + PrivateSrv: types.StringValue(conversion.SafeValue(input.PrivateSrv)), + Standard: types.StringValue(conversion.SafeValue(input.Standard)), + StandardSrv: types.StringValue(conversion.SafeValue(input.StandardSrv)), } objType, diagsLocal := types.ObjectValueFrom(ctx, ConnectionStringsObjType.AttrTypes, tfModel) diags.Append(diagsLocal...) @@ -106,8 +106,8 @@ func NewLabelsObjType(ctx context.Context, input *[]admin.ComponentLabel, diags tfModels := make([]TFLabelsModel, len(*input)) for i, item := range *input { tfModels[i] = TFLabelsModel{ - Key: types.StringPointerValue(item.Key), - Value: types.StringPointerValue(item.Value), + Key: types.StringValue(conversion.SafeValue(item.Key)), + Value: types.StringValue(conversion.SafeValue(item.Value)), } } setType, diagsLocal := types.SetValueFrom(ctx, LabelsObjType, tfModels) @@ -145,12 +145,12 @@ func convertReplicationSpecs(ctx context.Context, input *[]admin.ReplicationSpec legacyID := apiInfo.ZoneNameReplicationSpecIDs[zoneName] tfModels[i] = TFReplicationSpecsModel{ Id: conversion.StringNullIfEmpty(legacyID), - ExternalId: types.StringPointerValue(item.Id), + ExternalId: types.StringValue(conversion.SafeValue(item.Id)), NumShards: types.Int64Value(1), ContainerId: conversion.ToTFMapOfString(ctx, diags, &apiInfo.ContainerIDs), RegionConfigs: regionConfigs, - ZoneId: types.StringPointerValue(item.ZoneId), - ZoneName: types.StringPointerValue(item.ZoneName), + ZoneId: types.StringValue(conversion.SafeValue(item.ZoneId)), + ZoneName: types.StringValue(conversion.SafeValue(item.ZoneName)), } } return &tfModels @@ -189,12 +189,12 @@ func convertReplicationSpecsLegacy(ctx context.Context, input *[]admin.Replicati } tfModels = append(tfModels, TFReplicationSpecsModel{ ContainerId: conversion.ToTFMapOfString(ctx, diags, &apiInfo.ContainerIDs), - ExternalId: types.StringPointerValue(item.Id), + ExternalId: types.StringValue(conversion.SafeValue(item.Id)), Id: types.StringValue(legacyID), RegionConfigs: regionConfigs, NumShards: types.Int64Value(numShards), - ZoneId: types.StringPointerValue(item.ZoneId), - ZoneName: types.StringPointerValue(item.ZoneName), + ZoneId: types.StringValue(conversion.SafeValue(item.ZoneId)), + ZoneName: types.StringValue(conversion.SafeValue(item.ZoneName)), }) } return &tfModels @@ -225,11 +225,11 @@ func NewPrivateEndpointObjType(ctx context.Context, input *[]admin.ClusterDescri for i, item := range *input { endpoints := NewEndpointsObjType(ctx, item.Endpoints, diags) tfModels[i] = TFPrivateEndpointModel{ - ConnectionString: types.StringPointerValue(item.ConnectionString), + ConnectionString: types.StringValue(conversion.SafeValue(item.ConnectionString)), Endpoints: endpoints, - SrvConnectionString: types.StringPointerValue(item.SrvConnectionString), - SrvShardOptimizedConnectionString: types.StringPointerValue(item.SrvShardOptimizedConnectionString), - Type: types.StringPointerValue(item.Type), + SrvConnectionString: types.StringValue(conversion.SafeValue(item.SrvConnectionString)), + SrvShardOptimizedConnectionString: types.StringValue(conversion.SafeValue(item.SrvShardOptimizedConnectionString)), + Type: types.StringValue(conversion.SafeValue(item.Type)), } } listType, diagsLocal := types.ListValueFrom(ctx, PrivateEndpointObjType, tfModels) @@ -255,9 +255,9 @@ func NewRegionConfigsObjType(ctx context.Context, input *[]admin.CloudRegionConf BackingProviderName: types.StringPointerValue(item.BackingProviderName), ElectableSpecs: electableSpecs, Priority: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(item.Priority)), - ProviderName: types.StringPointerValue(item.ProviderName), + ProviderName: types.StringValue(conversion.SafeValue(item.ProviderName)), ReadOnlySpecs: readOnlySpecs, - RegionName: types.StringPointerValue(item.RegionName), + RegionName: types.StringValue(conversion.SafeValue(item.RegionName)), } } listType, diagsLocal := types.ListValueFrom(ctx, RegionConfigsObjType, tfModels) @@ -272,9 +272,9 @@ func NewEndpointsObjType(ctx context.Context, input *[]admin.ClusterDescriptionC tfModels := make([]TFEndpointsModel, len(*input)) for i, item := range *input { tfModels[i] = TFEndpointsModel{ - EndpointId: types.StringPointerValue(item.EndpointId), - ProviderName: types.StringPointerValue(item.ProviderName), - Region: types.StringPointerValue(item.Region), + EndpointId: types.StringValue(conversion.SafeValue(item.EndpointId)), + ProviderName: types.StringValue(conversion.SafeValue(item.ProviderName)), + Region: types.StringValue(conversion.SafeValue(item.Region)), } } listType, diagsLocal := types.ListValueFrom(ctx, EndpointsObjType, tfModels) @@ -289,8 +289,8 @@ func NewSpecsObjType(ctx context.Context, input *admin.DedicatedHardwareSpec2024 tfModel := TFSpecsModel{ DiskIops: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.DiskIOPS)), DiskSizeGb: types.Float64PointerValue(input.DiskSizeGB), - EbsVolumeType: types.StringPointerValue(input.EbsVolumeType), - InstanceSize: types.StringPointerValue(input.InstanceSize), + EbsVolumeType: types.StringValue(conversion.SafeValue(input.EbsVolumeType)), + InstanceSize: types.StringValue(conversion.SafeValue(input.InstanceSize)), NodeCount: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.NodeCount)), } objType, diagsLocal := types.ObjectValueFrom(ctx, SpecsObjType.AttrTypes, tfModel) @@ -305,8 +305,8 @@ func NewSpecsFromHwObjType(ctx context.Context, input *admin.HardwareSpec2024080 tfModel := TFSpecsModel{ DiskIops: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.DiskIOPS)), DiskSizeGb: types.Float64PointerValue(input.DiskSizeGB), - EbsVolumeType: types.StringPointerValue(input.EbsVolumeType), - InstanceSize: types.StringPointerValue(input.InstanceSize), + EbsVolumeType: types.StringValue(conversion.SafeValue(input.EbsVolumeType)), + InstanceSize: types.StringValue(conversion.SafeValue(input.InstanceSize)), NodeCount: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.NodeCount)), } objType, diagsLocal := types.ObjectValueFrom(ctx, SpecsObjType.AttrTypes, tfModel) @@ -321,14 +321,14 @@ func NewAutoScalingObjType(ctx context.Context, input *admin.AdvancedAutoScaling compute := input.Compute tfModel := TFAutoScalingModel{} if compute != nil { - tfModel.ComputeMaxInstanceSize = types.StringPointerValue(compute.MaxInstanceSize) - tfModel.ComputeMinInstanceSize = types.StringPointerValue(compute.MinInstanceSize) - tfModel.ComputeEnabled = types.BoolPointerValue(compute.Enabled) - tfModel.ComputeScaleDownEnabled = types.BoolPointerValue(compute.ScaleDownEnabled) + tfModel.ComputeMaxInstanceSize = types.StringValue(conversion.SafeValue(compute.MaxInstanceSize)) + tfModel.ComputeMinInstanceSize = types.StringValue(conversion.SafeValue(compute.MinInstanceSize)) + tfModel.ComputeEnabled = types.BoolValue(conversion.SafeValue(compute.Enabled)) + tfModel.ComputeScaleDownEnabled = types.BoolValue(conversion.SafeValue(compute.ScaleDownEnabled)) } diskGB := input.DiskGB if diskGB != nil { - tfModel.DiskGBEnabled = types.BoolPointerValue(diskGB.Enabled) + tfModel.DiskGBEnabled = types.BoolValue(conversion.SafeValue(diskGB.Enabled)) } objType, diagsLocal := types.ObjectValueFrom(ctx, AutoScalingObjType.AttrTypes, tfModel) diags.Append(diagsLocal...) diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index 2e3b9f5eb5..95a08ee52a 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -183,7 +183,7 @@ func newHardwareSpec20240805(ctx context.Context, input types.Object, diags *dia return &admin.HardwareSpec20240805{ DiskIOPS: conversion.NilForUnknown(item.DiskIops, conversion.Int64PtrToIntPtr(item.DiskIops.ValueInt64Pointer())), DiskSizeGB: conversion.NilForUnknown(item.DiskSizeGb, item.DiskSizeGb.ValueFloat64Pointer()), - EbsVolumeType: conversion.NilForUnknown(item.EbsVolumeType, item.EbsVolumeType.ValueStringPointer()), + EbsVolumeType: conversion.NilForUnknownOrEmptyString(item.EbsVolumeType), InstanceSize: conversion.NilForUnknown(item.InstanceSize, item.InstanceSize.ValueStringPointer()), NodeCount: conversion.NilForUnknown(item.NodeCount, conversion.Int64PtrToIntPtr(item.NodeCount.ValueInt64Pointer())), } @@ -202,7 +202,7 @@ func newDedicatedHardwareSpec20240805(ctx context.Context, input types.Object, d DiskIOPS: conversion.NilForUnknown(item.DiskIops, conversion.Int64PtrToIntPtr(item.DiskIops.ValueInt64Pointer())), DiskSizeGB: conversion.NilForUnknown(item.DiskSizeGb, item.DiskSizeGb.ValueFloat64Pointer()), EbsVolumeType: conversion.NilForUnknown(item.EbsVolumeType, item.EbsVolumeType.ValueStringPointer()), - InstanceSize: conversion.NilForUnknown(item.InstanceSize, item.InstanceSize.ValueStringPointer()), + InstanceSize: conversion.NilForUnknownOrEmptyString(item.InstanceSize), NodeCount: conversion.NilForUnknown(item.NodeCount, conversion.Int64PtrToIntPtr(item.NodeCount.ValueInt64Pointer())), } } @@ -220,8 +220,8 @@ func newAdvancedComputeAutoScaling(ctx context.Context, input types.Object, diag return &admin.AdvancedComputeAutoScaling{ Enabled: conversion.NilForUnknown(item.ComputeEnabled, item.ComputeEnabled.ValueBoolPointer()), ScaleDownEnabled: conversion.NilForUnknown(item.ComputeScaleDownEnabled, item.ComputeScaleDownEnabled.ValueBoolPointer()), - MaxInstanceSize: conversion.NilForUnknown(item.ComputeMaxInstanceSize, item.ComputeMaxInstanceSize.ValueStringPointer()), - MinInstanceSize: conversion.NilForUnknown(item.ComputeMinInstanceSize, item.ComputeMinInstanceSize.ValueStringPointer()), + MaxInstanceSize: conversion.NilForUnknownOrEmptyString(item.ComputeMaxInstanceSize), + MinInstanceSize: conversion.NilForUnknownOrEmptyString(item.ComputeMinInstanceSize), } } func newDiskGBAutoScaling(ctx context.Context, input types.Object, diags *diag.Diagnostics) *admin.DiskGBAutoScaling { diff --git a/internal/service/advancedclustertpf/move_state_test.go b/internal/service/advancedclustertpf/move_state_test.go index 7df26cbbc5..5e8072491c 100644 --- a/internal/service/advancedclustertpf/move_state_test.go +++ b/internal/service/advancedclustertpf/move_state_test.go @@ -10,10 +10,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) -const ( - resourceName = "mongodbatlas_advanced_cluster.test" -) - func TestAccAdvancedCluster_moveBasic(t *testing.T) { var ( projectID = acc.ProjectIDExecution(t) diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 95cd97d716..3e92d1af58 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -129,20 +129,17 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou if diags.HasError() { return } - var model *TFModel - if cluster == nil { - r.updateAdvConfig(ctx, legacyAdvConfig, advConfig, &state, diags) + var stateAdvConfig *types.Object + if advConfigChanged || cluster == nil { + // Cluster changes to UPDATING state after updating advanced configuration + cluster = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, plan.ProjectID.ValueString(), plan.Name.ValueString(), changeReasonUpdate) if diags.HasError() { return } - model = &state } else { - var stateAdvConfig types.Object - if !advConfigChanged { - stateAdvConfig = state.AdvancedConfiguration - } - model = r.convertClusterAddAdvConfig(ctx, legacyAdvConfig, advConfig, cluster, &plan, &stateAdvConfig, diags) + stateAdvConfig = &state.AdvancedConfiguration } + model := r.convertClusterAddAdvConfig(ctx, legacyAdvConfig, advConfig, cluster, &plan, stateAdvConfig, diags) if model != nil { diags.Append(resp.State.Set(ctx, model)...) } @@ -399,27 +396,19 @@ func (r *rs) convertClusterAddAdvConfig(ctx context.Context, legacyAdvConfig *ad if diags.HasError() { return nil } - if oldAdvConfig != nil { - modelOut.AdvancedConfiguration = *oldAdvConfig - } else { + if admin.IsNil(oldAdvConfig) { legacyAdvConfig, advConfig = readUnsetAdvancedConfiguration(ctx, r.Client, modelOut, legacyAdvConfig, advConfig, diags) AddAdvancedConfig(ctx, modelOut, advConfig, legacyAdvConfig, diags) if diags.HasError() { return nil } + } else { + modelOut.AdvancedConfiguration = *oldAdvConfig } overrideAttributesWithPrevStateValue(modelIn, modelOut) return modelOut } -func (r *rs) updateAdvConfig(ctx context.Context, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805, state *TFModel, diags *diag.Diagnostics) { - legacyAdvConfig, advConfig = readUnsetAdvancedConfiguration(ctx, r.Client, state, legacyAdvConfig, advConfig, diags) - if diags.HasError() { - return - } - AddAdvancedConfig(ctx, state, advConfig, legacyAdvConfig, diags) -} - func readUnsetAdvancedConfiguration(ctx context.Context, client *config.MongoDBClient, model *TFModel, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805, diags *diag.Diagnostics) (*admin20240530.ClusterDescriptionProcessArgs, *admin.ClusterDescriptionProcessArgs20240805) { api := client.AtlasV2.ClustersApi api20240530 := client.AtlasV220240530.ClustersApi diff --git a/internal/service/advancedclustertpf/resource_schema.go b/internal/service/advancedclustertpf/resource_schema.go index d8d8890ea6..001745c89a 100644 --- a/internal/service/advancedclustertpf/resource_schema.go +++ b/internal/service/advancedclustertpf/resource_schema.go @@ -239,6 +239,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { "region_configs": schema.ListNestedAttribute{ Required: true, MarkdownDescription: "Hardware specifications for nodes set for a given region. Each **regionConfigs** object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each **regionConfigs** object must have either an **analyticsSpecs** object, **electableSpecs** object, or **readOnlySpecs** object. Tenant clusters only require **electableSpecs. Dedicated** clusters can specify any of these specifications, but must have at least one **electableSpecs** object within a **replicationSpec**.\n\n**Example:**\n\nIf you set `\"replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize\" : \"M30\"`, set `\"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize\" : `\"M30\"` if you have electable nodes and `\"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize\" : `\"M30\"` if you have read-only nodes.", + Validators: []validator.List{ + RegionSpecPriorityOrderDecreasingValidator{}, + }, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "analytics_auto_scaling": AutoScalingSchema(), diff --git a/internal/service/advancedclustertpf/resource_schema_test.go b/internal/service/advancedclustertpf/resource_schema_test.go index fdf578781b..4b11d52eaf 100644 --- a/internal/service/advancedclustertpf/resource_schema_test.go +++ b/internal/service/advancedclustertpf/resource_schema_test.go @@ -17,6 +17,10 @@ func TestAdvancedCluster_ValidationErrors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, Steps: []resource.TestStep{ + { + Config: acc.ConvertAdvancedClusterToSchemaV2(t, true, invalidRegionConfigsPriorities), + ExpectError: regexp.MustCompile("priority values in region_configs must be in descending order"), + }, { Config: configBasic(projectID, clusterName, "mongo_db_major_version = \"8a\""), ExpectError: regexp.MustCompile("Invalid Attribute Value Match"), @@ -89,7 +93,7 @@ func configBasic(projectID, clusterName, extra string) string { return fmt.Sprintf(` resource "mongodbatlas_advanced_cluster" "test" { timeouts = { - create = "20s" + create = "2000s" } project_id = %[1]q name = %[2]q @@ -115,3 +119,33 @@ func configBasic(projectID, clusterName, extra string) string { } `, projectID, clusterName, extra) } + +var invalidRegionConfigsPriorities = ` +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "test-acc-tf-c-2670522663699021050" + cluster_type = "REPLICASET" + backup_enabled = false + + replication_specs { + region_configs { + provider_name = "AWS" + priority = 6 + region_name = "US_WEST_2" + electable_specs { + node_count = 1 + instance_size = "M10" + } + } + region_configs { + provider_name = "AWS" + priority = 7 + region_name = "US_EAST_1" + electable_specs { + node_count = 2 + instance_size = "M10" + } + } + } +} +` diff --git a/internal/service/advancedclustertpf/resource_test.go b/internal/service/advancedclustertpf/resource_test.go new file mode 100644 index 0000000000..f1b1c4e861 --- /dev/null +++ b/internal/service/advancedclustertpf/resource_test.go @@ -0,0 +1,50 @@ +package advancedclustertpf_test + +import ( + "testing" + "time" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedclustertpf" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/unit" +) + +var ( + mockConfig = unit.MockHTTPDataConfig{AllowMissingRequests: true, SideEffect: shortenRetries, IsDiffMustSubstrings: []string{"/clusters"}} +) + +func shortenRetries() error { + advancedclustertpf.RetryMinTimeout = 100 * time.Millisecond + advancedclustertpf.RetryDelay = 100 * time.Millisecond + advancedclustertpf.RetryPollInterval = 100 * time.Millisecond + return nil +} + +func TestAccMockableAdvancedCluster_basicTenant(t *testing.T) { + testCase := basicTenantTestCase(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} + +func TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T) { + testCase := symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} + +func TestAccMockableAdvancedCluster_symmetricShardedOldSchema(t *testing.T) { + testCase := symmetricShardedOldSchema(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} + +func TestAccMockableAdvancedCluster_tenantUpgrade(t *testing.T) { + testCase := tenantUpgrade(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} + +func TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate(t *testing.T) { + testCase := replicasetAdvConfigUpdate(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} + +func TestAccMockableAdvancedCluster_shardedBasic(t *testing.T) { + testCase := shardedBasic(t) + unit.CaptureOrMockTestCaseAndRun(t, mockConfig, testCase) +} diff --git a/internal/service/advancedclustertpf/resource_test_cases_test.go b/internal/service/advancedclustertpf/resource_test_cases_test.go new file mode 100644 index 0000000000..7881976157 --- /dev/null +++ b/internal/service/advancedclustertpf/resource_test_cases_test.go @@ -0,0 +1,477 @@ +package advancedclustertpf_test + +import ( + "fmt" + "strconv" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" +) + +const ( + resourceName = "mongodbatlas_advanced_cluster.test" + dataSourceName = "data.mongodbatlas_advanced_cluster.test" + dataSourcePluralName = "data.mongodbatlas_advanced_clusters.test" +) + +var ( + configServerManagementModeFixedToDedicated = "FIXED_TO_DEDICATED" + configServerManagementModeAtlasManaged = "ATLAS_MANAGED" +) + +func symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + ) + return &resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + Config: configShardedOldSchemaDiskSizeGBElectableLevel(projectID, clusterName, 50), + Check: checkShardedOldSchemaDiskSizeGBElectableLevel(50), + }, + { + Config: configShardedOldSchemaDiskSizeGBElectableLevel(projectID, clusterName, 55), + Check: checkShardedOldSchemaDiskSizeGBElectableLevel(55), + }, + }, + } +} + +func configShardedOldSchemaDiskSizeGBElectableLevel(projectID, name string, diskSizeGB int) string { + return fmt.Sprintf(` + resource "mongodbatlas_advanced_cluster" "test" { + project_id = %[1]q + name = %[2]q + backup_enabled = false + mongo_db_major_version = "7.0" + cluster_type = "SHARDED" + + replication_specs = [{ + num_shards = 2 + + region_configs = [{ + electable_specs = { + instance_size = "M10" + node_count = 3 + disk_size_gb = %[3]d + } + analytics_specs = { + instance_size = "M10" + node_count = 0 + disk_size_gb = %[3]d + } + provider_name = "AWS" + priority = 7 + region_name = "US_EAST_1" + }, + ] + }] + } + `, projectID, name, diskSizeGB) +} + +func checkShardedOldSchemaDiskSizeGBElectableLevel(diskSizeGB int) resource.TestCheckFunc { + return checkAggr( + []string{}, + map[string]string{ + "replication_specs.0.num_shards": "2", + "disk_size_gb": fmt.Sprintf("%d", diskSizeGB), + "replication_specs.0.region_configs.0.electable_specs.disk_size_gb": fmt.Sprintf("%d", diskSizeGB), + "replication_specs.0.region_configs.0.analytics_specs.disk_size_gb": fmt.Sprintf("%d", diskSizeGB), + }) +} + +func checkAggr(attrsSet []string, attrsMap map[string]string, extra ...resource.TestCheckFunc) resource.TestCheckFunc { + checks := []resource.TestCheckFunc{} + checks = acc.AddAttrChecks(resourceName, checks, attrsMap) + checks = acc.AddAttrSetChecks(resourceName, checks, attrsSet...) + checks = append(checks, extra...) + return resource.ComposeAggregateTestCheckFunc(checks...) +} + +func symmetricShardedOldSchema(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + ) + return &resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + Config: configShardedOldSchemaMultiCloud(projectID, clusterName, 2, "M10", &configServerManagementModeFixedToDedicated), + Check: checkShardedOldSchemaMultiCloud(clusterName, 2, "M10", false, &configServerManagementModeFixedToDedicated), + }, + { + Config: configShardedOldSchemaMultiCloud(projectID, clusterName, 2, "M20", &configServerManagementModeAtlasManaged), + Check: checkShardedOldSchemaMultiCloud(clusterName, 2, "M20", false, &configServerManagementModeAtlasManaged), + }, + }, + } +} + +func configShardedOldSchemaMultiCloud(projectID, name string, numShards int, analyticsSize string, configServerManagementMode *string) string { + var rootConfig string + if configServerManagementMode != nil { + // valid values: FIXED_TO_DEDICATED or ATLAS_MANAGED (default) + // only valid for Major version 8 and later + // cluster must be SHARDED + rootConfig = fmt.Sprintf(` + mongo_db_major_version = "8" + config_server_management_mode = %[1]q + `, *configServerManagementMode) + } + return fmt.Sprintf(` + resource "mongodbatlas_advanced_cluster" "test" { + project_id = %[1]q + name = %[2]q + cluster_type = "SHARDED" + %[5]s + + replication_specs = [{ + num_shards = %[3]d + region_configs = [{ + electable_specs = { + instance_size = "M10" + node_count = 3 + } + analytics_specs = { + instance_size = %[4]q + node_count = 1 + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }, { + electable_specs = { + instance_size = "M10" + node_count = 2 + } + provider_name = "AZURE" + priority = 6 + region_name = "US_EAST_2" + },] + },] + } + `, projectID, name, numShards, analyticsSize, rootConfig) +} + +func checkShardedOldSchemaMultiCloud(name string, numShards int, analyticsSize string, verifyExternalID bool, configServerManagementMode *string) resource.TestCheckFunc { + additionalChecks := []resource.TestCheckFunc{ + resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.0.electable_specs.disk_iops", acc.IntGreatThan(0)), + resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.0.analytics_specs.disk_iops", acc.IntGreatThan(0)), + resource.TestCheckResourceAttrWith(resourceName, "replication_specs.0.region_configs.1.electable_specs.disk_iops", acc.IntGreatThan(0)), + } + + if verifyExternalID { + additionalChecks = append( + additionalChecks, + resource.TestCheckResourceAttrSet(resourceName, "replication_specs.0.external_id")) + } + if configServerManagementMode != nil { + additionalChecks = append( + additionalChecks, + resource.TestCheckResourceAttr(resourceName, "config_server_management_mode", *configServerManagementMode), + resource.TestCheckResourceAttrSet(resourceName, "config_server_type"), + ) + } + + return checkAggr( + []string{"project_id", "replication_specs.#", "replication_specs.0.id", "replication_specs.0.region_configs.#"}, + map[string]string{ + "name": name, + "replication_specs.0.num_shards": strconv.Itoa(numShards), + "replication_specs.0.region_configs.0.analytics_specs.instance_size": analyticsSize, + }, + additionalChecks...) +} + +func basicTenantTestCase(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + clusterNameUpdated = acc.RandomClusterName() + ) + return &resource.TestCase{ + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + PreCheck: acc.PreCheckBasicSleep(t, nil, projectID, clusterName), + Steps: []resource.TestStep{ + { + Config: configTenant(projectID, clusterName), + Check: checkTenant(projectID, clusterName), + }, + { + Config: configTenant(projectID, clusterNameUpdated), + Check: checkTenant(projectID, clusterNameUpdated), + }, + acc.TestStepImportCluster(resourceName), + }, + } +} + +func configTenant(projectID, name string) string { + return fmt.Sprintf(` + resource "mongodbatlas_advanced_cluster" "test" { + project_id = %[1]q + name = %[2]q + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + electable_specs = { + instance_size = "M5" + } + provider_name = "TENANT" + backing_provider_name = "AWS" + region_name = "US_EAST_1" + priority = 7 + }] + }] + } + `, projectID, name) +} + +func checkTenant(projectID, name string) resource.TestCheckFunc { + attrsSet := []string{"replication_specs.#", "replication_specs.0.id", "replication_specs.0.region_configs.#"} + attrsMap := map[string]string{ + "project_id": projectID, + "name": name, + "termination_protection_enabled": "false", + "global_cluster_self_managed_sharding": "false", + "labels.#": "0", + } + checks := acc.AddAttrSetChecks(resourceName, nil, attrsSet...) + checks = acc.AddAttrChecks(resourceName, checks, attrsMap) + return resource.ComposeAggregateTestCheckFunc(checks...) +} + +func tenantUpgrade(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + ) + return &resource.TestCase{ + PreCheck: acc.PreCheckBasicSleep(t, nil, projectID, clusterName), + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + Config: acc.ConvertAdvancedClusterToSchemaV2(t, true, configTenant(projectID, clusterName)), + Check: checkTenant(projectID, clusterName), + }, + { + Config: acc.ConvertAdvancedClusterToSchemaV2(t, true, configTenantUpgraded(projectID, clusterName)), + Check: checksTenantUpgraded(projectID, clusterName), + }, + }, + } +} + +func configTenantUpgraded(projectID, name string) string { + return fmt.Sprintf(` + resource "mongodbatlas_advanced_cluster" "test" { + project_id = %[1]q + name = %[2]q + cluster_type = "REPLICASET" + + replication_specs { + region_configs { + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + electable_specs { + node_count = 3 + instance_size = "M10" + } + } + } + } + `, projectID, name) +} + +func enableChecksLatestTpf(checkMap map[string]string) map[string]string { + newMap := map[string]string{} + for k, v := range checkMap { + modifiedKey := strings.ReplaceAll(k, "electable_specs.0", "electable_specs") + newMap[modifiedKey] = v + } + return newMap +} + +func checksTenantUpgraded(projectID, name string) resource.TestCheckFunc { + originalChecks := checkTenant(projectID, name) + checks := []resource.TestCheckFunc{originalChecks} + checkMap := map[string]string{ + "replication_specs.0.region_configs.0.electable_specs.0.node_count": "3", + "replication_specs.0.region_configs.0.electable_specs.0.instance_size": "M10", + "replication_specs.0.region_configs.0.provider_name": "AWS", + } + if config.AdvancedClusterV2Schema() { + checkMap = enableChecksLatestTpf(checkMap) + } + checks = acc.AddAttrChecks(resourceName, checks, checkMap) + return resource.ComposeAggregateTestCheckFunc(originalChecks, resource.ComposeAggregateTestCheckFunc(checks...)) +} + +func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + fullUpdate = ` + backup_enabled = true + bi_connector_config = { + enabled = true + } + # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty + labels = [{ + key = "env" + value = "test" + }] + tags = [{ + key = "env" + value = "test" + }] + mongo_db_major_version = "8.0" + pit_enabled = true + redact_client_log_data = true + replica_set_scaling_strategy = "NODE_TYPE" + # retain_backups_enabled = true # only set on delete + root_cert_type = "ISRGROOTX1" + # termination_protection_enabled = true # must be reset to false to enable delete + version_release_system = "CONTINUOUS" + + advanced_configuration = { + change_stream_options_pre_and_post_images_expire_after_seconds = 100 + default_read_concern = "available" + default_write_concern = "majority" + javascript_enabled = true + minimum_enabled_tls_protocol = "TLS1_0" + no_table_scan = true + sample_refresh_interval_bi_connector = 310 + sample_size_bi_connector = 110 + transaction_lifetime_limit_seconds = 300 + } +` + // # oplog_min_retention_hours = 5.5 + // # oplog_size_mb = 1000 + // # fail_index_key_too_long = true # only valid for MongoDB version 4.4 and earlier + ) + return &resource.TestCase{ + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + Steps: []resource.TestStep{ + { + Config: configBasic(projectID, clusterName, ""), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "state_name", "IDLE"), + resource.TestCheckResourceAttr(resourceName, "timeouts.create", "2000s"), + resource.TestCheckResourceAttrSet(resourceName, "replication_specs.0.container_id.AWS:US_EAST_1"), + ), + }, + { + Config: configBasic(projectID, clusterName, fullUpdate), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "mongo_db_major_version", "8.0"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), + ), + }, + acc.TestStepImportCluster(resourceName), + }, + } +} + +func shardedBasic(t *testing.T) *resource.TestCase { + t.Helper() + var ( + projectID = acc.ProjectIDExecution(t) + clusterName = acc.RandomClusterName() + ) + return &resource.TestCase{ + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + Steps: []resource.TestStep{ + { + Config: configSharded(projectID, clusterName, false), + Check: resource.TestCheckResourceAttr(resourceName, "project_id", projectID), + }, + { + Config: configSharded(projectID, clusterName, true), + Check: resource.TestCheckResourceAttr(resourceName, "name", clusterName), + }, + acc.TestStepImportCluster(resourceName), + }, + } +} + +func configSharded(projectID, clusterName string, withUpdate bool) string { + var autoScaling, analyticsSpecs string + if withUpdate { + autoScaling = ` + auto_scaling = { + disk_gb_enabled = true + }` + analyticsSpecs = ` + analytics_specs = { + instance_size = "M30" + node_count = 1 + ebs_volume_type = "PROVISIONED" + disk_iops = 2000 + }` + } + // SDK v2 Implementation receives many warnings, one of them: `.replication_specs[1].region_configs[0].analytics_specs[0].disk_iops: was cty.NumberIntVal(2000), but now cty.NumberIntVal(1000)` + // Therefore, in TPF we are forced to set the value that will be returned by the API (1000) + // The rule is: For any replication spec, the `(analytics|electable|read_only)_spec.disk_iops` must be the same across all region_configs + // The API raises no errors, but the response reflects this rule + analyticsSpecsForSpec2 := strings.ReplaceAll(analyticsSpecs, "2000", "1000") + return fmt.Sprintf(` + resource "mongodbatlas_advanced_cluster" "test" { + project_id = %[1]q + name = %[2]q + cluster_type = "SHARDED" + + replication_specs = [ + { # shard 1 + region_configs = [{ + electable_specs = { + instance_size = "M30" + disk_iops = 2000 + node_count = 3 + ebs_volume_type = "PROVISIONED" + } + %[3]s + %[4]s + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }, + { # shard 2 + region_configs = [{ + electable_specs = { + instance_size = "M30" + ebs_volume_type = "PROVISIONED" + disk_iops = 1000 + node_count = 3 + } + %[3]s + %[5]s + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }] + } + `, projectID, clusterName, autoScaling, analyticsSpecs, analyticsSpecsForSpec2) +} diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant.yaml new file mode 100644 index 0000000000..91f8695dc6 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant.yaml @@ -0,0 +1,254 @@ +variables: + clusterName: test-acc-tf-c-8007704607206035161 + clusterName2: test-acc-tf-c-5804300588348578183 + groupId: 664619d870c247237f4b86a6 +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-8007704607206035161" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + electable_specs = { + instance_size = "M5" + } + provider_name = "TENANT" + backing_provider_name = "AWS" + region_name = "US_EAST_1" + priority = 7 + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d08\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d08\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-vl5rrda-shard-00-00.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-01.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-02.agmk4pq.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-nkw6vo-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-800770460.agmk4pq.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d08\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 3 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-vl5rrda-shard-00-00.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-01.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-02.agmk4pq.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-nkw6vo-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-800770460.agmk4pq.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d07\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 4 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 5 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-5804300588348578183" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + electable_specs = { + instance_size = "M5" + } + provider_name = "TENANT" + backing_provider_name = "AWS" + region_name = "US_EAST_1" + priority = 7 + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 14 + status: 202 + text: "{}" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName2}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 16 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9c\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 10 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-vl5rrda-shard-00-00.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-01.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-02.agmk4pq.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-nkw6vo-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-800770460.agmk4pq.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d08\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 15 + status: 404 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 11 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-vl5rrda-shard-00-00.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-01.agmk4pq.mongodb-dev.net:27017,ac-vl5rrda-shard-00-02.agmk4pq.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-nkw6vo-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-800770460.agmk4pq.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:51Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3babc353525f4cba8d0f\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3babc353525f4cba8d07\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3babc353525f4cba8d06\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 12 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 13 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 14 + status: 202 + text: "{}" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName2}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 16 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9c\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 17 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ftakg4l-shard-00-00.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-01.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-02.rnmedl5.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-eoqg8j-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-580430058.rnmedl5.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9c\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 18 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ftakg4l-shard-00-00.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-01.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-02.rnmedl5.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-eoqg8j-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-580430058.rnmedl5.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9b\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 19 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 20 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 29 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 25 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ftakg4l-shard-00-00.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-01.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-02.rnmedl5.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-eoqg8j-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-580430058.rnmedl5.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9c\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 30 + status: 404 + duplicate_responses: 1 + text: "{\n \"detail\": \"No cluster named {clusterName2} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName2}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 26 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ftakg4l-shard-00-00.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-01.rnmedl5.mongodb-dev.net:27017,ac-ftakg4l-shard-00-02.rnmedl5.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-eoqg8j-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-580430058.rnmedl5.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:04:03Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bf3a47ce54700c99fa1\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bf3a47ce54700c99f9b\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bf3a47ce54700c99f9a\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 27 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 28 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 29 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 89% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index aae97823e8..0700368579 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -1,7 +1,7 @@ { "clusterType": "REPLICASET", "labels": [], - "name": "test-acc-tf-c-91771214182147246", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/02_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/02_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 78% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index 678c9b1fe4..4fa3bcde20 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/02_02_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -1,15 +1,14 @@ { "clusterType": "REPLICASET", "labels": [], - "name": "test-acc-tf-c-91771214182147246", + "name": "{clusterName2}", "replicationSpecs": [ { "regionConfigs": [ { "backingProviderName": "AWS", "electableSpecs": { - "instanceSize": "M5", - "nodeCount": 0 + "instanceSize": "M5" }, "priority": 7, "providerName": "TENANT", diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName2}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName2}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName2}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_basicTenant/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName2}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml new file mode 100644 index 0000000000..f8b157a51d --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml @@ -0,0 +1,340 @@ +variables: + clusterName: test-acc-tf-c-1268086615384167156 + groupId: 664619d870c247237f4b86a6 +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + timeouts = { + create = "2000s" + } + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-1268086615384167156" + cluster_type = "REPLICASET" + replication_specs = [{ + region_configs = [{ + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + auto_scaling = { + compute_scale_down_enabled = false # necessary to have similar SDKv2 request + compute_enabled = false # necessary to have similar SDKv2 request + disk_gb_enabled = true + } + electable_specs = { + node_count = 3 + instance_size = "M10" + disk_size_gb = 10 + } + }] + }] + + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 16 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 19 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 20 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d17\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 21 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0be02d6b0330e14dc\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 22 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 23 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + timeouts = { + create = "2000s" + } + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-1268086615384167156" + cluster_type = "REPLICASET" + replication_specs = [{ + region_configs = [{ + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + auto_scaling = { + compute_scale_down_enabled = false # necessary to have similar SDKv2 request + compute_enabled = false # necessary to have similar SDKv2 request + disk_gb_enabled = true + } + electable_specs = { + node_count = 3 + instance_size = "M10" + disk_size_gb = 10 + } + }] + }] + + backup_enabled = true + bi_connector_config = { + enabled = true + } + # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty + labels = [{ + key = "env" + value = "test" + }] + tags = [{ + key = "env" + value = "test" + }] + mongo_db_major_version = "8.0" + pit_enabled = true + redact_client_log_data = true + replica_set_scaling_strategy = "NODE_TYPE" + # retain_backups_enabled = true # only set on delete + root_cert_type = "ISRGROOTX1" + # termination_protection_enabled = true # must be reset to false to enable delete + version_release_system = "CONTINUOUS" + + advanced_configuration = { + change_stream_options_pre_and_post_images_expire_after_seconds = 100 + default_read_concern = "available" + default_write_concern = "majority" + javascript_enabled = true + minimum_enabled_tls_protocol = "TLS1_0" + no_table_scan = true + sample_refresh_interval_bi_connector = 310 + sample_size_bi_connector = 110 + transaction_lifetime_limit_seconds = 300 + } + + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-10-23' + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + responses: + - response_index: 34 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: PATCH + version: '2024-08-05' + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" + responses: + - response_index: 41 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: PATCH + version: '2023-01-01' + text: "{\n \"defaultReadConcern\": \"available\"\n}" + responses: + - response_index: 42 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 29 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 35 + status: 200 + duplicate_responses: 4 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - response_index: 40 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - response_index: 43 + status: 200 + duplicate_responses: 3 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - response_index: 47 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 30 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d17\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 48 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d17\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 31 + status: 200 + duplicate_responses: 2 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0be02d6b0330e14dc\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 32 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - response_index: 53 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 33 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - response_index: 54 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-10-23' + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + responses: + - response_index: 34 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: PATCH + version: '2024-08-05' + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" + responses: + - response_index: 41 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: PATCH + version: '2023-01-01' + text: "{\n \"defaultReadConcern\": \"available\"\n}" + responses: + - response_index: 42 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 60 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 55 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - response_index: 61 + status: 200 + duplicate_responses: 5 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d18\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - response_index: 67 + status: 404 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 56 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://test-acc-tf-c-126808661-shard-00-00.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-01.jciib.mongodb-dev.net:27017,test-acc-tf-c-126808661-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-zwz5wz-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-126808661.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-14T08:02:52Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675d3bacc353525f4cba8d20\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"675d3bacc353525f4cba8d17\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675d3bacc353525f4cba8d16\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 57 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0be02d6b0330e14dc\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 58 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 59 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": 300\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 60 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 95% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index 2620d81aca..9c445eafcf 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -1,7 +1,7 @@ { "clusterType": "REPLICASET", "labels": [], - "name": "test", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json similarity index 91% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json index 2149b7dd55..f3b9f55a0a 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json @@ -10,7 +10,6 @@ "value": "test" } ], - "mongoDBMajorVersion": "8.0", "pitEnabled": true, "redactClientLogData": true, "replicaSetScalingStrategy": "NODE_TYPE", diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json new file mode 100644 index 0000000000..602856e979 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json @@ -0,0 +1,9 @@ +{ + "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": 100, + "defaultWriteConcern": "majority", + "minimumEnabledTlsProtocol": "TLS1_0", + "noTableScan": true, + "sampleRefreshIntervalBIConnector": 310, + "sampleSizeBIConnector": 110, + "transactionLifetimeLimitSeconds": 300 +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_03_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_03_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json new file mode 100644 index 0000000000..74c44cf2ce --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_03_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json @@ -0,0 +1,3 @@ +{ + "defaultReadConcern": "available" +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_04_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_04_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/06_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/06_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml new file mode 100644 index 0000000000..5c64075080 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml @@ -0,0 +1,303 @@ +variables: + clusterName: test-acc-tf-c-5896643684689749998 + groupId: 664619d870c247237f4b86a6 +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-5896643684689749998" + cluster_type = "SHARDED" + + replication_specs = [ + { # shard 1 + region_configs = [{ + electable_specs = { + instance_size = "M30" + disk_iops = 2000 + node_count = 3 + ebs_volume_type = "PROVISIONED" + } + + + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }, + { # shard 2 + region_configs = [{ + electable_specs = { + instance_size = "M30" + ebs_volume_type = "PROVISIONED" + disk_iops = 1000 + node_count = 3 + } + + + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 12 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 15 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 16 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskSizeGB\": 40,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5c\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 17 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-056e765ca927b9785\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0cb8137a17095e4f7\"\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 18 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 19 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-5896643684689749998" + cluster_type = "SHARDED" + + replication_specs = [ + { # shard 1 + region_configs = [{ + electable_specs = { + instance_size = "M30" + disk_iops = 2000 + node_count = 3 + ebs_volume_type = "PROVISIONED" + } + + auto_scaling = { + disk_gb_enabled = true + } + + analytics_specs = { + instance_size = "M30" + node_count = 1 + ebs_volume_type = "PROVISIONED" + disk_iops = 2000 + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }, + { # shard 2 + region_configs = [{ + electable_specs = { + instance_size = "M30" + ebs_volume_type = "PROVISIONED" + disk_iops = 1000 + node_count = 3 + } + + auto_scaling = { + disk_gb_enabled = true + } + + analytics_specs = { + instance_size = "M30" + node_count = 1 + ebs_volume_type = "PROVISIONED" + disk_iops = 1000 + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-08-05' + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 30 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 25 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 31 + status: 200 + duplicate_responses: 44 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 76 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-03.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-03.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 26 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskSizeGB\": 40,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5c\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 77 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-03.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-03.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskSizeGB\": 40,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5c\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 27 + status: 200 + duplicate_responses: 2 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-056e765ca927b9785\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0cb8137a17095e4f7\"\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 28 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 29 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-08-05' + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 30 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 89 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 84 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-03.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-03.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 90 + status: 200 + duplicate_responses: 4 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-03.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-03.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 95 + status: 404 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 85 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"EMBEDDED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-589664368-config-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-config-00-03.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-00.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-01.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-02.jciib.mongodb-dev.net:27016,test-acc-tf-c-589664368-shard-00-03.jciib.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-589664368.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:24Z\",\n \"diskSizeGB\": 40,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94c216ed3746c09fc8d\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5c\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 86 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-056e765ca927b9785\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0cb8137a17095e4f7\"\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 87 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 88 + status: 200 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 89 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 95% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index 9ea2b82c24..6d1e8b6208 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -1,7 +1,7 @@ { "clusterType": "SHARDED", "labels": [], - "name": "sharded-multi-replication", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json similarity index 89% rename from internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json index 6148eee5d3..b4bf9590df 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json @@ -1,7 +1,7 @@ { "replicationSpecs": [ { - "id": "673cd6d2fb19da739ae2d4a8", + "id": "675bf94c216ed3746c09fc5d", "regionConfigs": [ { "analyticsSpecs": { @@ -31,10 +31,11 @@ "regionName": "EU_WEST_1" } ], + "zoneId": "675bf94c216ed3746c09fc5b", "zoneName": "ZoneName managed by Terraform" }, { - "id": "673cd6d2fb19da739ae2d4aa", + "id": "675bf94c216ed3746c09fc5f", "regionConfigs": [ { "analyticsSpecs": { @@ -64,6 +65,7 @@ "regionName": "EU_WEST_1" } ], + "zoneId": "675bf94c216ed3746c09fc5b", "zoneName": "ZoneName managed by Terraform" } ] diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/03_01_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml new file mode 100644 index 0000000000..b5944cdc17 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml @@ -0,0 +1,350 @@ +variables: + clusterName: test-acc-tf-c-5441500136625649671 + groupId: 67587ca8240d1b0223213aaf +steps: + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 10 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups + method: POST + version: '2023-01-01' + text: "{\n \"clusterCount\": 0,\n \"created\": \"0001-01-01T00:00:00Z\",\n \"name\": \"test-acc-tf-p-7648043272615094485\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": [],\n \"withDefaultAlertsSettings\": true\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-12-10T17:38:49Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7648043272615094485\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/settings + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 2 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId}/settings + method: PATCH + version: '2023-01-01' + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + responses: + - response_index: 3 + status: 200 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId} + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 4 + status: 200 + text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-12-10T17:38:49Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7648043272615094485\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - response_index: 43 + status: 200 + text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-12-10T17:38:49Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7648043272615094485\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/teams + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 5 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId}/limits + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 6 + status: 200 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - response_index: 45 + status: 200 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 10,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - path: /api/atlas/v2/groups/{groupId}/ipAddresses + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 8 + status: 200 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": []\n }\n}" + - response_index: 47 + status: 200 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"52.213.148.59\",\n \"63.35.152.113\",\n \"52.209.113.218\",\n \"108.128.182.2\",\n \"20.186.58.189\",\n \"172.210.224.116\",\n \"52.49.34.25\",\n \"54.217.234.231\",\n \"54.216.203.84\",\n \"52.51.233.113\",\n \"20.186.59.130\",\n \"172.210.224.229\",\n \"34.255.253.74\",\n \"34.242.66.135\",\n \"20.186.59.168\"\n ],\n \"outbound\": [\n \"52.213.148.59\",\n \"63.35.152.113\",\n \"52.209.113.218\",\n \"108.128.182.2\",\n \"20.186.58.189\",\n \"172.210.224.116\",\n \"52.49.34.25\",\n \"54.217.234.231\",\n \"54.216.203.84\",\n \"52.51.233.113\",\n \"20.186.59.130\",\n \"172.210.224.229\",\n \"34.255.253.74\",\n \"34.242.66.135\",\n \"20.186.59.168\"\n ]\n }\n ]\n }\n}" + - path: /api/atlas/v2/groups/{groupId}/managedSlowMs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 9 + status: 200 + duplicate_responses: 1 + text: "true" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 10 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 11 + status: 200 + duplicate_responses: 25 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 37 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 38 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskSizeGB\": 8,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 39 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587cae27216120d54106f5\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-07b3948936164aa5e\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 40 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"67587cae27216120d54106f6\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_67587cae27216120d54106f6_a9tig9ed\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 51 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587cae27216120d54106f5\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-07b3948936164aa5e\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 52 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"67587cae27216120d54106f6\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_67587cae27216120d54106f6_a9tig9ed\"\n }\n ],\n \"totalCount\": 1\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 41 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 42 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2023-02-01' + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 67 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskSizeGB\": 8,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-10-23' + text: "{\n \"configServerManagementMode\": \"ATLAS_MANAGED\"\n}" + responses: + - response_index: 68 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 101 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId} + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 55 + status: 200 + duplicate_responses: 1 + text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-12-10T17:38:49Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7648043272615094485\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/teams + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 56 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId}/limits + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 57 + status: 200 + duplicate_responses: 1 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 10,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - path: /api/atlas/v2/groups/{groupId}/settings + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 58 + status: 200 + duplicate_responses: 1 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId}/ipAddresses + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 59 + status: 200 + duplicate_responses: 1 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"52.213.148.59\",\n \"63.35.152.113\",\n \"52.209.113.218\",\n \"108.128.182.2\",\n \"20.186.58.189\",\n \"172.210.224.116\",\n \"52.49.34.25\",\n \"54.217.234.231\",\n \"54.216.203.84\",\n \"52.51.233.113\",\n \"20.186.59.130\",\n \"172.210.224.229\",\n \"34.255.253.74\",\n \"34.242.66.135\",\n \"20.186.59.168\"\n ],\n \"outbound\": [\n \"52.213.148.59\",\n \"63.35.152.113\",\n \"52.209.113.218\",\n \"108.128.182.2\",\n \"20.186.58.189\",\n \"172.210.224.116\",\n \"52.49.34.25\",\n \"54.217.234.231\",\n \"54.216.203.84\",\n \"52.51.233.113\",\n \"20.186.59.130\",\n \"172.210.224.229\",\n \"34.255.253.74\",\n \"34.242.66.135\",\n \"20.186.59.168\"\n ]\n }\n ]\n }\n}" + - path: /api/atlas/v2/groups/{groupId}/managedSlowMs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 60 + status: 200 + duplicate_responses: 1 + text: "true" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 61 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 69 + status: 200 + duplicate_responses: 15 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 85 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 102 + status: 404 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - response_index: 105 + status: 404 + text: "{\n \"detail\": \"No group with ID {groupId} exists.\",\n \"error\": 404,\n \"errorCode\": \"GROUP_NOT_FOUND\",\n \"parameters\": [\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 62 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskSizeGB\": 8,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 86 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskSizeGB\": 8,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 63 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587cae27216120d54106f5\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-07b3948936164aa5e\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 64 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"67587cae27216120d54106f6\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_67587cae27216120d54106f6_a9tig9ed\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 87 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587cae27216120d54106f5\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-07b3948936164aa5e\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 88 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"67587cae27216120d54106f6\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_67587cae27216120d54106f6_a9tig9ed\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 97 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587cae27216120d54106f5\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-07b3948936164aa5e\"\n }\n ],\n \"totalCount\": 1\n}" + - response_index: 98 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AZURE\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"67587cae27216120d54106f6\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_67587cae27216120d54106f6_a9tig9ed\"\n }\n ],\n \"totalCount\": 1\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 65 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 66 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2023-02-01' + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 67 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskSizeGB\": 8,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-10-23' + text: "{\n \"configServerManagementMode\": \"ATLAS_MANAGED\"\n}" + responses: + - response_index: 68 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-544150013-shard-00-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-00-05.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-00.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-01.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-02.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-03.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-04.i49qe.mongodb-dev.net:27016,test-acc-tf-c-544150013-shard-01-05.i49qe.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-544150013.i49qe.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:54Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587cae27216120d54106f7\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e1\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587cae27216120d54106e3\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"67587cae27216120d54106df\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 101 + status: 202 + text: "{}" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 103 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true\\u0026includeDeletedWithRetainedBackups=false\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId} + method: DELETE + version: '2023-01-01' + text: "" + responses: + - response_index: 104 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 96% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index b7a0b7706f..27a1e0e343 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -3,7 +3,7 @@ "configServerManagementMode": "FIXED_TO_DEDICATED", "labels": [], "mongoDBMajorVersion": "8.0", - "name": "test-acc-tf-c-6025103075771235151", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 96% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index 356cf5676b..259fa0594d 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -1,7 +1,7 @@ { "replicationSpecs": [ { - "id": "6746cefbaef48d1cb2658ba6", + "id": "67587cae27216120d54106e0", "numShards": 2, "regionConfigs": [ { diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_03_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml new file mode 100644 index 0000000000..1eb5c71d27 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml @@ -0,0 +1,316 @@ +variables: + clusterName: test-acc-tf-c-2282852019288180857 + groupId: 67587c94240d1b0223213a32 +steps: + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"backupEnabled\": false,\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 10 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups + method: POST + version: '2023-01-01' + text: "{\n \"clusterCount\": 0,\n \"created\": \"0001-01-01T00:00:00Z\",\n \"name\": \"test-acc-tf-p-4471385080839781831\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": [],\n \"withDefaultAlertsSettings\": true\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-12-10T17:38:29Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4471385080839781831\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/settings + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 2 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId}/settings + method: PATCH + version: '2023-01-01' + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + responses: + - response_index: 3 + status: 200 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId} + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 4 + status: 200 + text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-12-10T17:38:29Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4471385080839781831\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - response_index: 39 + status: 200 + text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-12-10T17:38:29Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4471385080839781831\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/teams + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 5 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId}/limits + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 6 + status: 200 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - response_index: 41 + status: 200 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - path: /api/atlas/v2/groups/{groupId}/ipAddresses + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 8 + status: 200 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": []\n }\n}" + - response_index: 43 + status: 200 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"52.6.222.25\",\n \"35.174.188.9\",\n \"44.219.33.242\",\n \"35.172.15.68\",\n \"34.233.185.182\",\n \"34.197.45.207\",\n \"44.205.70.240\",\n \"18.205.167.89\",\n \"34.206.136.93\"\n ],\n \"outbound\": [\n \"52.6.222.25\",\n \"35.174.188.9\",\n \"44.219.33.242\",\n \"35.172.15.68\",\n \"34.233.185.182\",\n \"34.197.45.207\",\n \"44.205.70.240\",\n \"18.205.167.89\",\n \"34.206.136.93\"\n ]\n }\n ]\n }\n}" + - path: /api/atlas/v2/groups/{groupId}/managedSlowMs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 9 + status: 200 + duplicate_responses: 1 + text: "true" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"backupEnabled\": false,\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 10 + status: 201 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 11 + status: 200 + duplicate_responses: 22 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 34 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 35 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskSizeGB\": 50,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 36 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587c99240d1b0223213aaa\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0ace974e0bb8ac767\"\n }\n ],\n \"totalCount\": 1\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 37 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 38 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2023-02-01' + text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 61 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskSizeGB\": 55,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 82 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId} + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 50 + status: 200 + duplicate_responses: 1 + text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-12-10T17:38:29Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4471385080839781831\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" + - path: /api/atlas/v2/groups/{groupId}/teams + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 51 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId}/limits + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 52 + status: 200 + duplicate_responses: 1 + text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" + - path: /api/atlas/v2/groups/{groupId}/settings + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 53 + status: 200 + duplicate_responses: 1 + text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" + - path: /api/atlas/v2/groups/{groupId}/ipAddresses + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 54 + status: 200 + duplicate_responses: 1 + text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"52.6.222.25\",\n \"35.174.188.9\",\n \"44.219.33.242\",\n \"35.172.15.68\",\n \"34.233.185.182\",\n \"34.197.45.207\",\n \"44.205.70.240\",\n \"18.205.167.89\",\n \"34.206.136.93\"\n ],\n \"outbound\": [\n \"52.6.222.25\",\n \"35.174.188.9\",\n \"44.219.33.242\",\n \"35.172.15.68\",\n \"34.233.185.182\",\n \"34.197.45.207\",\n \"44.205.70.240\",\n \"18.205.167.89\",\n \"34.206.136.93\"\n ]\n }\n ]\n }\n}" + - path: /api/atlas/v2/groups/{groupId}/managedSlowMs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 55 + status: 200 + duplicate_responses: 1 + text: "true" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 56 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 62 + status: 200 + duplicate_responses: 5 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 68 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 83 + status: 200 + duplicate_responses: 4 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a96\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"67587c99240d1b0223213a98\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 88 + status: 404 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - response_index: 91 + status: 404 + text: "{\n \"detail\": \"No group with ID {groupId} exists.\",\n \"error\": 404,\n \"errorCode\": \"GROUP_NOT_FOUND\",\n \"parameters\": [\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 57 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskSizeGB\": 50,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 69 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskSizeGB\": 55,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 58 + status: 200 + duplicate_responses: 2 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"67587c99240d1b0223213aaa\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0ace974e0bb8ac767\"\n }\n ],\n \"totalCount\": 1\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 59 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 60 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2023-02-01' + text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + responses: + - response_index: 61 + status: 200 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-228285201-shard-00-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-00-02.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-00.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-01.vxwqk.mongodb-dev.net:27016,test-acc-tf-c-228285201-shard-01-02.vxwqk.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-228285201.vxwqk.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-10T17:38:34Z\",\n \"diskSizeGB\": 55,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67587c9a240d1b0223213aab\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67587c99240d1b0223213a94\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 82 + status: 202 + text: "{}" + - path: /api/atlas/v2/groups/{groupId}/clusters + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 89 + status: 200 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true\\u0026includeDeletedWithRetainedBackups=false\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" + - path: /api/atlas/v2/groups/{groupId} + method: DELETE + version: '2023-01-01' + text: "" + responses: + - response_index: 90 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 96% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index 8a4993c06c..426c48c469 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -3,7 +3,7 @@ "clusterType": "SHARDED", "labels": [], "mongoDBMajorVersion": "7.0", - "name": "6746cee8aef48d1cb265882d", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_02_PATCH__api_atlas_v2_groups_{groupId}_settings_2023-01-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_02_PATCH__api_atlas_v2_groups_{groupId}_settings_2023-01-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_02_PATCH__api_atlas_v2_groups_{groupId}_settings_2023-01-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_02_PATCH__api_atlas_v2_groups_{groupId}_settings_2023-01-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_03_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_03_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_03_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_03_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 94% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index a3f212eb22..c748fd2f07 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01_manual.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -2,7 +2,7 @@ "diskSizeGB": 55, "replicationSpecs": [ { - "id": "6746ceeeaef48d1cb26589ea", + "id": "67587c99240d1b0223213a95", "numShards": 2, "regionConfigs": [ { diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade.yaml new file mode 100644 index 0000000000..92c7ff99f5 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade.yaml @@ -0,0 +1,202 @@ +variables: + clusterName: test-acc-tf-c-6727593058295022052 + groupId: 664619d870c247237f4b86a6 +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-6727593058295022052" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + electable_specs = { + instance_size = "M5" + } + provider_name = "TENANT" + backing_provider_name = "AWS" + region_name = "US_EAST_1" + priority = 7 + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 2 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 3 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca0\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 4 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 5 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "664619d870c247237f4b86a6" + name = "test-acc-tf-c-6727593058295022052" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + electable_specs = { + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade + method: POST + version: '2023-01-01' + text: "{\n \"name\": \"{clusterName}\",\n \"providerSettings\": {\n \"instanceSizeName\": \"M10\",\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n}" + responses: + - response_index: 14 + status: 200 + text: "{\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGBEnabled\": false\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"mongoURI\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017\",\n \"mongoURIUpdated\": \"2024-12-13T09:07:43Z\",\n \"mongoURIWithOptions\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"name\": \"{clusterName}\",\n \"numShards\": 1,\n \"paused\": false,\n \"pitEnabled\": false,\n \"providerBackupEnabled\": false,\n \"providerSettings\": {\n \"autoScaling\": {\n \"compute\": {\n \"maxInstanceSize\": null,\n \"minInstanceSize\": null\n }\n },\n \"backingProviderName\": \"AWS\",\n \"effectiveInstanceSizeName\": \"M5\",\n \"instanceSizeName\": \"M5\",\n \"nextBackupDate\": \"2024-12-14T09:07:27Z\",\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\",\n \"tenantBackupEnabled\": true\n },\n \"replicationFactor\": 3,\n \"replicationSpec\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca0\",\n \"numShards\": 1,\n \"regionsConfig\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"srvAddress\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 90 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 10 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 15 + status: 200 + duplicate_responses: 8 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 24 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca1\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 25 + status: 200 + duplicate_responses: 36 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-13T09:08:07Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf977216ed3746c09fcf3\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf977216ed3746c09fcf2\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf977216ed3746c09fcf1\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 62 + status: 200 + duplicate_responses: 19 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:08:07Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf977216ed3746c09fcf3\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf977216ed3746c09fcf2\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf977216ed3746c09fcf1\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 82 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:08:07Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf977216ed3746c09fcf3\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf977216ed3746c09fcf2\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf977216ed3746c09fcf1\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 91 + status: 200 + duplicate_responses: 2 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:08:07Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf977216ed3746c09fcf3\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf977216ed3746c09fcf2\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf977216ed3746c09fcf1\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 94 + status: 404 + duplicate_responses: 1 + text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 11 + status: 200 + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca0\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf94f216ed3746c09fc9f\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 83 + status: 200 + duplicate_responses: 1 + text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:08:07Z\",\n \"diskSizeGB\": 10,\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf977216ed3746c09fcf3\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"675bf977216ed3746c09fce9\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"675bf977216ed3746c09fcf1\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 12 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 13 + status: 200 + duplicate_responses: 1 + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade + method: POST + version: '2023-01-01' + text: "{\n \"name\": \"{clusterName}\",\n \"providerSettings\": {\n \"instanceSizeName\": \"M10\",\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n}" + responses: + - response_index: 14 + status: 200 + text: "{\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGBEnabled\": false\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-13T09:07:27Z\",\n \"diskSizeGB\": 5,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"675bf94f216ed3746c09fca6\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.4\",\n \"mongoURI\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017\",\n \"mongoURIUpdated\": \"2024-12-13T09:07:43Z\",\n \"mongoURIWithOptions\": \"mongodb://ac-um2obry-shard-00-00.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-01.dsp6h7u.mongodb-dev.net:27017,ac-um2obry-shard-00-02.dsp6h7u.mongodb-dev.net:27017/?ssl=true\\u0026authSource=admin\\u0026replicaSet=atlas-9aswzw-shard-0\",\n \"name\": \"{clusterName}\",\n \"numShards\": 1,\n \"paused\": false,\n \"pitEnabled\": false,\n \"providerBackupEnabled\": false,\n \"providerSettings\": {\n \"autoScaling\": {\n \"compute\": {\n \"maxInstanceSize\": null,\n \"minInstanceSize\": null\n }\n },\n \"backingProviderName\": \"AWS\",\n \"effectiveInstanceSizeName\": \"M5\",\n \"instanceSizeName\": \"M5\",\n \"nextBackupDate\": \"2024-12-14T09:07:27Z\",\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\",\n \"tenantBackupEnabled\": true\n },\n \"replicationFactor\": 3,\n \"replicationSpec\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94f216ed3746c09fca0\",\n \"numShards\": 1,\n \"regionsConfig\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"srvAddress\": \"mongodb+srv://test-acc-tf-c-672759305.dsp6h7u.mongodb-dev.net\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 84 + status: 200 + duplicate_responses: 1 + text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\\u0026providerName=AWS\\u0026pageNum=1\\u0026itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-056e765ca927b9785\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"675bf94c216ed3746c09fc88\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0cb8137a17095e4f7\"\n }\n ],\n \"totalCount\": 2\n}" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 90 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json similarity index 88% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json index 71905d7b89..0700368579 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json @@ -1,7 +1,7 @@ { "clusterType": "REPLICASET", "labels": [], - "name": "test-acc-tf-c-878317177498266511", + "name": "{clusterName}", "replicationSpecs": [ { "regionConfigs": [ diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json similarity index 71% rename from internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json index a3ce19b271..acbb57bd94 100644 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_01_POST__api_atlas_v2_groups_{groupId}_clusters_tenantUpgrade_2023-01-01.json @@ -1,5 +1,5 @@ { - "name": "test-acc-tf-c-878317177498266511", + "name": "{clusterName}", "providerSettings": { "instanceSizeName": "M10", "providerName": "AWS", diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_tenantUpgrade/02_02_DELETE__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded.yaml b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded.yaml deleted file mode 100644 index a3c5b28e53..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded.yaml +++ /dev/null @@ -1,216 +0,0 @@ -step_count: 3 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 8 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 10 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskSizeGB\": 40.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a7\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 11 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0375d5f3c074577a0\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-096b0b372bff6116c\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 3 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 13 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 14 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 1 -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-08-05' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 27 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 21 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 28 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 19 - - response_index: 48 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-03.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-03.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 22 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskSizeGB\": 40.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a7\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 50 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-03.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-03.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskSizeGB\": 40.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a7\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 23 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0375d5f3c074577a0\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-096b0b372bff6116c\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 1 - - response_index: 51 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": null\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-096b0b372bff6116c\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 3 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 25 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 26 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-08-05' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 27 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 68 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 61 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-03.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-03.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - response_index: 69 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-03.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-03.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a8\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"673cd6d2fb19da739ae2d4aa\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40.0,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 76 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 63 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://sharded-multi-replicati-shard-00-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-00-03.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-00.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-01.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-02.jciib.mongodb-dev.net:27016,sharded-multi-replicati-shard-01-03.jciib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://sharded-multi-replicati.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-19T18:20:02Z\",\n \"diskSizeGB\": 40.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673cd6d2fb19da739ae2d4bc\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673cd6d2fb19da739ae2d4a7\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"673cd6d2fb19da739ae2d4a6\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 64 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": null\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-096b0b372bff6116c\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 66 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 67 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 68 - status: 202 - text: '{}' -variables: - groupId: 664619d870c247237f4b86a6 - clusterName: sharded-multi-replication diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05_manual.json b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05_manual.json deleted file mode 100644 index 7506fd4ef6..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_configSharded/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05_manual.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "replicationSpecs": [ - { - "id": "673cd6d2fb19da739ae2d4a8", - "regionConfigs": [ - { - "analyticsSpecs": { - "diskIOPS": 2000, - "ebsVolumeType": "PROVISIONED", - "instanceSize": "M30", - "nodeCount": 1 - }, - "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, - "diskGB": { - "enabled": true - } - }, - "electableSpecs": { - "diskIOPS": 2000, - "diskSizeGB": 40, - "ebsVolumeType": "PROVISIONED", - "instanceSize": "M30", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "EU_WEST_1" - } - ], - "zoneId": "673cd6d2fb19da739ae2d4a6", - "zoneName": "ZoneName managed by Terraform" - }, - { - "id": "673cd6d2fb19da739ae2d4aa", - "regionConfigs": [ - { - "analyticsSpecs": { - "diskIOPS": 1000, - "ebsVolumeType": "PROVISIONED", - "instanceSize": "M30", - "nodeCount": 1 - }, - "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, - "diskGB": { - "enabled": true - } - }, - "electableSpecs": { - "diskIOPS": 1000, - "diskSizeGB": 40, - "ebsVolumeType": "PROVISIONED", - "instanceSize": "M30", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "EU_WEST_1" - } - ], - "zoneId": "673cd6d2fb19da739ae2d4a6", - "zoneName": "ZoneName managed by Terraform" - } - ] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset.yaml b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset.yaml deleted file mode 100644 index 089310b5d0..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset.yaml +++ /dev/null @@ -1,431 +0,0 @@ -step_count: 6 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 12 - - response_index: 14 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 16 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 17 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 18 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 19 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 -- diff_requests: [] - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 25 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 26 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 27 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 28 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 29 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - responses: - - response_index: 40 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"paused\": true\n}" - responses: - - response_index: 47 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 35 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 41 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 4 - - response_index: 46 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - response_index: 48 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"REPAIRING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 3 - - response_index: 52 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 36 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 54 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 37 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 38 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - - response_index: 56 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 39 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - - response_index: 57 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - responses: - - response_index: 40 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"paused\": true\n}" - responses: - - response_index: 47 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"paused\": false\n}" - responses: - - response_index: 68 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 63 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - response_index: 69 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"REPAIRING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 8 - - response_index: 78 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 64 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": true,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - response_index: 80 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 65 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 66 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 67 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"paused\": false\n}" - responses: - - response_index: 68 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: PATCH - version: '2024-08-05' - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"javascriptEnabled\": true\n}" - responses: - - response_index: 94 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: PATCH - version: '2024-08-05' - text: "{\n \"javascriptEnabled\": true\n}" - responses: - - response_index: 94 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 89 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 90 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 91 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 92 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - response_index: 95 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 93 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": false,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 - - response_index: 96 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - duplicate_responses: 1 -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 105 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 99 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 1 - - response_index: 106 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - duplicate_responses: 6 - - response_index: 113 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 101 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://{clusterName}-shard-00-00.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-01.jciib.mongodb-dev.net:27017,{clusterName}-shard-00-02.jciib.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-h20vfw-shard-0\",\n \"standardSrv\": \"mongodb+srv://{clusterName}.jciib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-20T10:41:51Z\",\n \"diskSizeGB\": 10.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673dbcef6b13675d681b3fcf\",\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"replicationSpecs\": [\n {\n \"id\": \"673dbcef6b13675d681b3fc6\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673dbcef6b13675d681b3fc5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"{clusterName}\"\n }\n ],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 102 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67345bd9905b8c30c54fd220\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-04f360947fe6956c1\"\n },\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"673cb9d90e17de7b126a6751\",\n \"providerName\": \"AWS\",\n \"provisioned\": false,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": null\n }\n ],\n \"totalCount\": 2\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 103 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": \"available\",\n \"defaultWriteConcern\": \"majority\",\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 104 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"oplogMinRetentionHours\": 0.0,\n \"oplogSizeMB\": 1000,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 105 - status: 202 - text: '{}' -variables: - groupId: 664619d870c247237f4b86a6 - clusterName: test diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json deleted file mode 100644 index 54e0e21edd..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/03_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "paused": true -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/04_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/04_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json deleted file mode 100644 index 78c40e9687..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/04_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "paused": false -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/05_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/05_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json deleted file mode 100644 index ea39aa862e..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockAdvancedCluster_replicaset/05_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": 100, - "javascriptEnabled": true -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema.yaml b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema.yaml deleted file mode 100644 index cd38497596..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema.yaml +++ /dev/null @@ -1,371 +0,0 @@ -step_count: 2 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 9 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups - method: POST - version: '2023-01-01' - text: "{\n \"clusterCount\": 0,\n \"created\": \"0001-01-01T00:00:00Z\",\n \"name\": \"test-acc-tf-p-7889034782442569766\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": [],\n \"withDefaultAlertsSettings\": true\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-11-27T07:49:10Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7889034782442569766\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - path: /api/atlas/v2/groups/{groupId}/settings - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/settings - method: PATCH - version: '2023-01-01' - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - responses: - - response_index: 2 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - - path: /api/atlas/v2/groups/{groupId} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 3 - status: 200 - text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-11-27T07:49:10Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7889034782442569766\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - response_index: 56 - status: 200 - text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-11-27T07:49:10Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7889034782442569766\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - path: /api/atlas/v2/groups/{groupId}/teams - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 4 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/limits - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 5 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - - response_index: 58 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 10,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - - path: /api/atlas/v2/groups/{groupId}/ipAddresses - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 7 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": []\n }\n}" - - response_index: 60 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"34.246.188.184\",\n \"52.209.244.62\",\n \"99.80.110.196\",\n \"52.31.136.123\",\n \"48.211.168.65\",\n \"20.14.220.66\",\n \"52.50.165.92\",\n \"54.75.58.195\",\n \"54.75.145.38\",\n \"54.72.45.73\",\n \"48.211.168.194\",\n \"20.14.220.107\",\n \"63.33.141.215\",\n \"52.208.19.70\",\n \"48.211.169.27\"\n ],\n \"outbound\": [\n \"34.246.188.184\",\n \"52.209.244.62\",\n \"99.80.110.196\",\n \"52.31.136.123\",\n \"48.211.168.65\",\n \"20.14.220.66\",\n \"52.50.165.92\",\n \"54.75.58.195\",\n \"54.75.145.38\",\n \"54.72.45.73\",\n \"48.211.168.194\",\n \"20.14.220.107\",\n \"63.33.141.215\",\n \"52.208.19.70\",\n \"48.211.169.27\"\n ]\n }\n ]\n }\n}" - - path: /api/atlas/v2/groups/{groupId}/managedSlowMs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 8 - status: 200 - text: 'true' - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 9 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 10 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 13 - - response_index: 24 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 25 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 27 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746cefbaef48d1cb2658bbc\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0dd32328690ba0813\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 7 - - response_index: 28 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AZURE&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"6746cefbaef48d1cb2658bbb\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_6746cefbaef48d1cb2658bbb_ykngkrlx\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 7 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 29 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 6 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 30 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 7 - - response_index: 34 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 32 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 33 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2023-02-01' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 92 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"configServerManagementMode\": \"ATLAS_MANAGED\"\n}" - responses: - - response_index: 93 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 174 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 80 - status: 200 - text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-11-27T07:49:10Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-7889034782442569766\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/teams - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 81 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/limits - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 82 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 10,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/settings - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 83 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/ipAddresses - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 84 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"34.246.188.184\",\n \"52.209.244.62\",\n \"99.80.110.196\",\n \"52.31.136.123\",\n \"48.211.168.65\",\n \"20.14.220.66\",\n \"52.50.165.92\",\n \"54.75.58.195\",\n \"54.75.145.38\",\n \"54.72.45.73\",\n \"48.211.168.194\",\n \"20.14.220.107\",\n \"63.33.141.215\",\n \"52.208.19.70\",\n \"48.211.169.27\"\n ],\n \"outbound\": [\n \"34.246.188.184\",\n \"52.209.244.62\",\n \"99.80.110.196\",\n \"52.31.136.123\",\n \"48.211.168.65\",\n \"20.14.220.66\",\n \"52.50.165.92\",\n \"54.75.58.195\",\n \"54.75.145.38\",\n \"54.72.45.73\",\n \"48.211.168.194\",\n \"20.14.220.107\",\n \"63.33.141.215\",\n \"52.208.19.70\",\n \"48.211.169.27\"\n ]\n }\n ]\n }\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/managedSlowMs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 85 - status: 200 - text: 'true' - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 86 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 119 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 87 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 94 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 23 - - response_index: 118 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 9 - - response_index: 175 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 9 - - response_index: 185 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 88 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AZURE&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746cefbaef48d1cb2658bbc\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0dd32328690ba0813\"\n }, {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"6746cefbaef48d1cb2658bbb\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_6746cefbaef48d1cb2658bbb_ykngkrlx\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 8 - - response_index: 89 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AZURE&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746cefbaef48d1cb2658bbc\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"EU_WEST_1\",\n \"vpcId\": \"vpc-0dd32328690ba0813\"\n }, {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"azureSubscriptionId\": \"591236d43d098d433845860f\",\n \"id\": \"6746cefbaef48d1cb2658bbb\",\n \"providerName\": \"AZURE\",\n \"provisioned\": true,\n \"region\": \"US_EAST_2\",\n \"vnetName\": \"vnet_6746cefbaef48d1cb2658bbb_ykngkrlx\"\n }\n ],\n \"totalCount\": 2\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 90 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 91 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2023-02-01' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 92 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2024-10-23' - text: "{\n \"configServerManagementMode\": \"ATLAS_MANAGED\"\n}" - responses: - - response_index: 93 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba7\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746cefbaef48d1cb2658ba9\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 8.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskSizeGB\": 8.0,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 125 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-602510307-shard-00-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-00-05.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-00.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-01.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-02.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-03.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-04.d2nwr.mongodb-dev.net:27016,test-acc-tf-c-602510307-shard-01-05.d2nwr.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-602510307.d2nwr.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:15Z\",\n \"diskSizeGB\": 8.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746cefbaef48d1cb2658bbd\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746cefbaef48d1cb2658ba6\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3500,\n \"diskThroughput\": 125,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneId\": \"6746cefbaef48d1cb2658ba5\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 174 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 186 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - - response_index: 188 - status: 404 - text: "{\n \"detail\": \"No group with ID {groupId} exists.\",\n \"error\": 404,\n \"errorCode\": \"GROUP_NOT_FOUND\",\n \"parameters\": [\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId} - method: DELETE - version: '2023-01-01' - text: '' - responses: - - response_index: 187 - status: 202 - text: '{}' -variables: - groupId: 6746cef5aef48d1cb2658a7f - clusterName: test-acc-tf-c-6025103075771235151 diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json deleted file mode 100644 index 3cf5db54d3..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "replicationSpecs": [ - { - "id": "6746cefbaef48d1cb2658ba6", - "numShards": 2, - "regionConfigs": [ - { - "analyticsSpecs": { - "diskIOPS": 3000, - "instanceSize": "M20", - "nodeCount": 1 - }, - "electableSpecs": { - "diskIOPS": 3000, - "instanceSize": "M10", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "EU_WEST_1" - }, - { - "electableSpecs": { - "diskIOPS": 3500, - "instanceSize": "M10", - "nodeCount": 2 - }, - "priority": 6, - "providerName": "AZURE", - "regionName": "US_EAST_2" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml deleted file mode 100644 index 52c3812567..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml +++ /dev/null @@ -1,318 +0,0 @@ -step_count: 2 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 9 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups - method: POST - version: '2023-01-01' - text: "{\n \"clusterCount\": 0,\n \"created\": \"0001-01-01T00:00:00Z\",\n \"name\": \"test-acc-tf-p-4311574251574843475\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": [],\n \"withDefaultAlertsSettings\": true\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-11-27T07:48:58Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4311574251574843475\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - path: /api/atlas/v2/groups/{groupId}/settings - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/settings - method: PATCH - version: '2023-01-01' - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - responses: - - response_index: 2 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - - path: /api/atlas/v2/groups/{groupId} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 3 - status: 200 - text: "{\n \"clusterCount\": 0,\n \"created\": \"2024-11-27T07:48:58Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4311574251574843475\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - response_index: 40 - status: 200 - text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-11-27T07:48:58Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4311574251574843475\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - - path: /api/atlas/v2/groups/{groupId}/teams - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 4 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/limits - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 5 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - - response_index: 42 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - - path: /api/atlas/v2/groups/{groupId}/ipAddresses - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 7 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": []\n }\n}" - - response_index: 44 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"3.231.192.60\",\n \"54.174.182.121\",\n \"54.162.241.21\",\n \"35.168.217.111\",\n \"34.206.28.101\",\n \"54.175.35.15\",\n \"54.144.51.160\",\n \"98.84.253.100\",\n \"54.221.230.85\"\n ],\n \"outbound\": [\n \"3.231.192.60\",\n \"54.174.182.121\",\n \"54.162.241.21\",\n \"35.168.217.111\",\n \"34.206.28.101\",\n \"54.175.35.15\",\n \"54.144.51.160\",\n \"98.84.253.100\",\n \"54.221.230.85\"\n ]\n }\n ]\n }\n}" - - path: /api/atlas/v2/groups/{groupId}/managedSlowMs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 8 - status: 200 - text: 'true' - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 9 - status: 201 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 10 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 12 - - response_index: 23 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 24 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskSizeGB\": 50.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 26 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746ceeeaef48d1cb2658a15\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0740d97a9534f73e5\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 27 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 28 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 4 -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2023-02-01' - text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 67 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskSizeGB\": 55.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 108 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 56 - status: 200 - text: "{\n \"clusterCount\": 1,\n \"created\": \"2024-11-27T07:48:58Z\",\n \"id\": \"{groupId}\",\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers\",\n \"rel\": \"https://cloud.mongodb.com/containers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters\",\n \"rel\": \"https://cloud.mongodb.com/clusters\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers\",\n \"rel\": \"https://cloud.mongodb.com/databaseUsers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/peers\",\n \"rel\": \"https://cloud.mongodb.com/peers\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/processes\",\n \"rel\": \"https://cloud.mongodb.com/processes\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/whitelist\",\n \"rel\": \"https://cloud.mongodb.com/whitelist\"\n }\n ],\n \"name\": \"test-acc-tf-p-4311574251574843475\",\n \"orgId\": \"65def6ce0f722a1507105aa5\",\n \"tags\": []\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/teams - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 57 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/teams?includeCount=true&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/limits - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 58 - status: 200 - text: "[\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 900,\n \"name\": \"atlas.project.security.databaseAccess.users\",\n \"value\": 100\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 25,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.clusters\",\n \"value\": 25\n },\n {\n \"currentUsage\": 1,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.serverlessMTMs\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 1400,\n \"name\": \"atlas.project.security.databaseAccess.customRoles\",\n \"value\": 100\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 200,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.entries\",\n \"value\": 200\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 40,\n \"maximumLimit\": 220,\n \"name\": \"atlas.project.security.networkAccess.crossRegionEntries\",\n \"value\": 40\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 50,\n \"maximumLimit\": 90,\n \"name\": \"atlas.project.deployment.nodesPerPrivateLinkRegion\",\n \"value\": 50\n },\n {\n \"defaultLimit\": 50,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsPerRegionGroup\",\n \"value\": 6\n },\n {\n \"defaultLimit\": 27,\n \"maximumLimit\": 27,\n \"name\": \"atlas.project.deployment.privateServiceConnectionsSubnetMask\",\n \"value\": 27\n },\n {\n \"currentUsage\": 0,\n \"defaultLimit\": 100,\n \"maximumLimit\": 100,\n \"name\": \"atlas.project.deployment.salesSoldM0s\",\n \"value\": 100\n }\n]" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/settings - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 59 - status: 200 - text: "{\n \"isCollectDatabaseSpecificsStatisticsEnabled\": true,\n \"isDataExplorerEnabled\": true,\n \"isExtendedStorageSizesEnabled\": false,\n \"isPerformanceAdvisorEnabled\": true,\n \"isRealtimePerformancePanelEnabled\": true,\n \"isSchemaAdvisorEnabled\": true\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/ipAddresses - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 60 - status: 200 - text: "{\n \"groupId\": \"{groupId}\",\n \"services\": {\n \"clusters\": [\n {\n \"clusterName\": \"{clusterName}\",\n \"inbound\": [\n \"3.231.192.60\",\n \"54.174.182.121\",\n \"54.162.241.21\",\n \"35.168.217.111\",\n \"34.206.28.101\",\n \"54.175.35.15\",\n \"54.144.51.160\",\n \"98.84.253.100\",\n \"54.221.230.85\"\n ],\n \"outbound\": [\n \"3.231.192.60\",\n \"54.174.182.121\",\n \"54.162.241.21\",\n \"35.168.217.111\",\n \"34.206.28.101\",\n \"54.175.35.15\",\n \"54.144.51.160\",\n \"98.84.253.100\",\n \"54.221.230.85\"\n ]\n }\n ]\n }\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/managedSlowMs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 61 - status: 200 - text: 'true' - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 62 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskSizeGB\": 50.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 76 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskSizeGB\": 55.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 63 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 50.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 68 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 75 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 109 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"7.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589eb\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"6746ceeeaef48d1cb26589ed\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 55.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 116 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 64 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"6746ceeeaef48d1cb2658a15\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0740d97a9534f73e5\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 5 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 65 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 5 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 66 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": null,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 5 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: PATCH - version: '2023-02-01' - text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" - responses: - - response_index: 67 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-461133128-shard-00-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-00-02.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-00.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-01.7r2ib.mongodb-dev.net:27016,test-acc-tf-c-461133128-shard-01-02.7r2ib.mongodb-dev.net:27016/?ssl=true&authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-461133128.7r2ib.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-27T07:49:02Z\",\n \"diskSizeGB\": 55.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"6746ceeeaef48d1cb2658a1a\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"7.0\",\n \"mongoDBVersion\": \"7.0.15\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"6746ceeeaef48d1cb26589ea\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"6746ceeeaef48d1cb26589e9\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 108 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 117 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - - response_index: 119 - status: 404 - text: "{\n \"detail\": \"No group with ID {groupId} exists.\",\n \"error\": 404,\n \"errorCode\": \"GROUP_NOT_FOUND\",\n \"parameters\": [\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId} - method: DELETE - version: '2023-01-01' - text: '' - responses: - - response_index: 118 - status: 202 - text: '{}' -variables: - groupId: 6746cee8aef48d1cb265882d - clusterName: test-acc-tf-c-4611331288451668238 diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json deleted file mode 100644 index 0a396b72b3..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "clusterType": "SHARDED", - "labels": [], - "mongoDBMajorVersion": "7.0", - "name": "6746cee8aef48d1cb265882d", - "replicationSpecs": [ - { - "regionConfigs": [ - { - "analyticsSpecs": { - "diskSizeGB": 50, - "instanceSize": "M10", - "nodeCount": 0 - }, - "electableSpecs": { - "diskSizeGB": 50, - "instanceSize": "M10", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - }, - { - "regionConfigs": [ - { - "analyticsSpecs": { - "diskSizeGB": 50, - "instanceSize": "M10", - "nodeCount": 0 - }, - "electableSpecs": { - "diskSizeGB": 50, - "instanceSize": "M10", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ], - "tags": [] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json deleted file mode 100644 index 2f268bd6b7..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "diskSizeGB": 55, - "replicationSpecs": [ - { - "id": "6746ceeeaef48d1cb26589ea", - "numShards": 2, - "regionConfigs": [ - { - "analyticsSpecs": { - "diskIOPS": 3000, - "instanceSize": "M10", - "nodeCount": 0 - }, - "electableSpecs": { - "diskIOPS": 3000, - "instanceSize": "M10", - "nodeCount": 3 - }, - "priority": 7, - "providerName": "AWS", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant.yaml b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant.yaml deleted file mode 100644 index 2f2d65840b..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant.yaml +++ /dev/null @@ -1,286 +0,0 @@ -step_count: 3 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e424\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e424\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e424\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 8 - - response_index: 34 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 3 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e423\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 3 - - response_index: 16 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e423\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 4 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 7 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 5 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 6 - - response_index: 33 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e424\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 6 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e423\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 1 - - response_index: 15 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e423\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 39 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName2}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 41 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b3\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 35 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e424\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 40 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 36 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-uuhgbda-shard-00-00.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-01.jadffef.mongodb-dev.net:27017,ac-uuhgbda-shard-00-02.jadffef.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-o3cq7y-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-917712141.jadffef.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T07:56:25Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee7a92d375c3a36e8e429\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee7a92d375c3a36e8e423\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee7a92d375c3a36e8e422\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 37 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 38 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 39 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName2}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 41 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b3\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 42 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b3\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 44 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 3 - - response_index: 69 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 45 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 6 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 46 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 7 - - response_index: 49 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b3\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 47 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 1 - - response_index: 68 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 50 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 89 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 76 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b3\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 3 - - response_index: 90 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName2} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName2}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 78 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 79 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 80 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 81 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-guyvosp-shard-00-00.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-01.qnrmzgh.mongodb-dev.net:27017,ac-guyvosp-shard-00-02.qnrmzgh.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-12rjya-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-804993041.qnrmzgh.mongodb-dev.net\"\n },\n \"createDate\": \"2024-11-21T08:00:44Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"673ee8ac2d375c3a36e8e4b9\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName2}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName2}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"673ee8ac2d375c3a36e8e4b2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"673ee8ac2d375c3a36e8e4b1\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName2} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 89 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 91 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/?pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [],\n \"totalCount\": 0\n}" - duplicate_responses: 1 -variables: - groupId: 664619d870c247237f4b86a6 - clusterName: test-acc-tf-c-91771214182147246 - clusterName2: test-acc-tf-c-8049930413007488732 diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json deleted file mode 100644 index dbc668f294..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "clusterType": "REPLICASET", - "labels": [], - "name": "test-acc-tf-c-8049930413007488732", - "replicationSpecs": [ - { - "regionConfigs": [ - { - "backingProviderName": "AWS", - "electableSpecs": { - "instanceSize": "M5", - "nodeCount": 0 - }, - "priority": 7, - "providerName": "TENANT", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ], - "tags": [] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json deleted file mode 100644 index ca09d36805..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_basicTenant/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23_manual.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "clusterType": "REPLICASET", - "labels": [], - "name": "test-acc-tf-c-8049930413007488732", - "replicationSpecs": [ - { - "regionConfigs": [ - { - "backingProviderName": "AWS", - "electableSpecs": { - "instanceSize": "M5" - }, - "priority": 7, - "providerName": "TENANT", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ], - "tags": [] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade.yaml b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade.yaml deleted file mode 100644 index 39fd92c8c8..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade.yaml +++ /dev/null @@ -1,186 +0,0 @@ -step_count: 2 -steps: -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b42\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters - method: POST - version: '2024-10-23' - text: "{\n \"clusterType\": \"REPLICASET\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"instanceSize\": \"M5\",\n \"nodeCount\": 0\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" - responses: - - response_index: 0 - status: 201 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b42\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 1 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b42\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 8 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 3 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b41\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 4 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 4 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 6 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 5 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 7 - - response_index: 8 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b42\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 6 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?includeCount=true&includeDeletedWithRetainedBackups=false&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b41\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n }\n ],\n \"totalCount\": 1\n}" - duplicate_responses: 2 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 9 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" -- diff_requests: - - path: /api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade - method: POST - version: '2023-01-01' - text: "{\n \"name\": \"{clusterName}\",\n \"providerSettings\": {\n \"instanceSizeName\": \"M10\",\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n}" - responses: - - response_index: 39 - status: 200 - text: "{\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGBEnabled\": false\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"mongoURI\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017\",\n \"mongoURIUpdated\": \"2024-12-03T16:54:43Z\",\n \"mongoURIWithOptions\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"name\": \"{clusterName}\",\n \"numShards\": 1,\n \"paused\": false,\n \"pitEnabled\": false,\n \"providerBackupEnabled\": false,\n \"providerSettings\": {\n \"autoScaling\": {\n \"compute\": {\n \"maxInstanceSize\": null,\n \"minInstanceSize\": null\n }\n },\n \"backingProviderName\": \"AWS\",\n \"effectiveInstanceSizeName\": \"M5\",\n \"instanceSizeName\": \"M5\",\n \"nextBackupDate\": \"2024-12-04T16:54:26Z\",\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\",\n \"tenantBackupEnabled\": true\n },\n \"replicationFactor\": 3,\n \"replicationSpec\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b41\",\n \"numShards\": 1,\n \"regionsConfig\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"srvAddress\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 76 - status: 202 - text: '{}' - request_responses: - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 35 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b42\",\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"diskSizeGB\": 5.0,\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 40 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {},\n \"createDate\": \"2024-12-03T16:57:44Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f388843ca6e2ab9803e84\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f388843ca6e2ab9803e83\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f388843ca6e2ab9803e82\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 26 - - response_index: 67 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:57:44Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f388843ca6e2ab9803e84\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f388843ca6e2ab9803e83\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f388843ca6e2ab9803e82\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 1 - - response_index: 69 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:57:44Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f388843ca6e2ab9803e84\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f388843ca6e2ab9803e83\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f388843ca6e2ab9803e82\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 2 - - response_index: 77 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:57:44Z\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f388843ca6e2ab9803e84\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f388843ca6e2ab9803e83\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10.0,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f388843ca6e2ab9803e82\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - duplicate_responses: 6 - - response_index: 84 - status: 404 - text: "{\n \"detail\": \"No cluster named {clusterName} exists in group {groupId}.\",\n \"error\": 404,\n \"errorCode\": \"CLUSTER_NOT_FOUND\",\n \"parameters\": [\n \"{clusterName}\",\n \"{groupId}\"\n ],\n \"reason\": \"Not Found\"\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: GET - version: '2023-02-01' - text: '' - responses: - - response_index: 36 - status: 200 - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b41\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"backingProviderName\": \"AWS\",\n \"electableSpecs\": {\n \"effectiveInstanceSize\": \"M5\",\n \"instanceSize\": \"M5\"\n },\n \"priority\": 7,\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f37c288864967c85f6b40\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - response_index: 71 - status: 200 - text: "{\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:57:44Z\",\n \"diskSizeGB\": 10.0,\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f388843ca6e2ab9803e84\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"674f388843ca6e2ab9803e79\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"674f388843ca6e2ab9803e82\",\n \"zoneName\": \"Zone 1\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 37 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultReadConcern\": null,\n \"defaultWriteConcern\": null,\n \"failIndexKeyTooLong\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs - method: GET - version: '2024-08-05' - text: '' - responses: - - response_index: 38 - status: 200 - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": null,\n \"chunkMigrationConcurrency\": null,\n \"customOpensslCipherConfigTls12\": [],\n \"defaultMaxTimeMS\": null,\n \"defaultWriteConcern\": null,\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"noTableScan\": false,\n \"oplogMinRetentionHours\": null,\n \"oplogSizeMB\": null,\n \"queryStatsLogVerbosity\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" - duplicate_responses: 1 - - path: /api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade - method: POST - version: '2023-01-01' - text: "{\n \"name\": \"{clusterName}\",\n \"providerSettings\": {\n \"instanceSizeName\": \"M10\",\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n}" - responses: - - response_index: 39 - status: 200 - text: "{\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGBEnabled\": false\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"REPLICASET\",\n \"connectionStrings\": {\n \"standard\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\"\n },\n \"createDate\": \"2024-12-03T16:54:26Z\",\n \"diskSizeGB\": 5.0,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"674f37c288864967c85f6b47\",\n \"labels\": [],\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}\",\n \"rel\": \"self\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs\",\n \"rel\": \"https://cloud.mongodb.com/restoreJobs\"\n },\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots\",\n \"rel\": \"https://cloud.mongodb.com/snapshots\"\n }\n ],\n \"mongoDBMajorVersion\": \"8.0\",\n \"mongoDBVersion\": \"8.0.3\",\n \"mongoURI\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017\",\n \"mongoURIUpdated\": \"2024-12-03T16:54:43Z\",\n \"mongoURIWithOptions\": \"mongodb://ac-ks9snsv-shard-00-00.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-01.jsgqjpo.mongodb-dev.net:27017,ac-ks9snsv-shard-00-02.jsgqjpo.mongodb-dev.net:27017/?ssl=true&authSource=admin&replicaSet=atlas-bm8qep-shard-0\",\n \"name\": \"{clusterName}\",\n \"numShards\": 1,\n \"paused\": false,\n \"pitEnabled\": false,\n \"providerBackupEnabled\": false,\n \"providerSettings\": {\n \"autoScaling\": {\n \"compute\": {\n \"maxInstanceSize\": null,\n \"minInstanceSize\": null\n }\n },\n \"backingProviderName\": \"AWS\",\n \"effectiveInstanceSizeName\": \"M5\",\n \"instanceSizeName\": \"M5\",\n \"nextBackupDate\": \"2024-12-04T16:54:26Z\",\n \"providerName\": \"TENANT\",\n \"regionName\": \"US_EAST_1\",\n \"tenantBackupEnabled\": true\n },\n \"replicationFactor\": 3,\n \"replicationSpec\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"replicationSpecs\": [\n {\n \"id\": \"674f37c288864967c85f6b41\",\n \"numShards\": 1,\n \"regionsConfig\": {\n \"US_EAST_1\": {\n \"analyticsNodes\": 0,\n \"electableNodes\": 3,\n \"priority\": 7,\n \"readOnlyNodes\": 0\n }\n },\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"srvAddress\": \"mongodb+srv://test-acc-tf-c-878317177.jsgqjpo.mongodb-dev.net\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" - - path: /api/atlas/v2/groups/{groupId}/containers - method: GET - version: '2023-01-01' - text: '' - responses: - - response_index: 72 - status: 200 - text: "{\n \"links\": [\n {\n \"href\": \"https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true&providerName=AWS&pageNum=1&itemsPerPage=100\",\n \"rel\": \"self\"\n }\n ],\n \"results\": [\n {\n \"atlasCidrBlock\": \"192.168.248.0/21\",\n \"id\": \"674f388843ca6e2ab9803e89\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0a59ad5152645bea7\"\n }\n ],\n \"totalCount\": 1\n}" - - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} - method: DELETE - version: '2023-02-01' - text: '' - responses: - - response_index: 76 - status: 202 - text: '{}' - - path: /api/atlas/v2/groups/{groupId} - method: DELETE - version: '2023-01-01' - text: '' - responses: - - response_index: 86 - status: 202 - text: '{}' -variables: - groupId: 674f37b888864967c85f6ad7 - clusterName: test-acc-tf-c-878317177498266511 diff --git a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json deleted file mode 100644 index 6778b1311a..0000000000 --- a/internal/service/advancedclustertpf/testdata/TestMockClusterAdvancedCluster_tenantUpgrade/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "clusterType": "REPLICASET", - "labels": [], - "name": "test-acc-tf-c-878317177498266511", - "replicationSpecs": [ - { - "regionConfigs": [ - { - "backingProviderName": "AWS", - "electableSpecs": { - "instanceSize": "M5", - "nodeCount": 0 - }, - "priority": 7, - "providerName": "TENANT", - "regionName": "US_EAST_1" - } - ], - "zoneName": "ZoneName managed by Terraform" - } - ], - "tags": [] -} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/validate_schema.go b/internal/service/advancedclustertpf/validate_schema.go index 71cf4abdd7..18b9e9a50e 100644 --- a/internal/service/advancedclustertpf/validate_schema.go +++ b/internal/service/advancedclustertpf/validate_schema.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -82,3 +83,25 @@ func performValidation(ctx context.Context, state *tfsdk.State, plan *tfsdk.Plan diags.AddError(fmt.Sprintf("`%s` %s", validationPath, v.Description(ctx)), "") } } + +type RegionSpecPriorityOrderDecreasingValidator struct{} + +func (v RegionSpecPriorityOrderDecreasingValidator) Description(ctx context.Context) string { + return v.MarkdownDescription(ctx) +} +func (v RegionSpecPriorityOrderDecreasingValidator) MarkdownDescription(_ context.Context) string { + return "must be a list with priority in descending order" +} +func (v RegionSpecPriorityOrderDecreasingValidator) ValidateList(ctx context.Context, req validator.ListRequest, resp *validator.ListResponse) { + diags := &resp.Diagnostics + regionConfigs := newCloudRegionConfig20240805(ctx, req.ConfigValue, diags) + if diags.HasError() { + return + } + configs := *regionConfigs + for i := range len(configs) - 1 { + if configs[i].GetPriority() < configs[i+1].GetPriority() { + diags.AddError("priority values in region_configs must be in descending order", fmt.Sprintf("priority value at index %d is %d and priority value at index %d is %d", i, configs[i].GetPriority(), i+1, configs[i+1].GetPriority())) + } + } +} diff --git a/internal/testutil/unit/http_mocker_config_capture_test.go b/internal/testutil/unit/http_mocker_config_capture_test.go index 68e58e43a6..93c0f260f7 100644 --- a/internal/testutil/unit/http_mocker_config_capture_test.go +++ b/internal/testutil/unit/http_mocker_config_capture_test.go @@ -3,7 +3,11 @@ package unit_test import ( _ "embed" "net/http" + "os" + "path" + "path/filepath" "regexp" + "strings" "testing" "github.com/jarcoal/httpmock" @@ -11,6 +15,7 @@ import ( "github.com/sebdah/goldie/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" ) var ( @@ -93,3 +98,30 @@ func TestCaptureMockConfigClientModifier_clusterExample(t *testing.T) { require.NoError(t, err) g.Assert(t, t.Name(), []byte(configYaml)) } + +func Reformat(t *testing.T, filePath string) string { + t.Helper() + data, err := unit.ParseTestDataConfigYAML(filePath) + require.NoError(t, err) + initialYaml := strings.Builder{} + e := yaml.NewEncoder(&initialYaml) + e.SetIndent(1) + err = e.Encode(data) + require.NoError(t, err) + return initialYaml.String() +} + +// Manual test used to test reformatting of all yaml files in the testdata directory +func TestReformatConfigs(t *testing.T) { + testDataPath := os.Getenv("TEST_DATA_PATH") + if testDataPath == "" { + t.Skip("TEST_DATA_PATH is not set") + } + matches, err := filepath.Glob(path.Join(testDataPath, "*.yaml")) + require.NoError(t, err) + for _, p := range matches { + formatted := Reformat(t, p) + err = os.WriteFile(p, []byte(formatted), 0o600) + require.NoError(t, err) + } +} diff --git a/internal/testutil/unit/http_mocker_data.go b/internal/testutil/unit/http_mocker_data.go index b21a54cbb2..0899a3bfb6 100644 --- a/internal/testutil/unit/http_mocker_data.go +++ b/internal/testutil/unit/http_mocker_data.go @@ -140,12 +140,13 @@ func (i *RequestInfo) Match(t *testing.T, method, version string, reqURL *url.UR type Literal string func (l Literal) MarshalYAML() (any, error) { - if l == "" { + trimmed := strings.Trim(string(l), "\n ") + if trimmed == "" { return "", nil } return &yaml.Node{ Kind: yaml.ScalarNode, - Value: strings.ReplaceAll(string(l), "\n \n", "\n\n"), + Value: strings.ReplaceAll(trimmed, "\n \n", "\n\n"), Style: yaml.LiteralStyle, Tag: "!!str", }, nil diff --git a/internal/testutil/unit/http_mocker_data_test.go b/internal/testutil/unit/http_mocker_data_test.go index d9f521a410..bab58ea148 100644 --- a/internal/testutil/unit/http_mocker_data_test.go +++ b/internal/testutil/unit/http_mocker_data_test.go @@ -63,7 +63,7 @@ var expectedDump = `variables: {} steps: - diff_requests: [] request_responses: [] - - config: |2+ + - config: |- data "mongodbatlas_advanced_cluster" "test" { project_id = mongodbatlas_advanced_cluster.test.project_id name = mongodbatlas_advanced_cluster.test.name @@ -73,7 +73,6 @@ steps: project_id = mongodbatlas_advanced_cluster.test.project_id use_replication_spec_per_shard = true } - diff_requests: [] request_responses: [] ` From b59c241cce8f5cdd15ca268ecbbe53ac2f7fc67d Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Sat, 14 Dec 2024 12:03:57 +0000 Subject: [PATCH 05/40] chore: Supports legacy API in create when using old schema with num_shards (#2892) * chore: Add support for legacy cluster creation API in createCluster function * chore: Update create in legacy test to use the 08-05 API version --- internal/service/advancedclustertpf/resource.go | 8 +++++++- ...MockableAdvancedCluster_symmetricShardedOldSchema.yaml | 4 ++-- ...pi_atlas_v2_groups_{groupId}_clusters_2024-08-05.json} | 0 ...mmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml | 4 ++-- ...pi_atlas_v2_groups_{groupId}_clusters_2024-08-05.json} | 0 5 files changed, 11 insertions(+), 5 deletions(-) rename internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/{01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json => 01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json} (100%) rename internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/{01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json => 01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json} (100%) diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 3e92d1af58..3874df57cc 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -182,6 +182,7 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn var ( projectID = plan.ProjectID.ValueString() clusterName = plan.Name.ValueString() + api20240805 = r.Client.AtlasV220240805.ClustersApi api20240530 = r.Client.AtlasV220240530.ClustersApi api = r.Client.AtlasV2.ClustersApi err error @@ -190,7 +191,12 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn if pauseAfter { latestReq.Paused = nil } - _, _, err = api.CreateCluster(ctx, projectID, latestReq).Execute() + if usingLegacySchema(ctx, plan.ReplicationSpecs, diags) { + legacyReq := newLegacyModel(latestReq) + _, _, err = api20240805.CreateCluster(ctx, projectID, legacyReq).Execute() + } else { + _, _, err = api.CreateCluster(ctx, projectID, latestReq).Execute() + } if err != nil { diags.AddError("errorCreate", fmt.Sprintf(errorCreate, err.Error())) return nil diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml index b5944cdc17..589d709dde 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml @@ -5,7 +5,7 @@ steps: - diff_requests: - path: /api/atlas/v2/groups/{groupId}/clusters method: POST - version: '2024-10-23' + version: '2024-08-05' text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" responses: - response_index: 10 @@ -90,7 +90,7 @@ steps: text: "true" - path: /api/atlas/v2/groups/{groupId}/clusters method: POST - version: '2024-10-23' + version: '2024-08-05' text: "{\n \"clusterType\": \"SHARDED\",\n \"configServerManagementMode\": \"FIXED_TO_DEDICATED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"8.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" responses: - response_index: 10 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml index 1eb5c71d27..23f1c5a4de 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml @@ -5,7 +5,7 @@ steps: - diff_requests: - path: /api/atlas/v2/groups/{groupId}/clusters method: POST - version: '2024-10-23' + version: '2024-08-05' text: "{\n \"backupEnabled\": false,\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" responses: - response_index: 10 @@ -90,7 +90,7 @@ steps: text: "true" - path: /api/atlas/v2/groups/{groupId}/clusters method: POST - version: '2024-10-23' + version: '2024-08-05' text: "{\n \"backupEnabled\": false,\n \"clusterType\": \"SHARDED\",\n \"labels\": [],\n \"mongoDBMajorVersion\": \"7.0\",\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 50,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ],\n \"tags\": []\n}" responses: - response_index: 10 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json similarity index 100% rename from internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-10-23.json rename to internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/01_01_POST__api_atlas_v2_groups_{groupId}_clusters_2024-08-05.json From afcac0f418e144d1037f698b4cf42fa8cd6fffd4 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sun, 15 Dec 2024 10:46:47 +0100 Subject: [PATCH 06/40] chore: Implements Read in TPF data source (#2865) * enable data source test checks * ds model * same Read impl for singular ds as resource Read * Read in plural ds * use conversion.CopyModel to reduce duplicated code * check out is not nil * remove unneeded funcs * pluralModel * overrideUsingLegacySchema * fix condition to use legacy schema * remove use of config.AdvancedClusterV2Schema in tests * fix pinned_fcv * revert test changes * refactor ds to use readClustersDS and readClusterDS * enable ds test checks * refactor plural ds to use ListClusters info * leftover comment * revert temporarily overrideUsingLegacySchema * split convertClusterAddAdvConfig into getBasicClusterModel and updateModelAdvancedConfig * pagination comment in ListClusters * check if use_replication_spec_per_shard should be added in ds * bring changes from master in resource.go * CopyModel tests * have resource and datasource models together, renaming resource_schema files to schema * rename AsymmetricShardUnsupportedError to AsymmetricShardUnsupported * use AllPages * wait in applyAdvancedConfigurationChanges * await after every update * don't include accept_data_risks_and_force_replica_set_reconfig in ds * move ds schemas together with resource one * wait to apply adv_config changes in Create * leftover * skip TestAccClusterAdvancedClusterConfig_asymmetricShardedNewSchema * leftover --- .golangci.yml | 2 +- .../common/conversion/model_generation.go | 41 +++++++ .../conversion/model_generation_test.go | 92 ++++++++++++++ .../resource_advanced_cluster_test.go | 2 + .../service/advancedclustertpf/data_source.go | 66 +++++++--- .../model_ClusterDescription20240805.go | 1 + .../advancedclustertpf/plural_data_source.go | 81 +++++++++--- .../service/advancedclustertpf/resource.go | 115 +++++++++++------- .../resource_compatibility_reuse.go | 15 +-- .../resource_compatiblity.go | 9 +- .../{resource_schema.go => schema.go} | 79 +++++++++++- ...resource_schema_test.go => schema_test.go} | 0 .../acc/advanced_cluster_schema_v2.go | 46 ++----- 13 files changed, 425 insertions(+), 124 deletions(-) create mode 100644 internal/common/conversion/model_generation.go create mode 100644 internal/common/conversion/model_generation_test.go rename internal/service/advancedclustertpf/{resource_schema.go => schema.go} (91%) rename internal/service/advancedclustertpf/{resource_schema_test.go => schema_test.go} (100%) diff --git a/.golangci.yml b/.golangci.yml index 83b0802fad..bc730e75ee 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -123,7 +123,7 @@ issues: - linters: - gocritic text: "^hugeParam: req is heavy" - - path: "_schema\\.go" # exclude rules for schema files as it's auto-genereated from OpenAPI spec + - path: "schema\\.go" # exclude rules for schema files as it's auto-genereated from OpenAPI spec text: "fieldalignment|hugeParam|var-naming|ST1003|S1007|exceeds the maximum|too long|regexpSimplify|nolint" run: timeout: 10m diff --git a/internal/common/conversion/model_generation.go b/internal/common/conversion/model_generation.go new file mode 100644 index 0000000000..f44c75624b --- /dev/null +++ b/internal/common/conversion/model_generation.go @@ -0,0 +1,41 @@ +package conversion + +import ( + "fmt" + "reflect" +) + +// CopyModel creates a new struct with the same values as the source struct. Fields in destination struct that are not in source are left with zero value. +func CopyModel[T any](src any) (*T, error) { + dest := new(T) + valSrc := reflect.ValueOf(src) + valDest := reflect.ValueOf(dest) + if valSrc.Kind() != reflect.Ptr || valDest.Kind() != reflect.Ptr { + return nil, fmt.Errorf("params must be pointers") + } + valSrc = valSrc.Elem() + valDest = valDest.Elem() + if valSrc.Kind() != reflect.Struct || valDest.Kind() != reflect.Struct { + return nil, fmt.Errorf("params must be pointers to structs") + } + typeSrc := valSrc.Type() + typeDest := valDest.Type() + for i := 0; i < typeDest.NumField(); i++ { + fieldDest := typeDest.Field(i) + name := fieldDest.Name + { + fieldSrc, found := typeSrc.FieldByName(name) + if !found { + continue + } + if fieldDest.Type != fieldSrc.Type { + return nil, fmt.Errorf("field has different type: %s", name) + } + } + if !valDest.Field(i).CanSet() { + return nil, fmt.Errorf("field can't be set, probably unexported: %s", name) + } + valDest.Field(i).Set(valSrc.FieldByName(name)) + } + return dest, nil +} diff --git a/internal/common/conversion/model_generation_test.go b/internal/common/conversion/model_generation_test.go new file mode 100644 index 0000000000..ea18d83d4e --- /dev/null +++ b/internal/common/conversion/model_generation_test.go @@ -0,0 +1,92 @@ +package conversion_test + +import ( + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCopyModel(t *testing.T) { + type destType struct { + AttrStr string + attrUnexported string + AttrInt int + } + + testCases := map[string]struct { + input any + expected any + expectedErrorStr string + }{ + "basic": { + input: &struct { + AttrStr string + AttrInt int + }{ + AttrStr: "val", + AttrInt: 1, + }, + expected: &destType{ + AttrStr: "val", + AttrInt: 1, + attrUnexported: "", + }, + }, + "missing field": { + input: &struct { + AttrStr string + }{ + AttrStr: "val", + }, + expected: &destType{ + AttrStr: "val", + }, + }, + "extra field": { + input: &struct { + AttrStr string + AttrExtra string + AttrInt int + }{ + AttrStr: "val", + AttrExtra: "extra", + AttrInt: 1, + }, + expected: &destType{ + AttrStr: "val", + AttrInt: 1, + }, + }, + "different type": { + input: &struct { + AttrStr bool + }{ + AttrStr: true, + }, + expectedErrorStr: "field has different type: AttrStr", + }, + "unexported": { + input: &struct { + attrUnexported string + }{ + attrUnexported: "val", + }, + expectedErrorStr: "field can't be set, probably unexported: attrUnexported", + }, + } + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + dest, err := conversion.CopyModel[destType](tc.input) + if err == nil { + assert.Equal(t, tc.expected, dest) + assert.Equal(t, "", tc.expectedErrorStr) + } else { + require.ErrorContains(t, err, tc.expectedErrorStr) + assert.Nil(t, dest) + assert.Nil(t, tc.expected) + } + }) + } +} diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 5cf47fc748..d68ea5e23f 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -706,6 +706,8 @@ func TestAccClusterAdvancedClusterConfig_symmetricShardedNewSchemaToAsymmetricAd } func TestAccClusterAdvancedClusterConfig_asymmetricShardedNewSchema(t *testing.T) { + // TODO: enable when datasource attribute use_replication_spec_per_shard is used + acc.SkipIfAdvancedClusterV2Schema(t) resource.ParallelTest(t, asymmetricShardedNewSchemaTestCase(t, true)) } diff --git a/internal/service/advancedclustertpf/data_source.go b/internal/service/advancedclustertpf/data_source.go index 0bb0905091..b95aff557c 100644 --- a/internal/service/advancedclustertpf/data_source.go +++ b/internal/service/advancedclustertpf/data_source.go @@ -2,12 +2,13 @@ package advancedclustertpf import ( "context" + "fmt" "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/datasource/schema" - "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + "go.mongodb.org/atlas-sdk/v20241113003/admin" ) var _ datasource.DataSource = &ds{} @@ -26,22 +27,57 @@ type ds struct { } func (d *ds) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { - resp.Schema = conversion.DataSourceSchemaFromResource(ResourceSchema(ctx), &conversion.DataSourceSchemaRequest{ - RequiredFields: []string{"project_id", "name"}, - OverridenFields: map[string]schema.Attribute{ - "use_replication_spec_per_shard": schema.BoolAttribute{ // TODO: added as in current resource - Optional: true, - MarkdownDescription: "use_replication_spec_per_shard", // TODO: add documentation - }, - }, - }) + resp.Schema = dataSourceSchema(ctx) } func (d *ds) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var state TFModelDS + diags := &resp.Diagnostics + diags.Append(req.Config.Get(ctx, &state)...) + if diags.HasError() { + return + } + model := d.readCluster(ctx, diags, &state) + if model != nil { + diags.Append(resp.State.Set(ctx, model)...) + } } -// TODO: see if resource model can be used instead, probably different only in timeouts -type ModelDS struct { - ProjectID types.String `tfsdk:"project_id"` - Name types.String `tfsdk:"name"` +func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS *TFModelDS) *TFModelDS { + clusterName := modelDS.Name.ValueString() + projectID := modelDS.ProjectID.ValueString() + useReplicationSpecPerShard := modelDS.UseReplicationSpecPerShard.ValueBool() + api := d.Client.AtlasV2.ClustersApi + clusterResp, _, err := api.GetCluster(ctx, projectID, clusterName).Execute() + if err != nil { + if admin.IsErrorCode(err, ErrorCodeClusterNotFound) { + return nil + } + diags.AddError("errorRead", fmt.Sprintf(errorRead, clusterName, err.Error())) + return nil + } + modelIn := &TFModel{ + ProjectID: modelDS.ProjectID, + Name: modelDS.Name, + } + // TODO: pass !UseReplicationSpecPerShard to overrideUsingLegacySchema + modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn) + if diags.HasError() { + return nil + } + if extraInfo.AsymmetricShardUnsupported && !useReplicationSpecPerShard { + diags.AddError("errorRead", "Please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details.") + return nil + } + updateModelAdvancedConfig(ctx, diags, d.Client, modelOut, nil, nil) + if diags.HasError() { + return nil + } + modelOutDS, err := conversion.CopyModel[TFModelDS](modelOut) + if err != nil { + diags.AddError(errorRead, fmt.Sprintf("error setting model: %s", err.Error())) + return nil + } + modelOutDS.UseReplicationSpecPerShard = modelDS.UseReplicationSpecPerShard // attrs not in resource model + return modelOutDS } diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index 8df35183b4..f77a7dfbc5 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -25,6 +25,7 @@ type ExtraAPIInfo struct { RootDiskSize *float64 ContainerIDs map[string]string UsingLegacySchema bool + AsymmetricShardUnsupported bool } func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, timeout timeouts.Value, diags *diag.Diagnostics, apiInfo ExtraAPIInfo) *TFModel { diff --git a/internal/service/advancedclustertpf/plural_data_source.go b/internal/service/advancedclustertpf/plural_data_source.go index 5da1ba424f..6c8178345c 100644 --- a/internal/service/advancedclustertpf/plural_data_source.go +++ b/internal/service/advancedclustertpf/plural_data_source.go @@ -3,12 +3,15 @@ package advancedclustertpf import ( "context" "fmt" + "net/http" "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/dsschema" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + "go.mongodb.org/atlas-sdk/v20241113003/admin" ) var _ datasource.DataSource = &pluralDS{} @@ -27,26 +30,68 @@ type pluralDS struct { } func (d *pluralDS) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { - resp.Schema = conversion.PluralDataSourceSchemaFromResource(ResourceSchema(ctx), &conversion.PluralDataSourceSchemaRequest{ - RequiredFields: []string{"project_id"}, - OverridenRootFields: map[string]schema.Attribute{ - "use_replication_spec_per_shard": schema.BoolAttribute{ // TODO: added as in current resource - Optional: true, - MarkdownDescription: "use_replication_spec_per_shard", // TODO: add documentation - }, - "include_deleted_with_retained_backups": schema.BoolAttribute{ // TODO: not in current resource, decide if keep - Optional: true, - MarkdownDescription: "Flag that indicates whether to return Clusters with retain backups.", - }, - }, - }) + resp.Schema = pluralDataSourceSchema(ctx) } func (d *pluralDS) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var state TFModelPluralDS + diags := &resp.Diagnostics + diags.Append(req.Config.Get(ctx, &state)...) + if diags.HasError() { + return + } + model := d.readClusters(ctx, diags, &state) + if model != nil { + diags.Append(resp.State.Set(ctx, model)...) + } } -type AdvancedClustersModel struct { - ProjectID types.String `tfsdk:"project_id"` - UseReplicationSpecPerShard types.Bool `tfsdk:"use_replication_spec_per_shard"` // TODO: added as in current resource - IncludeDeletedWithRetainedBackups types.Bool `tfsdk:"include_deleted_with_retained_backups"` // TODO: not in current resource, decide if keep +func (d *pluralDS) readClusters(ctx context.Context, diags *diag.Diagnostics, pluralModel *TFModelPluralDS) *TFModelPluralDS { + projectID := pluralModel.ProjectID.ValueString() + useReplicationSpecPerShard := pluralModel.UseReplicationSpecPerShard.ValueBool() + api := d.Client.AtlasV2.ClustersApi + params := admin.ListClustersApiParams{ + GroupId: projectID, + } + list, err := dsschema.AllPages(ctx, func(ctx context.Context, pageNum int) (dsschema.PaginateResponse[admin.ClusterDescription20240805], *http.Response, error) { + request := api.ListClustersWithParams(ctx, ¶ms) + request = request.PageNum(pageNum) + return request.Execute() + }) + if err != nil { + diags.AddError("errorList", fmt.Sprintf(errorList, projectID, err.Error())) + return nil + } + outs := &TFModelPluralDS{ + ProjectID: pluralModel.ProjectID, + UseReplicationSpecPerShard: pluralModel.UseReplicationSpecPerShard, + IncludeDeletedWithRetainedBackups: pluralModel.IncludeDeletedWithRetainedBackups, + } + for i := range list { + clusterResp := &list[i] + modelIn := &TFModel{ + ProjectID: pluralModel.ProjectID, + Name: types.StringValue(clusterResp.GetName()), + } + // TODO: pass !UseReplicationSpecPerShard to overrideUsingLegacySchema + modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn) + if diags.HasError() { + return nil + } + if extraInfo.AsymmetricShardUnsupported && !useReplicationSpecPerShard { + continue + } + updateModelAdvancedConfig(ctx, diags, d.Client, modelOut, nil, nil) + if diags.HasError() { + return nil + } + modelOutDS, err := conversion.CopyModel[TFModelDS](modelOut) + if err != nil { + diags.AddError(errorList, fmt.Sprintf("error setting model: %s", err.Error())) + return nil + } + modelOutDS.UseReplicationSpecPerShard = pluralModel.UseReplicationSpecPerShard // attrs not in resource model + outs.Results = append(outs.Results, modelOutDS) + } + return outs } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 3874df57cc..265705ab90 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/update" @@ -29,6 +28,7 @@ const ( errorRead = "error reading advanced cluster (%s): %s" errorDelete = "error deleting advanced cluster (%s): %s" errorUpdate = "error updating advanced cluster (%s): %s" + errorList = "error reading advanced cluster list for project %s: %s" errorConfigUpdate = "error updating advanced cluster configuration options (%s): %s" errorConfigRead = "error reading advanced cluster configuration options (%s): %s" ErrorClusterSetting = "error setting `%s` for MongoDB Cluster (%s): %s" @@ -64,7 +64,7 @@ type rs struct { } func (r *rs) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = ResourceSchema(ctx) + resp.Schema = resourceSchema(ctx) conversion.UpdateSchemaDescription(&resp.Schema) } @@ -88,7 +88,7 @@ func (r *rs) Read(ctx context.Context, req resource.ReadRequest, resp *resource. if diags.HasError() { return } - model := r.readCluster(ctx, &state, &resp.State, diags, true) + model := r.readCluster(ctx, diags, &state, &resp.State) if model != nil { diags.Append(resp.State.Set(ctx, model)...) } @@ -113,13 +113,13 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou diags.AddError("errorPatchPayload", err.Error()) return } - var cluster *admin.ClusterDescription20240805 + var clusterResp *admin.ClusterDescription20240805 if !update.IsZeroValues(patchReq) { upgradeRequest := getTenantUpgradeRequest(stateReq, patchReq) if upgradeRequest != nil { - cluster = r.applyTenantUpgrade(ctx, &plan, upgradeRequest, diags) + clusterResp = r.applyTenantUpgrade(ctx, &plan, upgradeRequest, diags) } else { - cluster = r.applyClusterChanges(ctx, diags, &state, &plan, patchReq) + clusterResp = r.applyClusterChanges(ctx, diags, &state, &plan, patchReq) } if diags.HasError() { return @@ -129,20 +129,22 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou if diags.HasError() { return } - var stateAdvConfig *types.Object - if advConfigChanged || cluster == nil { - // Cluster changes to UPDATING state after updating advanced configuration - cluster = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, plan.ProjectID.ValueString(), plan.Name.ValueString(), changeReasonUpdate) + modelOut := &state + if clusterResp != nil { + modelOut, _ = getBasicClusterModel(ctx, diags, r.Client, clusterResp, &plan) if diags.HasError() { return } - } else { - stateAdvConfig = &state.AdvancedConfiguration } - model := r.convertClusterAddAdvConfig(ctx, legacyAdvConfig, advConfig, cluster, &plan, stateAdvConfig, diags) - if model != nil { - diags.Append(resp.State.Set(ctx, model)...) + if advConfigChanged { + updateModelAdvancedConfig(ctx, diags, r.Client, modelOut, legacyAdvConfig, advConfig) + if diags.HasError() { + return + } + } else { + modelOut.AdvancedConfiguration = state.AdvancedConfiguration } + diags.Append(resp.State.Set(ctx, modelOut)...) } func (r *rs) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { @@ -201,12 +203,12 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn diags.AddError("errorCreate", fmt.Sprintf(errorCreate, err.Error())) return nil } - cluster := AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) + clusterResp := AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) if diags.HasError() { return nil } if pauseAfter { - cluster = r.updateAndWait(ctx, &pauseRequest, diags, plan) + clusterResp = r.updateAndWait(ctx, &pauseRequest, diags, plan) } var legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs legacyAdvConfigUpdate := NewAtlasReqAdvancedConfigurationLegacy(ctx, &plan.AdvancedConfiguration, diags) @@ -217,6 +219,10 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn diags.AddError("errorUpdateeAdvConfigLegacy", fmt.Sprintf(errorCreate, err.Error())) return nil } + _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) + if diags.HasError() { + return nil + } } advConfigUpdate := NewAtlasReqAdvancedConfiguration(ctx, &plan.AdvancedConfiguration, diags) @@ -228,25 +234,46 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn diags.AddError("errorUpdateAdvConfig", fmt.Sprintf(errorCreate, err.Error())) return nil } + _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) + if diags.HasError() { + return nil + } + } + modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, clusterResp, plan) + if diags.HasError() { + return nil } - return r.convertClusterAddAdvConfig(ctx, legacyAdvConfig, advConfig, cluster, plan, nil, diags) + updateModelAdvancedConfig(ctx, diags, r.Client, modelOut, legacyAdvConfig, advConfig) + if diags.HasError() { + return nil + } + return modelOut } -func (r *rs) readCluster(ctx context.Context, model *TFModel, state *tfsdk.State, diags *diag.Diagnostics, allowNotFound bool) *TFModel { - clusterName := model.Name.ValueString() - projectID := model.ProjectID.ValueString() +func (r *rs) readCluster(ctx context.Context, diags *diag.Diagnostics, modelIn *TFModel, state *tfsdk.State) *TFModel { + clusterName := modelIn.Name.ValueString() + projectID := modelIn.ProjectID.ValueString() api := r.Client.AtlasV2.ClustersApi readResp, _, err := api.GetCluster(ctx, projectID, clusterName).Execute() if err != nil { - if admin.IsErrorCode(err, ErrorCodeClusterNotFound) && allowNotFound { + if admin.IsErrorCode(err, ErrorCodeClusterNotFound) { state.RemoveResource(ctx) return nil } diags.AddError("errorRead", fmt.Sprintf(errorRead, clusterName, err.Error())) return nil } - return r.convertClusterAddAdvConfig(ctx, nil, nil, readResp, model, nil, diags) + modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, readResp, modelIn) + if diags.HasError() { + return nil + } + updateModelAdvancedConfig(ctx, diags, r.Client, modelOut, nil, nil) + if diags.HasError() { + return nil + } + return modelOut } + func (r *rs) applyAdvancedConfigurationChanges(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel) (legacy *admin20240530.ClusterDescriptionProcessArgs, latest *admin.ClusterDescriptionProcessArgs20240805, changed bool) { var ( api = r.Client.AtlasV2.ClustersApi @@ -262,7 +289,11 @@ func (r *rs) applyAdvancedConfigurationChanges(ctx context.Context, diags *diag. advConfig, _, err = api.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, patchReqProcessArgs).Execute() if err != nil { diags.AddError("errorUpdateAdvancedConfig", fmt.Sprintf(errorConfigUpdate, clusterName, err.Error())) - return legacyAdvConfig, advConfig, changed + return nil, nil, false + } + _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) + if diags.HasError() { + return nil, nil, false } } patchReqProcessArgsLegacy := update.PatchPayloadTpf(ctx, diags, &state.AdvancedConfiguration, &plan.AdvancedConfiguration, NewAtlasReqAdvancedConfigurationLegacy) @@ -271,6 +302,11 @@ func (r *rs) applyAdvancedConfigurationChanges(ctx context.Context, diags *diag. legacyAdvConfig, _, err = r.Client.AtlasV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, patchReqProcessArgsLegacy).Execute() if err != nil { diags.AddError("errorUpdateAdvancedConfigLegacy", fmt.Sprintf(errorConfigUpdate, clusterName, err.Error())) + return nil, nil, false + } + _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) + if diags.HasError() { + return nil, nil, false } } return legacyAdvConfig, advConfig, changed @@ -348,7 +384,6 @@ func (r *rs) updateLegacyReplicationSpecs(ctx context.Context, state, plan *TFMo return false } api20240530 := r.Client.AtlasV220240530.ClustersApi - api20240530.UpdateCluster(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), legacyPatch) _, _, err := api20240530.UpdateCluster(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), legacyPatch).Execute() if err != nil { diags.AddError("errorUpdateLegacy", fmt.Sprintf(errorUpdate, plan.Name.ValueString(), err.Error())) @@ -368,6 +403,7 @@ func (r *rs) updateAndWait(ctx context.Context, patchReq *admin.ClusterDescripti } return AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &tfModel.Timeouts, diags, projectID, clusterName, changeReasonUpdate) } + func (r *rs) updateAndWaitLegacy(ctx context.Context, patchReq *admin20240805.ClusterDescription20240805, diags *diag.Diagnostics, plan *TFModel) *admin.ClusterDescription20240805 { api20240805 := r.Client.AtlasV220240805.ClustersApi projectID := plan.ProjectID.ValueString() @@ -393,29 +429,20 @@ func (r *rs) applyTenantUpgrade(ctx context.Context, plan *TFModel, upgradeReque return AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) } -func (r *rs) convertClusterAddAdvConfig(ctx context.Context, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805, cluster *admin.ClusterDescription20240805, modelIn *TFModel, oldAdvConfig *types.Object, diags *diag.Diagnostics) *TFModel { - apiInfo := resolveAPIInfo(ctx, modelIn, diags, cluster, r.Client) +func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, clusterResp *admin.ClusterDescription20240805, modelIn *TFModel) (*TFModel, *ExtraAPIInfo) { + apiInfo := resolveAPIInfo(ctx, modelIn, diags, clusterResp, client) if diags.HasError() { - return nil + return nil, nil } - modelOut := NewTFModel(ctx, cluster, modelIn.Timeouts, diags, *apiInfo) + modelOut := NewTFModel(ctx, clusterResp, modelIn.Timeouts, diags, *apiInfo) if diags.HasError() { - return nil - } - if admin.IsNil(oldAdvConfig) { - legacyAdvConfig, advConfig = readUnsetAdvancedConfiguration(ctx, r.Client, modelOut, legacyAdvConfig, advConfig, diags) - AddAdvancedConfig(ctx, modelOut, advConfig, legacyAdvConfig, diags) - if diags.HasError() { - return nil - } - } else { - modelOut.AdvancedConfiguration = *oldAdvConfig + return nil, nil } overrideAttributesWithPrevStateValue(modelIn, modelOut) - return modelOut + return modelOut, apiInfo } -func readUnsetAdvancedConfiguration(ctx context.Context, client *config.MongoDBClient, model *TFModel, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805, diags *diag.Diagnostics) (*admin20240530.ClusterDescriptionProcessArgs, *admin.ClusterDescriptionProcessArgs20240805) { +func updateModelAdvancedConfig(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, model *TFModel, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805) { api := client.AtlasV2.ClustersApi api20240530 := client.AtlasV220240530.ClustersApi projectID := model.ProjectID.ValueString() @@ -425,15 +452,15 @@ func readUnsetAdvancedConfiguration(ctx context.Context, client *config.MongoDBC legacyAdvConfig, _, err = api20240530.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { diags.AddError("errorReadAdvConfigLegacy", fmt.Sprintf(errorRead, clusterName, err.Error())) - return nil, nil + return } } if advConfig == nil { advConfig, _, err = api.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { diags.AddError("errorReadAdvConfig", fmt.Sprintf(errorRead, clusterName, err.Error())) - return nil, nil + return } } - return legacyAdvConfig, advConfig + AddAdvancedConfig(ctx, model, advConfig, legacyAdvConfig, diags) } diff --git a/internal/service/advancedclustertpf/resource_compatibility_reuse.go b/internal/service/advancedclustertpf/resource_compatibility_reuse.go index b827444670..e3dd10df5e 100644 --- a/internal/service/advancedclustertpf/resource_compatibility_reuse.go +++ b/internal/service/advancedclustertpf/resource_compatibility_reuse.go @@ -105,22 +105,23 @@ func getAdvancedClusterContainerID(containers []admin.CloudProviderContainer, cl return "" } -func getReplicationSpecIDsFromOldAPI(ctx context.Context, projectID, clusterName string, api admin20240530.ClustersApi) (map[string]string, error) { - clusterOldAPI, _, err := api.GetCluster(ctx, projectID, clusterName).Execute() +func getReplicationSpecIDsFromOldAPI(ctx context.Context, projectID, clusterName string, api admin20240530.ClustersApi) (zoneNameSpecIDs map[string]string, asymmetricShardUnsupported bool, err error) { + var clusterOldAPI *admin20240530.AdvancedClusterDescription + clusterOldAPI, _, err = api.GetCluster(ctx, projectID, clusterName).Execute() if err != nil { if apiError, ok := admin20240530.AsError(err); ok { if apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" { - return nil, nil // if its the case of an asymmetric shard an error is expected in old API, replication_specs.*.id attribute will not be populated + return nil, true, nil // an error is expected in old API in case of an asymmetric shard. In that case, replication_specs.*.id attribute will not be populated. } } - return nil, fmt.Errorf("error reading advanced cluster with 2023-02-01 API (%s): %s", clusterName, err) + return nil, false, fmt.Errorf("error reading advanced cluster with 2023-02-01 API (%s): %s", clusterName, err) } specs := clusterOldAPI.GetReplicationSpecs() - result := make(map[string]string, len(specs)) + zoneNameSpecIDs = make(map[string]string, len(specs)) for _, spec := range specs { - result[spec.GetZoneName()] = spec.GetId() + zoneNameSpecIDs[spec.GetZoneName()] = spec.GetId() } - return result, nil + return zoneNameSpecIDs, false, nil } func convertHardwareSpecToOldSDK(hwspec *admin.HardwareSpec20240805) *admin20240530.HardwareSpec { diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index e3ac60561b..85130bb473 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -40,7 +40,7 @@ func findNumShardsUpdates(ctx context.Context, state, plan *TFModel, diags *diag func resolveAPIInfo(ctx context.Context, plan *TFModel, diags *diag.Diagnostics, clusterLatest *admin.ClusterDescription20240805, client *config.MongoDBClient) *ExtraAPIInfo { rootDiskSize := conversion.NilForUnknown(plan.DiskSizeGB, plan.DiskSizeGB.ValueFloat64Pointer()) projectID := plan.ProjectID.ValueString() - zoneNameSpecIDs, err := getReplicationSpecIDsFromOldAPI(ctx, projectID, plan.Name.ValueString(), client.AtlasV220240530.ClustersApi) + zoneNameSpecIDs, asymmetricShardUnsupported, err := getReplicationSpecIDsFromOldAPI(ctx, projectID, plan.Name.ValueString(), client.AtlasV220240530.ClustersApi) if err != nil { diags.AddError("getReplicationSpecIDsFromOldAPI", err.Error()) return nil @@ -59,6 +59,7 @@ func resolveAPIInfo(ctx context.Context, plan *TFModel, diags *diag.Diagnostics, ZoneNameNumShards: numShardsMap(ctx, plan.ReplicationSpecs, diags), RootDiskSize: rootDiskSize, ZoneNameReplicationSpecIDs: zoneNameSpecIDs, + AsymmetricShardUnsupported: asymmetricShardUnsupported, } } @@ -140,6 +141,9 @@ func repSpecNoIDs(repspec admin.ReplicationSpec20240805) *admin.ReplicationSpec2 func numShardsCounts(ctx context.Context, input types.List, diags *diag.Diagnostics) []int64 { elements := make([]TFReplicationSpecsModel, len(input.Elements())) + if len(elements) == 0 { + return nil + } if localDiags := input.ElementsAs(ctx, &elements, false); len(localDiags) > 0 { diags.Append(localDiags...) return nil @@ -162,6 +166,9 @@ func usingLegacySchema(ctx context.Context, input types.List, diags *diag.Diagno func numShardsMap(ctx context.Context, input types.List, diags *diag.Diagnostics) map[string]int64 { elements := make([]TFReplicationSpecsModel, len(input.Elements())) + if len(elements) == 0 { + return nil + } if localDiags := input.ElementsAs(ctx, &elements, false); len(localDiags) > 0 { diags.Append(localDiags...) return nil diff --git a/internal/service/advancedclustertpf/resource_schema.go b/internal/service/advancedclustertpf/schema.go similarity index 91% rename from internal/service/advancedclustertpf/resource_schema.go rename to internal/service/advancedclustertpf/schema.go index 001745c89a..547390cd18 100644 --- a/internal/service/advancedclustertpf/resource_schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" + dsschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" @@ -15,10 +16,11 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/schemafunc" ) -func ResourceSchema(ctx context.Context) schema.Schema { +func resourceSchema(ctx context.Context) schema.Schema { return schema.Schema{ Version: 1, Attributes: map[string]schema.Attribute{ @@ -351,6 +353,40 @@ func ResourceSchema(ctx context.Context) schema.Schema { } } +func dataSourceSchema(ctx context.Context) dsschema.Schema { + return conversion.DataSourceSchemaFromResource(resourceSchema(ctx), &conversion.DataSourceSchemaRequest{ + RequiredFields: []string{"project_id", "name"}, + OverridenFields: dataSourceOverridenFields(), + }) +} + +func pluralDataSourceSchema(ctx context.Context) dsschema.Schema { + return conversion.PluralDataSourceSchemaFromResource(resourceSchema(ctx), &conversion.PluralDataSourceSchemaRequest{ + RequiredFields: []string{"project_id"}, + OverridenRootFields: map[string]dsschema.Attribute{ + "use_replication_spec_per_shard": dsschema.BoolAttribute{ // TODO: added as in current resource + Optional: true, + MarkdownDescription: "use_replication_spec_per_shard", // TODO: add documentation + }, + "include_deleted_with_retained_backups": dsschema.BoolAttribute{ // TODO: not in current resource, decide if keep + Optional: true, + MarkdownDescription: "Flag that indicates whether to return Clusters with retain backups.", + }, + }, + OverridenFields: dataSourceOverridenFields(), + }) +} + +func dataSourceOverridenFields() map[string]dsschema.Attribute { + return map[string]dsschema.Attribute{ + "use_replication_spec_per_shard": dsschema.BoolAttribute{ // TODO: added as in current resource + Optional: true, + MarkdownDescription: "use_replication_spec_per_shard", // TODO: add documentation + }, + "accept_data_risks_and_force_replica_set_reconfig": nil, + } +} + func AutoScalingSchema() schema.SingleNestedAttribute { return schema.SingleNestedAttribute{ Computed: true, @@ -537,6 +573,47 @@ type TFModel struct { PitEnabled types.Bool `tfsdk:"pit_enabled"` } +// TFModelDS differs from TFModel: removes timeouts, accept_data_risks_and_force_replica_set_reconfig; adds use_replication_spec_per_shard. +type TFModelDS struct { + DiskSizeGB types.Float64 `tfsdk:"disk_size_gb"` + Labels types.Set `tfsdk:"labels"` + ReplicationSpecs types.List `tfsdk:"replication_specs"` + Tags types.Set `tfsdk:"tags"` + ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` + Name types.String `tfsdk:"name"` + AdvancedConfiguration types.Object `tfsdk:"advanced_configuration"` + BiConnectorConfig types.Object `tfsdk:"bi_connector_config"` + RootCertType types.String `tfsdk:"root_cert_type"` + ClusterType types.String `tfsdk:"cluster_type"` + MongoDBMajorVersion types.String `tfsdk:"mongo_db_major_version"` + ConfigServerType types.String `tfsdk:"config_server_type"` + VersionReleaseSystem types.String `tfsdk:"version_release_system"` + ConnectionStrings types.Object `tfsdk:"connection_strings"` + StateName types.String `tfsdk:"state_name"` + MongoDBVersion types.String `tfsdk:"mongo_db_version"` + CreateDate types.String `tfsdk:"create_date"` + EncryptionAtRestProvider types.String `tfsdk:"encryption_at_rest_provider"` + ProjectID types.String `tfsdk:"project_id"` + ClusterID types.String `tfsdk:"cluster_id"` + ConfigServerManagementMode types.String `tfsdk:"config_server_management_mode"` + PinnedFCV types.Object `tfsdk:"pinned_fcv"` + UseReplicationSpecPerShard types.Bool `tfsdk:"use_replication_spec_per_shard"` + RedactClientLogData types.Bool `tfsdk:"redact_client_log_data"` + GlobalClusterSelfManagedSharding types.Bool `tfsdk:"global_cluster_self_managed_sharding"` + BackupEnabled types.Bool `tfsdk:"backup_enabled"` + RetainBackupsEnabled types.Bool `tfsdk:"retain_backups_enabled"` + Paused types.Bool `tfsdk:"paused"` + TerminationProtectionEnabled types.Bool `tfsdk:"termination_protection_enabled"` + PitEnabled types.Bool `tfsdk:"pit_enabled"` +} + +type TFModelPluralDS struct { + ProjectID types.String `tfsdk:"project_id"` + Results []*TFModelDS `tfsdk:"results"` + UseReplicationSpecPerShard types.Bool `tfsdk:"use_replication_spec_per_shard"` // TODO: added as in current resource + IncludeDeletedWithRetainedBackups types.Bool `tfsdk:"include_deleted_with_retained_backups"` // TODO: not in current resource, decide if keep +} + type TFBiConnectorModel struct { ReadPreference types.String `tfsdk:"read_preference"` Enabled types.Bool `tfsdk:"enabled"` diff --git a/internal/service/advancedclustertpf/resource_schema_test.go b/internal/service/advancedclustertpf/schema_test.go similarity index 100% rename from internal/service/advancedclustertpf/resource_schema_test.go rename to internal/service/advancedclustertpf/schema_test.go diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index 9c89c1d2f6..1bb7fc0ae0 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -7,7 +7,6 @@ import ( "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2/hclwrite" "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/hcl" "github.com/zclconf/go-cty/cty" @@ -16,67 +15,35 @@ import ( ) func TestCheckResourceAttrSchemaV2(isAcc bool, name, key, value string) resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return testCheckFuncAlwaysPass - } return resource.TestCheckResourceAttr(name, AttrNameToSchemaV2(isAcc, key), value) } func TestCheckResourceAttrSetSchemaV2(isAcc bool, name, key string) resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return testCheckFuncAlwaysPass - } return resource.TestCheckResourceAttrSet(name, AttrNameToSchemaV2(isAcc, key)) } func TestCheckResourceAttrWithSchemaV2(isAcc bool, name, key string, checkValueFunc resource.CheckResourceAttrWithFunc) resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return testCheckFuncAlwaysPass - } return resource.TestCheckResourceAttrWith(name, AttrNameToSchemaV2(isAcc, key), checkValueFunc) } func TestCheckTypeSetElemNestedAttrsSchemaV2(isAcc bool, name, key string, values map[string]string) resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return testCheckFuncAlwaysPass - } return resource.TestCheckTypeSetElemNestedAttrs(name, AttrNameToSchemaV2(isAcc, key), values) } -func testCheckFuncAlwaysPass(*terraform.State) error { - return nil -} - func AddAttrChecksSchemaV2(isAcc bool, name string, checks []resource.TestCheckFunc, mapChecks map[string]string) []resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return []resource.TestCheckFunc{} - } return AddAttrChecks(name, checks, ConvertToSchemaV2AttrsMap(isAcc, mapChecks)) } func AddAttrSetChecksSchemaV2(isAcc bool, name string, checks []resource.TestCheckFunc, attrNames ...string) []resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return []resource.TestCheckFunc{} - } return AddAttrSetChecks(name, checks, ConvertToSchemaV2AttrsSet(isAcc, attrNames)...) } func AddAttrChecksPrefixSchemaV2(isAcc bool, name string, checks []resource.TestCheckFunc, mapChecks map[string]string, prefix string, skipNames ...string) []resource.TestCheckFunc { - if skipChecks(isAcc, name) { - return []resource.TestCheckFunc{} - } return AddAttrChecksPrefix(name, checks, ConvertToSchemaV2AttrsMap(isAcc, mapChecks), prefix, skipNames...) } -func skipChecks(isAcc bool, name string) bool { - if !config.AdvancedClusterV2Schema() || !isAcc { - return false - } - return strings.HasPrefix(name, "data.mongodbatlas_advanced_cluster") -} - func ConvertToSchemaV2AttrsMap(isAcc bool, attrsMap map[string]string) map[string]string { - if !config.AdvancedClusterV2Schema() || !isAcc { + if skipSchemaV2Work(isAcc) { return attrsMap } ret := make(map[string]string, len(attrsMap)) @@ -87,7 +54,7 @@ func ConvertToSchemaV2AttrsMap(isAcc bool, attrsMap map[string]string) map[strin } func ConvertToSchemaV2AttrsSet(isAcc bool, attrsSet []string) []string { - if !config.AdvancedClusterV2Schema() || !isAcc { + if skipSchemaV2Work(isAcc) { return attrsSet } ret := make([]string, 0, len(attrsSet)) @@ -104,10 +71,11 @@ var tpfSingleNestedAttrs = []string{ "auto_scaling", // includes analytics_auto_scaling "advanced_configuration", "bi_connector_config", + "pinned_fcv", } func AttrNameToSchemaV2(isAcc bool, name string) string { - if !config.AdvancedClusterV2Schema() || !isAcc { + if skipSchemaV2Work(isAcc) { return name } for _, singleAttrName := range tpfSingleNestedAttrs { @@ -118,7 +86,7 @@ func AttrNameToSchemaV2(isAcc bool, name string) string { func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) string { t.Helper() - if !config.AdvancedClusterV2Schema() || !isAcc { + if skipSchemaV2Work(isAcc) { return def } parse := hcl.GetDefParser(t, def) @@ -139,6 +107,10 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri return string(content) } +func skipSchemaV2Work(isAcc bool) bool { + return !config.AdvancedClusterV2Schema() || !isAcc +} + func AssertEqualHCL(t *testing.T, expected, actual string, msgAndArgs ...interface{}) { t.Helper() assert.Equal(t, hcl.CanonicalHCL(t, expected), hcl.CanonicalHCL(t, actual), msgAndArgs...) From a18d51f7c943ca9a10a33f4d59dda3a25928d4fd Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Mon, 16 Dec 2024 12:35:53 +0100 Subject: [PATCH 07/40] feat: Support auto-scaling per shard for cluster tier in `advanced_cluster` (#2891) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Adjust `mongodbatlas_advanced_cluster` update operation to use latest sdk (#2814) * change API call version * removed temporary 20240805 functions and adjust create operation * added changelog * adjusted comments * Implements review feedback * feat: Ensures asymmetric auto-scaling is not defined in the cluster when using the old sharding configuration in `mongodbatlas_advanced_cluster` (#2836) * use old API when the old schema structure is used * changelog * changelog fix * add feature to adv_cluster tpf todo * pr comments * test: Add tests for `mongodb_advanced_cluster` covering transitions to auto-scaling mode (#2851) * implement GetIndependentShardScalingMode * add tests * add comment on fixed version * use base url from env variable to make tests work in QA * chore: Refactor read operation in 'mongodb_advanced_cluster' (#2839) * Initial implementation * Removes redundant comments * Moves old shard config flatten logic to keep generic flatten function * Removes redundant comments * Adds testing to GetReplicationSpecAttributesFromOldAPI * Adds unit testing and fixes comments * Fixes lint * Changes names OldShardConfig to OldShardingConfig and removes redundant DS function * Adds comments * Changes test name * move OldShardConfigMeta to model file --------- Co-authored-by: Oriol Arbusi * test: Refactor tests for `mongodb_advanced_cluster` covering transitions to auto-scaling mode (#2863) * refactor tests * cover geo sharded case * temp: change to run tests in CI * chore: Refactors read operation of `mongodbatlas_advanced_cluster` data sources (#2859) * refactor read operation of data sources to be like the resource read operation * wip:fix test * Revert "wip:fix test" This reverts commit 990d88cd0bb0785289b5068be0ea94d6db5903a6. * small cleanup * fix * handle ASYMMETRIC_SHARD_UNSUPPORTED * fix unit test * simplify if * handle ASYMMETRIC_SHARD_UNSUPPORTED in singular data source as was done in previous implementation * Revert "handle ASYMMETRIC_SHARD_UNSUPPORTED in singular data source as was done in previous implementation" This reverts commit 439f7fe7d32022f3de510bdcdc4d95a2b3f1e2be. * fix error handling * adapt test * final changes * pr comments * pr * fix test * typo * test check * mig test skip * doc: Adjusting `advanced_cluster` documentation reflecting changes in how auto scaling properties work (#2873) * auto_scaling doc improvements * add mention of independent shard scaling in autoscaling attribute * add mention for replication_spec id * unify note on automatic changes to reduce verbosity * wording change * clarify that empty string is encountered * doc: Adjusting new sharding configuration migration guide with auto-scaling considerations + examples (#2879) * adjust new sharding configuration migration guide with autoscaling considerations, as well as an example * minor working fix * fmt fix * minor edit * apply doc review changes * chore: Merge latest changes in master into auto-scaling per shard dev branch (#2886) * chore: Updates Atlas Go SDK (#2805) * build(deps): bump go.mongodb.org/atlas-sdk * fix breaking changes --------- Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> Co-authored-by: Oriol Arbusi * chore: Continues with data source schema auto-generation (#2815) * schema_generation * resource policy * plural datasource for resource_policy * encryption_at_rest_private_endpoint * extract project resource schema to resource_schema.go * project * rename to resource_project_schema.go * Update docs/data-sources/stream_processor.md Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * Update docs/data-sources/stream_processors.md Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * Update docs/data-sources/stream_processors.md Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * Update internal/service/streamprocessor/data_source_schema.go Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * Update internal/service/streamprocessor/data_source_schema.go Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * fix schema admin reference * apply feedback * stream_instance * fix project * remove checks * project_ip_access timeout as attribute * project_ip_access_list * stream_connection * update templates * remove checks * changelog * apply feedback --------- Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> * chore: Updates CHANGELOG.md for #2815 * chore: Bump github.com/hashicorp/terraform-plugin-testing (#2809) Bumps [github.com/hashicorp/terraform-plugin-testing](https://github.com/hashicorp/terraform-plugin-testing) from 1.9.0 to 1.11.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-testing/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-testing/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-testing/compare/v1.9.0...v1.11.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-testing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Reverts changes to project data source (#2818) * remove changelog * revert files * chore: Updates CHANGELOG.md for #2818 * feat: Adds `mongodbatlas_flex_cluster` resource and data sources (#2816) * use SDK dev-preview * chore: Generate Flex Cluster file structure and resource schema (#2702) * generate resource and schema * pr comments * correct Map * feat: Implements `mongodbatlas_flex_cluster` resource (#2716) * create implementation * read implementation * update and delete implementation * Implement model * schema refactor * format * wip: model tests * initial model test * test for NewTFModel * Test NewAtlasCreateReq * test NewAtlasUpdateReq * fix tests * refactor for tags * fixes * implement import * simplify update * basic acceptance test * wip: acc tests * fix model test * final changes on tests * changelog entry * add resource to fallback template * Update .changelog/2716.txt Co-authored-by: Agustin Bettati * set resource to preview --------- Co-authored-by: Melanija Cvetic Co-authored-by: Agustin Bettati * chore: Enable mongodbatlas_flex_cluster test in CI (#2720) * create implementation * read implementation * update and delete implementation * initial model test * Test NewAtlasCreateReq * fixes * changelong and fix to acceptance-tests-runner.yml * fix to changelog * removed changelog * resolve rebase issue * fix to implementation * change test to use existing project id * Adjusting predeployed project id name and added preview enable * fix the naming convension of env var --------- Co-authored-by: Oriol Arbusi * chore: Generate Flex Cluster data source file and schemas (#2725) * generate data source file and schema for singular Flex Cluster * Generate plural data source schema * Changing type of tags in schema * Fix to data source schema * chore: Adds state transition logic to mongodbatlas_flex_cluster resource (#2721) * implements state transition * use state transition in create, update and delete * PR comments * chore: Update operation improvements for `mongodbatlas_flex_cluster` resource (#2729) * schema refactors * revert rename * implement isUpdateAllowed * failed update test case * refactor equal checks * make more exhaustive the failed update test * remove UseStateForUnknown in state_name * wip: use plan modifier for non updatable fields * wip: use plan modifiers on all non updatable attributes * use plan modifiers to fail on update of certain attributes * rename planmodifier * simplify planmodifier * PR comments * remove attribute parameter * markdowndescription over description * test: Enable mongodbatlas_flex_cluster tests in QA environment (#2741) * feat: Implements and tests `mongodbatlas_flex_cluster` data source (#2738) * Implementing read funciton in data source * Acc test for data source * Added changelog * implementing review suggestions * fix to rebase * Adjusting default timeout of `flex_cluster` to 3 hours (#2757) * chore: Rebase dev_branch onto master_branch (#2764) * feat: Adds `is_slow_operation_thresholding_enabled` attribute to `mongodbatlas_project` (#2698) * feat: Initial support for is_slow_operation_thresholding_enabled * test: fix test cases * chore: add changelog entry * test: Add extra check for plural data source * refactor: only set SetSlowOperationThresholding once during update * chore: fix lint error * fix: need to set SetSlowOperationThresholding before reading project props from API * chore: address PR comment * doc: Add documentation for `is_slow_operation_thresholding_enabled` to project (#2700) * chore: Updates CHANGELOG.md for #2698 * chore: Use `qa` for TestSuite on Sundays (#2701) * build(deps): bump go.mongodb.org/atlas-sdk (#2705) Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> * wait in second test (#2707) * chore: Supports running Test Suite in QA on sundays (#2711) * Revert "chore: Use `qa` for TestSuite on Sundays (#2701)" This reverts commit 942e0977c2d299ccdd3d0d10179ef240e3351871. * chore: Supports running qa only on Sundays * address PR comments * refactor: move job to steps of variables * chore: Add top level description * chore: Adds SDK Preview (#2713) * add client * SDK update GHA * simulate Preview update * example of use for Admin Preview * Revert "example of use for Admin Preview" This reverts commit c5edef52847034af8cdb5daf7310743ed630f801. * rename adminPreview to adminpreview in client * example of use of SDK Preview * reverse example * go mod tidy * build(deps): bump go.mongodb.org/atlas-sdk (#2715) Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> * ci: fix env-vars for azure QA (#2709) * doc: Advanced Cluster Differences and TF Core Upgrades (#2633) * adv cluster differences doc updates * Update docs/index.md * Update index.md * Update advanced_cluster.md * Update advanced_cluster.md * Update advanced_cluster.md * Update cluster.md * Update docs/index.md Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * Update docs/resources/cluster.md Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * Update docs/resources/cluster.md Co-authored-by: Melissa Plunkett * Update advanced_cluster.md * Update cluster-to-advanced-cluster-migration-guide.md --------- Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Melissa Plunkett * revert SDK preview changes (#2719) * fix: Fixes inconsistent result when using a multi-region cluster by always using a single spec (#2685) * fix: Initial workaround for multiple specs issuing a warning of spec missmatch * fix: can only use multiple specs in data source (schema limitation) * test: Add a test to confirm multi-region cluster can be used with search deployment * chore: changelog file * chore: fix test enum value * chore: revert timeout changes * Update .changelog/2685.txt Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> * chore: Updates CHANGELOG.md for #2685 * chore: Updates examples link in index.md for v1.21.2 release * chore: Updates CHANGELOG.md header for v1.21.2 release * fix TestAccBackupSnapshotExportJob_basic (#2723) * chore: Bump github.com/hashicorp/terraform-plugin-framework-validators (#2727) Bumps [github.com/hashicorp/terraform-plugin-framework-validators](https://github.com/hashicorp/terraform-plugin-framework-validators) from 0.13.0 to 0.14.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework-validators/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework-validators/compare/v0.13.0...v0.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework-validators dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Fixes `mongodbatlas_project` when user doesn't have project owner permission (#2731) * update doc * add deprecated message * changelog * deprecate params * initial TestAccProject_slowOperationNotOwner * update version to 1.24.0 * changeRoles * Revert "changeRoles" This reverts commit c8ba3c84c2e419d468be1135b5bf408961f8f92a. * Revert "initial TestAccProject_slowOperationNotOwner" This reverts commit d1473711e888887ab5e3991f3cd7314ec52a23e2. * don't update the value if it's in Create so value is unknown * pass warnings * Update internal/service/project/resource_project.go Co-authored-by: Marco Suma * apply feedback in doc * clarify docs --------- Co-authored-by: Marco Suma * chore: Updates CHANGELOG.md for #2731 * chore: Merging schema generation internal tool PoC into master branch (#2735) * feat: Adds initial schema and config models for PoC - Model generation (#2638) * update computability type (#2668) * chore: PoC - Model generation - support primitive types at root level (#2673) * chore: PoC - Schema code generation - Initial support of primitive types (#2682) * initial commit with schema generation function and test fixture * small changes wip * include specific type generators * handling element types and imports * remove unrelated file * extract template logic to separate file * small revert change * extract import to const * follow up adjustments from PR comments and sync with Aastha * chore: PoC - Schema code generation - Supporting nested attributes (#2689) * support nested attribute types * rebasing changes related to unit testing adjustment * chore: PoC - Model generation - Supporting nested schema (List, ListNested, Set & SetNested) (#2693) * chore: PoC - Model generation - Supporting nested schema (objects - Map, MapNested, SingleNested Attributes) (#2704) * chore: PoC - Schema code generation - Supporting generation of typed model (#2703) * support typed model generation inlcuding root and nested attributes * minor fix for type of types map * add clarifying comment * improve name of generated object types, refactor function naming for readability * fix list map and set nested attribute generation (#2708) * chore: PoC - Model generation - support config aliases, ignores, and description overrides (#2712) * chore: PoC - Define make command to call code generation logic (#2706) * wip * iterating over all resources * add config for search deployment * update golden file test with fix in package name * use xstring implementation for pascal case * simplify write file logic * merge fixes * chore: PoC - Support configuration of timeout in schema (#2717) * wip * rebase fixes * fix logic avoiding adding timeout in nested schemas * fix generation * fix enum processing * fix golden file in timeout test * comment out unsupported config properties * simplify interfaces for attribute generation leaving common code in a separate function * chore: PoC - handle merging computability in nested attributes (#2722) * adjusting contributing guide (#2732) --------- Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Aastha Mahendru * doc: Adds documentation for `replication_specs.*.external_id` computed attribute for `mongodbatlas_advanced_cluster` (#2734) * adds M0 (#2730) * docs: Remove legacy project_id attribute in docs as it has been removed (#2733) * chore: Updates examples link in index.md for v1.21.3 release * chore: Updates CHANGELOG.md header for v1.21.3 release * chore: Unify file name for plural data source schema (#2739) * change name * fix name * rename to plural_data_source.go * check cluster creation times (#2728) * fix: Adds new attribute `results` and deprecates `resource_policies` for `mongodbatlas_resource_policies` data source (#2740) * new attribute results and deprecate resource_policies * changelog entry * change test to check new attribute * fix changelog * changelog fix * fix docs * Update .changelog/2740.txt Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * migration test * skip mig test until next version * fix comment --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * chore: Updates CHANGELOG.md for #2740 * build(deps): bump go.mongodb.org/atlas-sdk (#2745) Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> * fix: Fixes change assigments in `mongodbatlas_project_api_key` (#2737) * fix changed assigments * fix TestAccProjectAPIKey_updateRole * changelog * join configMultiple to configBasic * don't allow duplicate projectIDs * fix TestAccProjectAPIKey_dataSources * refactor Create * refactor getAPIProjectAssignments and flattenProjectAssignments * refactor Read * refactor Delete * fix TestAccProjectAPIKey_recreateWhenDeletedExternally * refactor Import * remove flattenProjectAssignments, flattenProjectAPIKeyRoles and getAPIProjectAssignments * fix plural ds * fix basicTestCase * refactor Update description * refactor Update * refactor expandProjectAssignments * update changelog * initial checkAggr * checkExists * delete redundant TestAccProjectAPIKey_dataSources * refactor configDuplicatedProject * refactor configChangingProject * model file * more detailed changelog * revert import * doc * refactor checks * chore: Updates CHANGELOG.md for #2737 * chore: Updates examples link in index.md for v1.21.4 release * chore: Updates CHANGELOG.md header for v1.21.4 release * chore: Support computability override in schema generation config (#2743) * test without parsing config options * add support for override of computability in config * refactor tests removing redudant code * extract common api spec path, handle computed only case * chore: Bump crazy-max/ghaction-import-gpg from 6.1.0 to 6.2.0 (#2754) Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 6.1.0 to 6.2.0. - [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases) - [Commits](https://github.com/crazy-max/ghaction-import-gpg/compare/01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4...cb9bde2e2525e640591a934b1fd28eef1dcaf5e5) --- updated-dependencies: - dependency-name: crazy-max/ghaction-import-gpg dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump actions/setup-go from 5.0.2 to 5.1.0 (#2753) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.0.2 to 5.1.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32...41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump github.com/pb33f/libopenapi from 0.18.1 to 0.18.6 (#2750) Bumps [github.com/pb33f/libopenapi](https://github.com/pb33f/libopenapi) from 0.18.1 to 0.18.6. - [Release notes](https://github.com/pb33f/libopenapi/releases) - [Commits](https://github.com/pb33f/libopenapi/compare/v0.18.1...v0.18.6) --- updated-dependencies: - dependency-name: github.com/pb33f/libopenapi dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump tj-actions/verify-changed-files (#2751) Bumps [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files) from 54483a2138ca67989bc40785aa22faee8b085894 to 530d86d0a237225c87beaa000750988f8965ee31. - [Release notes](https://github.com/tj-actions/verify-changed-files/releases) - [Changelog](https://github.com/tj-actions/verify-changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/verify-changed-files/compare/54483a2138ca67989bc40785aa22faee8b085894...530d86d0a237225c87beaa000750988f8965ee31) --- updated-dependencies: - dependency-name: tj-actions/verify-changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump actions/checkout from 4.2.1 to 4.2.2 (#2752) * chore: Bump actions/checkout from 4.2.1 to 4.2.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871...11bd71901bbe5b1630ceea73d27597364c9af683) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Trigger Build --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * chore: Automatically updates Terraform version used in repository and test-suite (#2755) * rename workflow (#2761) * chore: Updates Atlas Go SDK (#2748) * build(deps): bump go.mongodb.org/atlas-sdk * Pin cluster POST and PATCH operations to 2024-08-05 avoiding any unintentional shard level autoscaling * unifying version clarification in comments * use sdk utility function for checking error code value * adjust conditional of error checking preserving behaviour --------- Co-authored-by: AgustinBettati <20469408+AgustinBettati@users.noreply.github.com> Co-authored-by: Agustin Bettati * chore: Generate Flex Cluster file structure and resource schema (#2702) * generate resource and schema * pr comments * correct Map * feat: Implements `mongodbatlas_flex_cluster` resource (#2716) * create implementation * read implementation * update and delete implementation * Implement model * schema refactor * format * wip: model tests * initial model test * test for NewTFModel * Test NewAtlasCreateReq * test NewAtlasUpdateReq * fix tests * refactor for tags * fixes * implement import * simplify update * basic acceptance test * wip: acc tests * fix model test * final changes on tests * changelog entry * add resource to fallback template * Update .changelog/2716.txt Co-authored-by: Agustin Bettati * set resource to preview --------- Co-authored-by: Melanija Cvetic Co-authored-by: Agustin Bettati * chore: Enable mongodbatlas_flex_cluster test in CI (#2720) * create implementation * read implementation * update and delete implementation * initial model test * Test NewAtlasCreateReq * fixes * changelong and fix to acceptance-tests-runner.yml * fix to changelog * removed changelog * resolve rebase issue * fix to implementation * change test to use existing project id * Adjusting predeployed project id name and added preview enable * fix the naming convension of env var --------- Co-authored-by: Oriol Arbusi * chore: Generate Flex Cluster data source file and schemas (#2725) * generate data source file and schema for singular Flex Cluster * Generate plural data source schema * Changing type of tags in schema * Fix to data source schema * chore: Adds state transition logic to mongodbatlas_flex_cluster resource (#2721) * implements state transition * use state transition in create, update and delete * PR comments * chore: Update operation improvements for `mongodbatlas_flex_cluster` resource (#2729) * schema refactors * revert rename * implement isUpdateAllowed * failed update test case * refactor equal checks * make more exhaustive the failed update test * remove UseStateForUnknown in state_name * wip: use plan modifier for non updatable fields * wip: use plan modifiers on all non updatable attributes * use plan modifiers to fail on update of certain attributes * rename planmodifier * simplify planmodifier * PR comments * remove attribute parameter * markdowndescription over description * test: Enable mongodbatlas_flex_cluster tests in QA environment (#2741) * feat: Implements and tests `mongodbatlas_flex_cluster` data source (#2738) * Implementing read funciton in data source * Acc test for data source * Added changelog * implementing review suggestions * fix to rebase * Adjusting default timeout of `flex_cluster` to 3 hours (#2757) * fixing imports * Adopting latest preview SDK version * fix flex varibale names after bump * fix atlasuser - set to continue using older SDK version * Fix to variable type names in flex unit test * fix duplicate * fix to api call in atlasUser tests --------- Signed-off-by: dependabot[bot] Co-authored-by: Espen Albert Co-authored-by: svc-apix-bot Co-authored-by: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> Co-authored-by: Zuhair Ahmed Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Melissa Plunkett Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Suma Co-authored-by: Agustin Bettati Co-authored-by: Aastha Mahendru Co-authored-by: Oriol Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> Co-authored-by: AgustinBettati <20469408+AgustinBettati@users.noreply.github.com> * feat: Implements `mongodbatlas_flex_cluster` plural data source (#2767) * Fix naming convensions in plural DS schema * Implementing plural DS read function * testing and plural ds model * fixes after rebase * additional unit testing for model * changelog * lint fix * removing parellel testing * implemented review feedback * lint fix * chore: Improvements to SDK version update (#2770) * comment use of older API version in atlasUser * add connv220240805 to factory.go * doc: Adds documentation and example for mongodbatlas_flex_cluster resource and data source (#2744) * wip: docs and example (missing data source * change version to make the CI check successful * fmt * regenerate * data source examples * readme created - to adjust preview feature note on release of flex to prod * data source templates * fix typo * generate data source documentation * fix to flex_cluster example * fix to flex_cluster example * fix to generated docs * Added flex to dedicated migration guide * fix typo * Implementing feedback and improving flex-dedicated migratoin guide * adjust flex example README.md * fix to example --------- Co-authored-by: Melanija Cvetic * deprecate: Deprecates Serverless functionality (#2742) * deprecates serverless functionality * documentation * deprecate attributes in data sources * set link to migration guide with supported migration paths * doc: Adds migration guides to transition out of Serverless and Shared-tier clusters (#2746) * wip: migration guides * add details on 1.22 guide * remove guide, will be in resource docs * wip: correct details on 1.22 guide * added migration guide for serverless to flex and serverless to dedicated * added migration guide for shared-tier to flex * added migration guide for serverless to free * implementing review feedback * implementing feedback to guide * changes to migration guide * Adjustments to migration guides * put URL instead of placeholder * move post before pre autoconversion guides, clarify serverless to dedicated * pr comment * pr comments * Update docs/guides/1.22.0-upgrade-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/1.22.0-upgrade-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> * Update docs/guides/serverless-shared-migration-guide.md Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> --------- Co-authored-by: Melanija Cvetic Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> * chore: Removes mentions and examples of Serverless and Shared-tier instances (#2811) * wip remove mentions of serverless and shared tier * remove examples from template for serverless privatelink * change from M5 to M0 for tenant examples of adv cluster * add note on M0 * chore: Refactor tags attribute schema and conversion logic (#2788) * Implements tag as common function * Refactor project and flex cluster to use new common tag functions * fix to testing and lint * fix changelog entry * january or later for shared tier autoconversion * auto-generate singular data source, temporarily with checks * remove singular data source check * update Description in plural data source --------- Signed-off-by: dependabot[bot] Co-authored-by: Melanija Cvetic Co-authored-by: Agustin Bettati Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> Co-authored-by: Espen Albert Co-authored-by: svc-apix-bot Co-authored-by: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> Co-authored-by: Zuhair Ahmed Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Melissa Plunkett Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Suma Co-authored-by: Aastha Mahendru Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> Co-authored-by: AgustinBettati <20469408+AgustinBettati@users.noreply.github.com> Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> * chore: Updates CHANGELOG.md for #2816 * fix: Adds changelog for decreased delay in `mongobatlas_privatelink_endpoint_service` (#2819) * Adds changelog * Fix to changelog * Fix to changelog * chore: Updates CHANGELOG.md for #2819 * chore: Adds initial TPF implementation for advanced_cluster (#2813) * initial create operation * initial resource implementation * support returning nil when advanced config fields are null * test: Add support for overriding http round tripper to allow mocking http request/responses * minor error renaming * remove mocked responses * test: initial TestAdvancedCluster_configSharded requests * chore: use same admin version as existing cluster * mock: allow re-reading GETs * test: support raising error when mock variables are not set * fix: don't dump GroupID in cluster payloads * test: update test case to match existing * refactor: use full request.id() to keep aligned with generator format (differentiate requests with the distinct payloads) * fix: add `computed` to adv_cluster attributes to avoid provider errors * test: minor mock fixes * feat: support state transitions and pause logic * chore: test data updates * test: Support overriding diff files by using `_manual` suffix * style: fmt * test: delete old mock files * test: rename basic to replicast * fix: Deleted should support IDLE --> DELETED * fix: cluster name update requires replace * test: Add tenant test case * chore: include provider changes * fix(move_state): Use ValueString() and do a proper conversion * test: Support mocking test case * refactor: use new `unit.MockTestCase` to simplify resource_test.go * test: Introduce "live" acceptance test for tpf * refactor: re-use existing retry strategy states * refactor: introduce constant.error_codes * refactor: minor cleanups * test: Refactor MockTestCase to also run and support setting TF_ACC dynamically * chore: increase unit test timeout to enable tpf unit tests * minor improvements * unit test timeout increase. Used 75s locally * ci: support running mocked acceptance tests as part of advanced_cluster_tpf job * ci: as of now, advancedclustertpf unit tests cannot run as part of normal unit test since the resource is not added in provider * test: Skip broken move_state_tests * minor fix * chore: fix imports to latest SDK * estetic change to workflow file * refactor: Use provider_mock instead of customizing existing provider (revert all changes to client.go and provider.go * address PR comments * use `diags` instead of returning summary, detail * only removeResource in read * address immediate PR comments * refactor: Use a higher abstraction level in update * refactor: Return TFModel to make purpose more explicit * refactor: Replace awaitChanges method with AwaitChanges function for improved clarity and consistency * apply suggestion * chore: Add step count assertion * refactor: move out all the unit tests and mocked unit test logic * remove: accidental provider changes * remove last changes for unit tests * build(deps): bump go.mongodb.org/atlas-sdk (#2823) Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> * fix: Fixes tags in `mongodbatlas_flex_cluster` (#2829) * fix tags * add tests * fix * chore: Updates examples link in index.md for v1.22.0 release * chore: Updates CHANGELOG.md header for v1.22.0 release * doc: Add preview notice in `mongodbatlas_flex_cluster` docs (#2830) * preview notice * small fix * chore: Bump github.com/wI2L/jsondiff from 0.6.0 to 0.6.1 (#2835) Bumps [github.com/wI2L/jsondiff](https://github.com/wI2L/jsondiff) from 0.6.0 to 0.6.1. - [Release notes](https://github.com/wI2L/jsondiff/releases) - [Changelog](https://github.com/wI2L/jsondiff/blob/master/.goreleaser.yml) - [Commits](https://github.com/wI2L/jsondiff/compare/v0.6.0...v0.6.1) --- updated-dependencies: - dependency-name: github.com/wI2L/jsondiff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump actions/checkout from 4.2.1 to 4.2.2 (#2833) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.2.1...11bd71901bbe5b1630ceea73d27597364c9af683) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Update tj-actions/verify-changed-files requirement to 530d86d0a237225c87beaa000750988f8965ee31 (#2832) Updates the requirements on [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files) to permit the latest version. - [Release notes](https://github.com/tj-actions/verify-changed-files/releases) - [Changelog](https://github.com/tj-actions/verify-changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/verify-changed-files/commits/530d86d0a237225c87beaa000750988f8965ee31) --- updated-dependencies: - dependency-name: tj-actions/verify-changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump srvaroa/labeler from 1.11.1 to 1.12.0 (#2831) Bumps [srvaroa/labeler](https://github.com/srvaroa/labeler) from 1.11.1 to 1.12.0. - [Release notes](https://github.com/srvaroa/labeler/releases) - [Commits](https://github.com/srvaroa/labeler/compare/29471ee1118fa4e10b011964e6e8fe2fd243e700...fe4b1c73bb8abf2f14a44a6912a8b4fee835d631) --- updated-dependencies: - dependency-name: srvaroa/labeler dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#2834) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.9.0 to 1.10.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.9.0...v1.10.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump slackapi/slack-github-action from 1.27.0 to 2.0.0 (#2810) * chore: Bump slackapi/slack-github-action from 1.27.0 to 2.0.0 Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.27.0 to 2.0.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/37ebaef184d7626c5f204ab8d3baff4262dd30f0...485a9d42d3a73031f12ec201c457e2162c45d02d) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * chore: Adjusting how webhook-type is provided in new slack-github-action 2.0 version --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Agustin Bettati * chore: Updates repository to use supported Terraform versions (#2838) Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * chore: Test converter for TPF (#2822) * initial create operation * initial resource implementation * support returning nil when advanced config fields are null * test: Add support for overriding http round tripper to allow mocking http request/responses * minor error renaming * remove mocked responses * test: initial TestAdvancedCluster_configSharded requests * chore: use same admin version as existing cluster * mock: allow re-reading GETs * test: support raising error when mock variables are not set * fix: don't dump GroupID in cluster payloads * test: update test case to match existing * refactor: use full request.id() to keep aligned with generator format (differentiate requests with the distinct payloads) * fix: add `computed` to adv_cluster attributes to avoid provider errors * test: minor mock fixes * feat: support state transitions and pause logic * chore: test data updates * test: Support overriding diff files by using `_manual` suffix * style: fmt * test: delete old mock files * test: rename basic to replicast * fix: Deleted should support IDLE --> DELETED * fix: cluster name update requires replace * test: Add tenant test case * chore: include provider changes * fix(move_state): Use ValueString() and do a proper conversion * test: Support mocking test case * refactor: use new `unit.MockTestCase` to simplify resource_test.go * test: Introduce "live" acceptance test for tpf * refactor: re-use existing retry strategy states * refactor: introduce constant.error_codes * refactor: minor cleanups * test: Refactor MockTestCase to also run and support setting TF_ACC dynamically * chore: increase unit test timeout to enable tpf unit tests * minor improvements * unit test timeout increase. Used 75s locally * ci: support running mocked acceptance tests as part of advanced_cluster_tpf job * ci: as of now, advancedclustertpf unit tests cannot run as part of normal unit test since the resource is not added in provider * test: Skip broken move_state_tests * minor fix * chore: fix imports to latest SDK * estetic change to workflow file * refactor: Use provider_mock instead of customizing existing provider (revert all changes to client.go and provider.go * address PR comments * use `diags` instead of returning summary, detail * only removeResource in read * address immediate PR comments * refactor: Use a higher abstraction level in update * refactor: Return TFModel to make purpose more explicit * refactor: Replace awaitChanges method with AwaitChanges function for improved clarity and consistency * apply suggestion * chore: Add step count assertion * refactor: move out all the unit tests and mocked unit test logic * remove: accidental provider changes * remove last changes for unit tests * enable TestAccClusterAdvancedCluster_basicTenant in TPF * initial unit test * AssertEqualHCL * AssertEqualHCL tests * call ConvertAdvancedClusterToTPF from tests * update go-cty * use more complex test * passing TestConvertAdvancedClusterToTPF * refactor * revert go.mod & go.sum * revertgithub.com/hashicorp/terraform-plugin-testing to v1.11.0 * go mod tidy * getBlockBody * enable env var * test without env * CheckDestroyCluster for TPF * don't check exists or data sources yet * import tests in TPF --------- Co-authored-by: Espen Albert * test: Adds support for mocked-acceptance-tests (#2820) * initial create operation * initial resource implementation * support returning nil when advanced config fields are null * test: Add support for overriding http round tripper to allow mocking http request/responses * minor error renaming * remove mocked responses * test: initial TestAdvancedCluster_configSharded requests * chore: use same admin version as existing cluster * mock: allow re-reading GETs * test: support raising error when mock variables are not set * fix: don't dump GroupID in cluster payloads * test: update test case to match existing * refactor: use full request.id() to keep aligned with generator format (differentiate requests with the distinct payloads) * fix: add `computed` to adv_cluster attributes to avoid provider errors * test: minor mock fixes * feat: support state transitions and pause logic * chore: test data updates * test: Support overriding diff files by using `_manual` suffix * style: fmt * test: delete old mock files * test: rename basic to replicast * fix: Deleted should support IDLE --> DELETED * fix: cluster name update requires replace * test: Add tenant test case * chore: include provider changes * fix(move_state): Use ValueString() and do a proper conversion * test: Support mocking test case * refactor: use new `unit.MockTestCase` to simplify resource_test.go * test: Introduce "live" acceptance test for tpf * refactor: re-use existing retry strategy states * refactor: introduce constant.error_codes * refactor: minor cleanups * test: Refactor MockTestCase to also run and support setting TF_ACC dynamically * chore: increase unit test timeout to enable tpf unit tests * minor improvements * unit test timeout increase. Used 75s locally * ci: support running mocked acceptance tests as part of advanced_cluster_tpf job * ci: as of now, advancedclustertpf unit tests cannot run as part of normal unit test since the resource is not added in provider * test: Skip broken move_state_tests * minor fix * chore: fix imports to latest SDK * estetic change to workflow file * refactor: Use provider_mock instead of customizing existing provider (revert all changes to client.go and provider.go * address PR comments * use `diags` instead of returning summary, detail * only removeResource in read * address immediate PR comments * refactor: Use a higher abstraction level in update * refactor: Return TFModel to make purpose more explicit * refactor: Replace awaitChanges method with AwaitChanges function for improved clarity and consistency * apply suggestion * chore: Add step count assertion * refactor: move out all the unit tests and mocked unit test logic * remove: accidental provider changes * remove last changes for unit tests * test: Add support for mocked acceptance tests * test: Support maintaining response order with responseIndex * test: update test data for adv cluster unit tests * test: mocker use colored diffs and support empty payloads in diffs * update mocker test data * test: Add check for AllowReReading * test: Add labels and tags to mock cluster JSON test data * update old guides (#2842) * chore: Includes the rest of blocks in TPF test converter (#2841) * don't remove double lines * enable TestAccClusterAdvancedCluster_withTags * tests for labels and tests * label and tags converter * common generateAllAttributeSpecs * change getVal return type * simplify generateAllAttrSpecs call * don't run data source checks for TPF yet * test for advanced_configuration * converter for advanced_configuration * bi_connector_config transform * test for bi_connector_config * fix tests * make explicit dependency from ds * Fix error message typo (#2843) When there's an error setting the `private_key`, it should output an error message mentioning `private_key` instead of `public_key` * chore: Plural data sources in TPF leveraging on resource data source (#2844) * PluralDataSourceSchemaFromResource * flexcluster * flexcluster doc * overridenFields and overridenRootFields in PluralDataSourceSchemaFromResource * advancedclustertpf * encryptionatrestprivateendpoint * resourcepolicy * streamconnection * streaminstance * fix TestPaginatedDSSchema * streamprocessor * remove checks and unneeded code * doc feedback * use struct for params * chore: Environment variable to enable dual schema (#2847) * LatestAdvancedClusterEnabled * TEMPORARY check allowLatestAdvancedClusterEnabled is caught * Revert "TEMPORARY check allowLatestAdvancedClusterEnabled is caught" This reverts commit 1694766b9884cfc3d501e1c210b2bd6154eccd50. * configure resource * make goal * CI config * use config.LatestAdvancedClusterEnabled * TEMPORARY check converter is caught * Revert "TEMPORARY check converter is caught" This reverts commit 98c34f37be7beab76f3be7aeb4a1862177497151. * chore: Adds support for multiple API versions for adv_cluster TPF (#2840) * feat: Support update.IsEmpty * initial start of `num_shards` support * feat: differentiate API Versions used * chore: formatting * feat: intial usage of latest admin api * feat: implement support for num_shards and add legacy compatibility functions for CREATE * chore: use ordinary diffs instead of colors * refactor: remove commented-out code * test: pass static orgID for unit testing * chore: initial working legacy schema * minor cleanup before review * test: Add acceptance test SymmetricShardedOldSchemaDiskSizeGBAtElectableLevel * feat: enhance disk size handling and normalization in advanced cluster resource * chore: PatchPayload, support IgnoreInState * address some PR comments * chore: Avoid update options (handled in normalize instead) * test: refresh golden file * feat: Initial update support using 20240530 * refactor: Always set root disk size * chore: update to use correct test data * refactor: always set rootDiskSize * refactor: update legacy model to include disk size and adjust replication specs handling * feat: add tests and mock data for symmetric sharded old schema configuration+Handle MongoDBMajor version formatting * test: fix mock file and remove manual change * chore: fix broken sharded test * refactor: minor refactorings * fix: Address PR comments * test: Change log message to fatal error for missing steps in request tracker * address PR comments 2 * wait in each cluster creation (#2848) * build(deps): bump go.mongodb.org/atlas-sdk (#2849) Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> * chore: Implements Move State (#2850) * move state impl * fix TestAccAdvancedCluster_move_invalid * TestAccAdvancedCluster_move_not_supported_sdkv2 * apply feedback * rename env var to MONGODB_ATLAS_ADVANCED_CLUSTER_V2_SCHEMA and associated elements * rename SkipIfTPFAdvancedCluster to SkipIfAdvancedClusterV2Schema * parallel tests for move * add last step so no dangling resources * chore: Bump tj-actions/verify-changed-files (#2853) Bumps [tj-actions/verify-changed-files](https://github.com/tj-actions/verify-changed-files) from 530d86d0a237225c87beaa000750988f8965ee31 to dc57d4518c9e75995e0fff59265333d19a684163. - [Release notes](https://github.com/tj-actions/verify-changed-files/releases) - [Changelog](https://github.com/tj-actions/verify-changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/verify-changed-files/compare/530d86d0a237225c87beaa000750988f8965ee31...dc57d4518c9e75995e0fff59265333d19a684163) --- updated-dependencies: - dependency-name: tj-actions/verify-changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump github.com/zclconf/go-cty from 1.15.0 to 1.15.1 (#2854) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.15.0 to 1.15.1. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.15.0...v1.15.1) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Implements extra API Calls for AdvancedCluster TPF (#2852) * chore: Add support for ExtraAPIInfo in TFModel to find replication_specs.*.container_id * feat: Initial /tenantUpgrade logic * refactor: Fix zoneName default for legacy schema * address PR comments part 1 * use explicit code instead of comments Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * chore: remove comments and fix suggested change commit * chore: remove comment * address PR comments 2 * test: hard code extra container response --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * build(deps): bump go.mongodb.org/atlas-sdk (#2856) Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> * update Go and linter (#2857) * chore: Ensures that MoveState works in all supported TF versions (#2858) * rename adv schema files * run MoveState matrix in GH * run MoveState tests only if TF version is at least 1.8.0 * revert change * clarify doc * only if above 1.8 * extract acc.CheckExistsCluster and use it in both cluster and adv_cluster (#2860) * chore: Updates repository to use supported Terraform versions (#2861) Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * chore: Enables all tests for TPF (#2862) * ConvertToTPFAttrsMap * use ConvertToTPFAttrsMap * move TPF test help funcs to the same file * acc.ConvertToTPFAttrsMap returns the attrs instead of mutating the input * ConvertToTPFAttrsSet * delete all SkipIfAdvancedClusterV2Schema except the ones already tried * adjust datasource checks * use ConvertAdvancedClusterToTPF( * refactor attrNameToSchemaV2 * skip some tests * skip more tests * add use_replication_spec_per_shard to data source schema * more tests skipped * don't use dynamic blocks so it can work in TPF as well * missing quotes * fix dynamic block extract * enable mig tests * skip specific mig tests * fix mig tests * skip TestMigAdvancedCluster_asymmetricShardedNewSchema * chore: Adds equivalent CRUD logic for Advanced Cluster TPF (#2855) * chore: remove immediate TODOs from schema * feat: Support retainBackups usage * refactor: Update API info handling and remove legacy schema references * feat: Enhance legacy ID handling in replication specs and update related functions * feat: Add validation for oplog_size_mb attribute in AdvancedConfigurationSchema * remove more todos * test: deleted unused diff files * feat: Support only updating advanced_configuration in update * feat: Add validation for MongoDB version compatibility in advanced configuration * chore: fix comment location * feat: support partial updates and fix advanced_config updates * perf: Support re-using /containers response based on cloud provider * refactor: Remove all UseStateForUnknown * refactor: Always read advanced_configuration, even when there are no changes. Even though plan has no changes with state, we cannot be sure that something has changed externally, better to ensure state always have the latest values * refactor: improve schema validation and plan modifiers * fix: address PR comments * fix: pause set on create * fix: set default value for changeStreamOptionsPreAndPostImagesExpireAfterSeconds to -1 when unset by user and handle `null` reponse from API * Revert "refactor: Always read advanced_configuration, even when there are no changes. Even though plan has no changes with state, we cannot be sure that something has changed externally, better to ensure state always have the latest values" This reverts commit c73d938542126586ea124431346ad4777c875f1c. * feat: Adds new `advanced_configuration.0.default_max_time_ms` attribute to `mongodbatlas_advanced_cluster` resource and data sources (#2825) * chore: Updates CHANGELOG.md for #2825 * chore: Updates Atlas Go SDK (#2870) * build(deps): bump go.mongodb.org/atlas-sdk * fix breaking changes --------- Co-authored-by: lantoli <430982+lantoli@users.noreply.github.com> * chore: Enables paused on create test (#2867) * feat: Support `pinned_fcv` attribute in advanced_cluster resource and data sources (#2789) * wip * support pinning with and without expiration date * add support for unpinning on update * commented code for handling validation * make expiration date required * add waiting before continueing with other updates * handle fcv during creation * add support for singular data source * add in plural data source * add changelog entry * add in cluster tpf schema * include docs for fcv * adding warning to provide reduce possibility of re-applying fcv * adding acceptance test * adjust changelog entry file * specify date format in docs * add step to verify incorrect format * add skipping in advanced_cluster tpf * add tpf limited implementation * adjust test and fix in plural data source to capture upgrade and downgrade * handle warning when expiration date has passed * add knowledge hub article reference * adding example * fix example formatting * add changelog for mongo_db_major_version fix * applying doc review changes * adding link to new docs page * applying doc review changes * pr review comments * extract checks into unified function * minor refactors * chore: Updates CHANGELOG.md for #2789 * chore: Supports setting `retain_backups_enabled` in adv_cluster TPF (#2866) * chore: Refactor advanced cluster tests and enhance compatibility handling for RetainBackupsEnabled * chore: Skip Migration tests and adjust checks to be compatible * chore: Update disk IOPS attribute handling for TPF compatibility and expose AttrNameToSchemaV2 * Update internal/testutil/acc/advanced_cluster_schema_v2.go Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * chore: Fix formatting in AttrNameToSchemaV2 function for consistency * chore: Rename function to better reflect its purpose in handling attribute state --------- Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> * doc: Updates Terraform Compatibility Matrix documentation (#2837) Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * feat: Support `pinned_fcv` in attribute in cluster resource and data sources (#2817) * add resource and data source implementations * apply docs changes * reuse checks from advanced cluster test for fcv pinning * simplify if * chore: Updates CHANGELOG.md for #2817 * chore: Bump golang.org/x/crypto from 0.29.0 to 0.31.0 (#2881) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.29.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.29.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Updates repository to use supported Terraform versions (#2883) Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> * chore: Makes test checks valid for SDKv2 and TPF (#2882) * enable data source tests removing calls to AdvancedClusterV2Schema * schemav2 helper check funcs * skip data sources checks in tpf * rename funcs to use schemav2 naming * implement check funcs for schema v2 * testCheckFuncAlwaysPass * move ConvertAdvancedClusterToSchemaV2 to config funcs * avoid relying on resource id and instead on attribute directly --------- Signed-off-by: dependabot[bot] Co-authored-by: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> Co-authored-by: Oriol Arbusi Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> Co-authored-by: svc-apix-bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Melanija Cvetic Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> Co-authored-by: Espen Albert Co-authored-by: Zuhair Ahmed Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Melissa Plunkett Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> Co-authored-by: Marco Suma Co-authored-by: Aastha Mahendru Co-authored-by: AgustinBettati <20469408+AgustinBettati@users.noreply.github.com> Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> Co-authored-by: Espen Albert Co-authored-by: Sérgio Silva * include clarifying comments for when older API versions are used * remove redundant new line * revert ordering changes in tpf schema model --------- Signed-off-by: dependabot[bot] Co-authored-by: cveticm <119604954+cveticm@users.noreply.github.com> Co-authored-by: Oriol Co-authored-by: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> Co-authored-by: Leo Antoli <430982+lantoli@users.noreply.github.com> Co-authored-by: carriecwk <107137496+carriecwk@users.noreply.github.com> Co-authored-by: svc-apix-bot Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Melanija Cvetic Co-authored-by: Espen Albert Co-authored-by: Zuhair Ahmed Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> Co-authored-by: Melissa Plunkett Co-authored-by: kanchana-mongodb <54281287+kanchana-mongodb@users.noreply.github.com> Co-authored-by: Marco Suma Co-authored-by: Aastha Mahendru Co-authored-by: AgustinBettati <20469408+AgustinBettati@users.noreply.github.com> Co-authored-by: lmkerbey-mdb <105309825+lmkerbey-mdb@users.noreply.github.com> Co-authored-by: Espen Albert Co-authored-by: Sérgio Silva --- .changelog/2814.txt | 3 + .changelog/2836.txt | 3 + docs/data-sources/advanced_cluster.md | 2 +- docs/data-sources/advanced_clusters.md | 2 +- .../advanced-cluster-new-sharding-schema.md | 86 +++++- docs/resources/advanced_cluster.md | 56 ++-- .../auto-scaling-per-shard/README.md | 63 ++++ .../auto-scaling-per-shard/main.tf | 71 +++++ .../auto-scaling-per-shard/variables.tf | 12 + .../auto-scaling-per-shard/versions.tf | 9 + internal/common/conversion/flatten_expand.go | 14 - .../data_source_advanced_cluster.go | 84 ++---- .../data_source_advanced_clusters.go | 129 +++------ .../advancedcluster/model_advanced_cluster.go | 123 ++++---- .../model_advanced_cluster_test.go | 46 +-- .../model_sdk_version_conversion.go | 270 +++++++++--------- .../model_sdk_version_conversion_test.go | 193 +++++++++++++ .../resource_advanced_cluster.go | 181 +++++------- ...esource_advanced_cluster_migration_test.go | 31 +- .../resource_advanced_cluster_test.go | 175 +++++++++++- .../advancedcluster/resource_update_logic.go | 13 +- .../resource_update_logic_test.go | 101 ++++--- internal/service/advancedclustertpf/README.md | 4 +- .../testutil/acc/independent_shard_scaling.go | 49 ++++ 24 files changed, 1131 insertions(+), 589 deletions(-) create mode 100644 .changelog/2814.txt create mode 100644 .changelog/2836.txt create mode 100644 examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/README.md create mode 100644 examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/main.tf create mode 100644 examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/variables.tf create mode 100644 examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/versions.tf create mode 100644 internal/service/advancedcluster/model_sdk_version_conversion_test.go create mode 100644 internal/testutil/acc/independent_shard_scaling.go diff --git a/.changelog/2814.txt b/.changelog/2814.txt new file mode 100644 index 0000000000..71ab0a867c --- /dev/null +++ b/.changelog/2814.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/mongodbatlas_advanced_cluster: Adjusts update operation to support cluster tier auto scaling per shard. +``` diff --git a/.changelog/2836.txt b/.changelog/2836.txt new file mode 100644 index 0000000000..5cc1efb27f --- /dev/null +++ b/.changelog/2836.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/mongodbatlas_advanced_cluster: Adjusts create operation to support cluster tier auto scaling per shard. +``` diff --git a/docs/data-sources/advanced_cluster.md b/docs/data-sources/advanced_cluster.md index 48a80bd0c8..bfce0ff9c2 100644 --- a/docs/data-sources/advanced_cluster.md +++ b/docs/data-sources/advanced_cluster.md @@ -139,7 +139,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. +* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. This value is not populated (empty string) when a sharded cluster has independently scaled shards. * `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI. When using old sharding configuration (replication spec with `num_shards` greater than 1) this value is not populated. * `num_shards` - Provide this value if you set a `cluster_type` of `SHARDED` or `GEOSHARDED`. **(DEPRECATED.)** To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide.html.markdown). * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) diff --git a/docs/data-sources/advanced_clusters.md b/docs/data-sources/advanced_clusters.md index d739aaa3a8..2759de71a8 100644 --- a/docs/data-sources/advanced_clusters.md +++ b/docs/data-sources/advanced_clusters.md @@ -141,7 +141,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. +* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. This value is not populated (empty string) when a sharded cluster has independently scaled shards. * `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI. When using old sharding configuration (replication spec with `num_shards` greater than 1) this value is not populated. * `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. **(DEPRECATED.)** To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide.html.markdown) for more details. * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) diff --git a/docs/guides/advanced-cluster-new-sharding-schema.md b/docs/guides/advanced-cluster-new-sharding-schema.md index 3f7a18c5d7..1eefd70bd4 100644 --- a/docs/guides/advanced-cluster-new-sharding-schema.md +++ b/docs/guides/advanced-cluster-new-sharding-schema.md @@ -4,7 +4,7 @@ page_title: "Migration Guide: Advanced Cluster New Sharding Configurations" # Migration Guide: Advanced Cluster New Sharding Configurations -**Objective**: Use this guide to migrate your existing `advanced_cluster` resources to support new sharding configurations introduced in version 1.18.0. The new sharding configurations allow you to scale shards independently. Existing sharding configurations continue to work, but you will receive deprecation messages if you continue to use them. +**Objective**: Use this guide to migrate your existing `advanced_cluster` resources to support new sharding configurations introduced in version 1.18.0. The new sharding configurations allow you to scale shards independently. Additionally, as of version 1.23.0, compute auto-scaling supports scaling instance sizes independently for each shard when using the new sharding configuration. Existing sharding configurations continue to work, but you will receive deprecation messages if you continue to use them. Note: Once applied, the `advanced_cluster` resource making use of the new sharding configuration will not be able to transition back to the old sharding configuration. @@ -13,7 +13,8 @@ Note: Once applied, the `advanced_cluster` resource making use of the new shardi - [Migrate advanced\_cluster type `SHARDED`](#migrate-advanced_cluster-type-sharded) - [Migrate advanced\_cluster type `GEOSHARDED`](#migrate-advanced_cluster-type-geosharded) - [Migrate advanced\_cluster type `REPLICASET`](#migrate-advanced_cluster-type-replicaset) - - [Use Independent Shard Scaling](#use-independent-shard-scaling) +- [Use Independent Shard Scaling](#use-independent-shard-scaling) +- [Use Auto-Scaling Per Shard](#use-auto-scaling-per-shard) ## Changes Overview @@ -287,7 +288,7 @@ resource "mongodbatlas_advanced_cluster" "test" { Note: The first time `terraform apply` command is run **after** updating the configuration, you may receive a `500 Internal Server Error (Error code: "SERVICE_UNAVAILABLE")` error. This is a known temporary issue. If you encounter this, please re-run `terraform apply` and this time the update should succeed. -### Use Independent Shard Scaling +## Use Independent Shard Scaling Use the new sharding configurations. Each shard must be represented with a unique `replication_specs` element and `num_shards` must not be used, as illustrated in the following example. @@ -323,7 +324,7 @@ resource "mongodbatlas_advanced_cluster" "test" { } ``` -With each shard's `replication_specs` defined independently, we can now define distinct `instance_size`, and `disk_iops` (only for AWS) values for each shard in the cluster. In the following example, we define an upgraded instance size of M40 only for the first shard in the cluster. +With each shard's `replication_specs` defined independently, we can now define distinct `instance_size` and `disk_iops` values for each shard in the cluster. Note that independent `disk_iops` values are only supported for AWS provisioned IOPS, or Azure regions that support Extended IOPS. In the following example, we define an upgraded instance size of M40 only for the first shard in the cluster. Consider reviewing the Metrics Dashboard in the MongoDB Atlas UI (e.g. https://cloud.mongodb.com/v2/#/clusters/detail/ShardedCluster) for insight into how each shard within your cluster is currently performing, which will inform any shard-specific resource allocation changes you might require. @@ -360,3 +361,80 @@ resource "mongodbatlas_advanced_cluster" "test" { ``` -> **NOTE:** For any cluster leveraging the new sharding configurations and defining independently scaled shards, users should also update corresponding `mongodbatlas_cloud_backup_schedule` resource & data sources. This involves updating any existing Terraform configurations of the resource to use `copy_settings.#.zone_id` instead of `copy_settings.#.replication_spec_id`. This is needed as `mongodbatlas_advanced_cluster` resource and data source will no longer have `replication_specs.#.id` present when shards are scaled independently. To learn more, review the [1.18.0 Migration Guide](1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones). + + +## Use Auto-Scaling Per Shard + +As of version 1.23.0, enabled `compute` auto-scaling (either `auto_scaling` or `analytics_auto_scaling`) will scale the `instance_size` of each shard independently. Each shard must be represented with a unique `replication_specs` element and `num_shards` must not be used. On the contrary, if using deprecated `num_shards` or a lower version, enabled compute auto-scaling will scale uniformily across all shards in the cluster. + +The following example illustrates a configuration that has compute auto-scaling per shard for electable and analytic nodes. + +``` +resource "mongodbatlas_advanced_cluster" "test" { + project_id = var.project_id + name = "AutoScalingCluster" + cluster_type = "SHARDED" + replication_specs { # first shard + region_configs { + electable_specs { + instance_size = "M40" + node_count = 3 + } + analytics_specs { + instance_size = "M40" + node_count = 1 + } + auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + analytics_auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + } + zone_name = "Zone 1" + } + replication_specs { # second shard + region_configs { + electable_specs { + instance_size = "M40" + node_count = 3 + } + analytics_specs { + instance_size = "M40" + node_count = 1 + } + auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + analytics_auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + } + zone_name = "Zone 1" + } + lifecycle { # avoids future non-empty plans as instance size start to scale from initial values + ignore_changes = [ + replication_specs[0].region_configs[0].electable_specs[0].instance_size, + replication_specs[0].region_configs[0].analytics_specs[0].instance_size, + replication_specs[1].region_configs[0].electable_specs[0].instance_size, + replication_specs[1].region_configs[0].analytics_specs[0].instance_size + ] + } +} +``` + +While the example initially defines 2 symmetric shards, auto-scaling of `electable_specs` or `analytic_specs` can lead to asymmetric shards due to changes in `instance_size`. + +-> **NOTE:** After you upgrade to version 1.23.0 of the provider, you must update the cluster configuration to activate the auto-scaling per shard feature. + +-> **NOTE:** When auto-scaling per shard, it is possible that the cluster will transition to having asymmetric shards. This will impact the computed attribute `replication_specs.#.id`, which is not populated when shards are scaled independently. Please make sure to update the corresponding `mongodbatlas_cloud_backup_schedule` resource & data sources. This involves updating any existing Terraform configurations of the resource to use `copy_settings.#.zone_id` instead of `copy_settings.#.replication_spec_id`. To learn more, review the [1.18.0 Migration Guide](1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones). diff --git a/docs/resources/advanced_cluster.md b/docs/resources/advanced_cluster.md index d9950b581f..03cbee9022 100644 --- a/docs/resources/advanced_cluster.md +++ b/docs/resources/advanced_cluster.md @@ -537,7 +537,7 @@ replication_specs { } ``` -* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. +* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. This value is not populated (empty string) when a sharded cluster has independently scaled shards. * `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI. When using old sharding configuration (replication spec with `num_shards` greater than 1) this value is not populated. * `num_shards` - (Optional) Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. Omit this value if you selected a `cluster_type` of REPLICASET. This API resource accepts 1 through 50, inclusive. This parameter defaults to 1. If you specify a `num_shards` value of 1 and a `cluster_type` of SHARDED, Atlas deploys a single-shard [sharded cluster](https://docs.atlas.mongodb.com/reference/glossary/#std-term-sharded-cluster). Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards. To learn more, see [Convert a replica set to a sharded cluster documentation](https://www.mongodb.com/docs/atlas/scale-cluster/#convert-a-replica-set-to-a-sharded-cluster) and [Convert a replica set to a sharded cluster tutorial](https://www.mongodb.com/docs/upcoming/tutorial/convert-replica-set-to-replicated-shard-cluster). **(DEPRECATED)** To learn more, see the [1.18.0 Upgrade Guide](../guides/1.18.0-upgrade-guide.html.markdown). @@ -549,8 +549,8 @@ If you are upgrading a replica set to a sharded cluster, you cannot increase the ### region_configs * `analytics_specs` - (Optional) Hardware specifications for [analytics nodes](https://docs.atlas.mongodb.com/reference/faq/deployment/#std-label-analytics-nodes-overview) needed in the region. Analytics nodes handle analytic data such as reporting queries from BI Connector for Atlas. Analytics nodes are read-only and can never become the [primary](https://docs.atlas.mongodb.com/reference/glossary/#std-term-primary). If you don't specify this parameter, no analytics nodes deploy to this region. See [below](#specs) -* `auto_scaling` - (Optional) Configuration for the Collection of settings that configures auto-scaling information for the cluster. The values for the `auto_scaling` parameter must be the same for all `region_configs` in all `replication_specs`. See [below](#auto_scaling) -* `analytics_auto_scaling` - (Optional) Configuration for the Collection of settings that configures analytics-auto-scaling information for the cluster. The values for the `analytics_auto_scaling` parameter must be the same for all `region_configs` in all `replication_specs`. See [below](#analytics_auto_scaling) +* `auto_scaling` - (Optional) Configuration for the collection of settings that configures auto-scaling information for the cluster. The values for the `auto_scaling` attribute must be the same for all `region_configs` of a cluster. See [below](#auto_scaling) +* `analytics_auto_scaling` - (Optional) Configuration for the Collection of settings that configures analytics-auto-scaling information for the cluster. The values for the `analytics_auto_scaling` attribute must be the same for all `region_configs` of a cluster. See [below](#analytics_auto_scaling) * `backing_provider_name` - (Optional) Cloud service provider on which you provision the host for a multi-tenant cluster. Use this only when a `provider_name` is `TENANT` and `instance_size` of a specs is `M2` or `M5`. * `electable_specs` - (Optional) Hardware specifications for electable nodes in the region. Electable nodes can become the [primary](https://docs.atlas.mongodb.com/reference/glossary/#std-term-primary) and can enable local reads. If you do not specify this option, no electable nodes are deployed to the region. See [below](#specs) * `priority` - (Optional) Election priority of the region. For regions with only read-only nodes, set this value to 0. @@ -600,16 +600,12 @@ If you are upgrading a replica set to a sharded cluster, you cannot increase the ### auto_scaling * `disk_gb_enabled` - (Optional) Flag that indicates whether this cluster enables disk auto-scaling. This parameter defaults to false. - - Set to `true` to enable disk auto-scaling. - - Set to `false` to disable disk auto-scaling. -~> **IMPORTANT:** If `disk_gb_enabled` is true, Atlas automatically scales the cluster up or down. -This will cause the value of `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` returned to potentially be different than what is specified in the Terraform config and if you use, and then apply, not noting this, Terraform will scale the cluster disk size back to the original `disk_size_gb` value. -To prevent disk scaling use a lifecycle customization: -`lifecycle { - ignore_changes = [replication_specs.#.region_config.#.electable_specs.disk_size_gb] -}` -After adding the `lifecycle` block to explicitly change `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes. +* `compute_enabled` - (Optional) Flag that indicates whether instance size auto-scaling is enabled. This parameter defaults to false. If a sharded cluster is making use of the [New Sharding Configuration](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema), auto-scaling of the instance size will be independent for each individual shard. Please reference the [Use Auto-Scaling Per Shard](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema#use-auto-scaling-per-shard) section for more details. On the contrary, if a sharded cluster makes use of deprecated `num_shards` attribute (with values > 1), instance size auto-scaling will be performed uniformly across all shards in the cluster. + +~> **IMPORTANT:** If `disk_gb_enabled` or `compute_enabled` is true, Atlas automatically scales the cluster up or down. +This will cause the value of `replication_specs.#.region_config.#.(electable_specs|read_only_specs).disk_size_gb` or `replication_specs.#.region_config.#.(electable_specs|read_only_specs).instance_size` returned to potentially be different than what is specified in the Terraform config. If you then apply a plan, not noting this, Terraform will scale the cluster back to the original values in the config. +To prevent unintended changes when enabling autoscaling, use a lifecycle ignore customization as shown in the example below. To explicitly change `disk_size_gb` or `instance_size` values, comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes. ```terraform // Example: ignore disk_size_gb and instance_size changes in a replica set @@ -617,22 +613,10 @@ lifecycle { ignore_changes = [ replication_specs[0].region_configs[0].electable_specs[0].disk_size_gb, replication_specs[0].region_configs[0].electable_specs[0].instance_size, - replication_specs[0].region_configs[1].electable_specs[0].instance_size, - replication_specs[0].region_configs[2].electable_specs[0].instance_size, ] } ``` -* `compute_enabled` - (Optional) Flag that indicates whether instance size auto-scaling is enabled. This parameter defaults to false. - -~> **IMPORTANT:** If `compute_enabled` is true, Atlas automatically scales the cluster to the maximum provided and down to the minimum, if provided. -This will cause the value of `instance_size` returned to potentially be different than what is specified in the Terraform config and if you then apply a plan, not noting this, Terraform will scale the cluster back to the original `instance_size` value. -To prevent disk scaling, use a lifecycle customization, as in the following example: -`lifecycle { - ignore_changes = [instance_size] -}` -After adding the `lifecycle` block to explicitly change `instance_size` comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes. - * `compute_scale_down_enabled` - (Optional) Flag that indicates whether the instance size may scale down. Atlas requires this parameter if `replication_specs.#.region_configs.#.auto_scaling.0.compute_enabled` : true. If you enable this option, specify a value for `replication_specs.#.region_configs.#.auto_scaling.0.compute_min_instance_size`. * `compute_min_instance_size` - (Optional) Minimum instance size to which your cluster can automatically scale (such as M10). Atlas requires this parameter if `replication_specs.#.region_configs.#.auto_scaling.0.compute_scale_down_enabled` is true. * `compute_max_instance_size` - (Optional) Maximum instance size to which your cluster can automatically scale (such as M40). Atlas requires this parameter if `replication_specs.#.region_configs.#.auto_scaling.0.compute_enabled` is true. @@ -640,15 +624,21 @@ After adding the `lifecycle` block to explicitly change `instance_size` comment ### analytics_auto_scaling * `disk_gb_enabled` - (Optional) Flag that indicates whether this cluster enables disk auto-scaling. This parameter defaults to false. -* `compute_enabled` - (Optional) Flag that indicates whether instance size auto-scaling is enabled. This parameter defaults to false. - -~> **IMPORTANT:** If `compute_enabled` is true, then Atlas will automatically scale up to the maximum provided and down to the minimum, if provided. -This will cause the value of `instance_size` returned to potential be different than what is specified in the Terraform config and if you then apply a plan, not noting this, Terraform will scale the cluster back down to the original `instance_size` value. -To prevent compute scaling, use a lifecycle customization, as in the following example: -`lifecycle { - ignore_changes = [instance_size] -}` -After adding the `lifecycle` block to explicitly change `instance_size` comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes. +* `compute_enabled` - (Optional) Flag that indicates whether analytics instance size auto-scaling is enabled. This parameter defaults to false. If a sharded cluster is making use of the [New Sharding Configuration](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema), auto-scaling of analytics instance size will be independent for each individual shard. Please reference the [Use Auto-Scaling Per Shard](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema#use-auto-scaling-per-shard) section for more details. On the contrary, if a sharded cluster makes use of deprecated `num_shards` attribute (with values > 1), analytics instance size auto-scaling will be performed uniformily across all shards in the cluster. + +~> **IMPORTANT:** If `disk_gb_enabled` or `compute_enabled` is true, Atlas automatically scales the cluster up or down. +This will cause the value of `replication_specs.#.region_config.#.analytics_specs.0.disk_size_gb` or `replication_specs.#.region_config.#.analytics_specs.0.instance_size` returned to potentially be different than what is specified in the Terraform config. If you then apply a plan, not noting this, Terraform will scale the cluster back to the original values in the config. +To prevent unintended changes when enabling autoscaling, use a lifecycle ignore customization as shown in the example below. To explicitly change `disk_size_gb` or `instance_size` values, comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes. + +```terraform +// Example: ignore disk_size_gb and instance_size changes in a replica set +lifecycle { + ignore_changes = [ + replication_specs[0].region_configs[0].analytics_specs[0].disk_size_gb, + replication_specs[0].region_configs[0].analytics_specs[0].instance_size, + ] +} +``` * `compute_scale_down_enabled` - (Optional) Flag that indicates whether the instance size may scale down. Atlas requires this parameter if `replication_specs.#.region_configs.#.analytics_auto_scaling.0.compute_enabled` : true. If you enable this option, specify a value for `replication_specs.#.region_configs.#.analytics_auto_scaling.0.compute_min_instance_size`. * `compute_min_instance_size` - (Optional) Minimum instance size to which your cluster can automatically scale (such as M10). Atlas requires this parameter if `replication_specs.#.region_configs.#.analytics_auto_scaling.0.compute_scale_down_enabled` is true. diff --git a/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/README.md b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/README.md new file mode 100644 index 0000000000..8ea9c7bbe8 --- /dev/null +++ b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/README.md @@ -0,0 +1,63 @@ +# MongoDB Atlas Provider -- Sharded Cluster with Independent Shard Auto-scaling + +This example creates a Sharded Cluster with 2 shards defining electable and analytics nodes. Compute auto-scaling is enabled for both `electable_specs` and `analytics_specs`, while also leveraging the [New Sharding Configuration](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema) by defining each shard with its individual `replication_specs`. This enables scaling of each shard to be independent. Please reference the [Use Auto-Scaling Per Shard](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema#use-auto-scaling-per-shard) section for more details. + + +## Dependencies + +* Terraform MongoDB Atlas Provider v1.23.0 +* A MongoDB Atlas account + +``` +Terraform >= 0.13 ++ provider registry.terraform.io/terraform-providers/mongodbatlas v1.23.0 +``` + + +## Usage +**1\. If you haven't already, set up your MongoDB Atlas credentials.** + +This can be done using environment variables: + +```bash +export MONGODB_ATLAS_PUBLIC_KEY="xxxx" +export MONGODB_ATLAS_PRIVATE_KEY="xxxx" +``` + +... or follow as in the `variables.tf` file and create **terraform.tfvars** file with all the variable values, ex: +``` +public_key = "" +private_key = "" +atlas_org_id = "" +``` + +Alternatively, you can use [AWS Secrets Manager](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/website/docs/index.html.markdown#aws-secrets-manager). + +**2\. Review the Terraform plan.** + +Execute the below command and ensure you are happy with the plan. + +``` bash +$ terraform plan +``` +This project currently supports the below deployments: + +- An Atlas Project +- A Sharded Cluster with independent shards with varying cluster tiers + +**3\. Apply your changes.** + +Now execute the plan to provision the Atlas Project and Cluster resources. + +``` bash +$ terraform apply +``` + +**4\. Destroy the resources.** + +Once you are finished your testing, ensure you destroy the resources to avoid unnecessary Atlas charges. + +``` bash +$ terraform destroy +``` + diff --git a/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/main.tf b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/main.tf new file mode 100644 index 0000000000..a628d19e4c --- /dev/null +++ b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/main.tf @@ -0,0 +1,71 @@ +provider "mongodbatlas" { + public_key = var.public_key + private_key = var.private_key +} + +resource "mongodbatlas_advanced_cluster" "test" { + project_id = mongodbatlas_project.project.id + name = "AutoScalingCluster" + cluster_type = "SHARDED" + replication_specs { # first shard + region_configs { + auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + analytics_auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + electable_specs { + instance_size = "M40" + node_count = 3 + } + analytics_specs { + instance_size = "M40" + node_count = 1 + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + } + zone_name = "Zone 1" + } + replication_specs { # second shard + region_configs { + auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + analytics_auto_scaling { + compute_enabled = true + compute_max_instance_size = "M60" + } + electable_specs { + instance_size = "M40" + node_count = 3 + } + analytics_specs { + instance_size = "M40" + node_count = 1 + } + provider_name = "AWS" + priority = 7 + region_name = "EU_WEST_1" + } + zone_name = "Zone 1" + } + lifecycle { # avoids non-empty plans as instance size start to scale from initial values + ignore_changes = [ + replication_specs[0].region_configs[0].electable_specs[0].instance_size, + replication_specs[0].region_configs[0].analytics_specs[0].instance_size, + replication_specs[1].region_configs[0].electable_specs[0].instance_size, + replication_specs[1].region_configs[0].analytics_specs[0].instance_size + ] + } +} + +resource "mongodbatlas_project" "project" { + name = "AutoScalingPerShardCluster" + org_id = var.atlas_org_id +} diff --git a/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/variables.tf b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/variables.tf new file mode 100644 index 0000000000..d34c0ba2be --- /dev/null +++ b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/variables.tf @@ -0,0 +1,12 @@ +variable "atlas_org_id" { + description = "Atlas organization id" + type = string +} +variable "public_key" { + description = "Public API key to authenticate to Atlas" + type = string +} +variable "private_key" { + description = "Private API key to authenticate to Atlas" + type = string +} diff --git a/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/versions.tf b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/versions.tf new file mode 100644 index 0000000000..f4f37e1912 --- /dev/null +++ b/examples/mongodbatlas_advanced_cluster/auto-scaling-per-shard/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_providers { + mongodbatlas = { + source = "mongodb/mongodbatlas" + version = "~> 1.22" + } + } + required_version = ">= 1.0" +} diff --git a/internal/common/conversion/flatten_expand.go b/internal/common/conversion/flatten_expand.go index 16c1d676f1..2f407a8c97 100644 --- a/internal/common/conversion/flatten_expand.go +++ b/internal/common/conversion/flatten_expand.go @@ -3,7 +3,6 @@ package conversion import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) @@ -29,19 +28,6 @@ func FlattenTags(tags []admin.ResourceTag) []map[string]string { return ret } -func ExpandTagsFromSetSchemaV220240805(d *schema.ResourceData) *[]admin20240805.ResourceTag { - list := d.Get("tags").(*schema.Set) - ret := make([]admin20240805.ResourceTag, list.Len()) - for i, item := range list.List() { - tag := item.(map[string]any) - ret[i] = admin20240805.ResourceTag{ - Key: tag["key"].(string), - Value: tag["value"].(string), - } - } - return &ret -} - func ExpandTagsFromSetSchema(d *schema.ResourceData) *[]admin.ResourceTag { list := d.Get("tags").(*schema.Set) ret := make([]admin.ResourceTag, list.Len()) diff --git a/internal/service/advancedcluster/data_source_advanced_cluster.go b/internal/service/advancedcluster/data_source_advanced_cluster.go index e49c08c113..5299c62603 100644 --- a/internal/service/advancedcluster/data_source_advanced_cluster.go +++ b/internal/service/advancedcluster/data_source_advanced_cluster.go @@ -5,10 +5,9 @@ import ( "fmt" "net/http" - admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) @@ -288,80 +287,43 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag. clusterName := d.Get("name").(string) useReplicationSpecPerShard := false var replicationSpecs []map[string]any - var clusterID string if v, ok := d.GetOk("use_replication_spec_per_shard"); ok { useReplicationSpecPerShard = v.(bool) } - if !useReplicationSpecPerShard { - clusterDescOld, resp, err := connV220240530.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if resp != nil { - if resp.StatusCode == http.StatusNotFound { - return nil - } - if admin20240530.IsErrorCode(err, "ASYMMETRIC_SHARD_UNSUPPORTED") { - return diag.FromErr(fmt.Errorf("please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details. %s", err)) - } - } - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) - } - - clusterID = clusterDescOld.GetId() - - if err := d.Set("disk_size_gb", clusterDescOld.GetDiskSizeGB()); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "disk_size_gb", clusterName, err)) - } - clusterDescNew, _, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + clusterDesc, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil } - - zoneNameToZoneIDs, err := getZoneIDsFromNewAPI(clusterDescNew) - if err != nil { + return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + } + zoneNameToOldReplicationSpecMeta, err := GetReplicationSpecAttributesFromOldAPI(ctx, projectID, clusterName, connV220240530.ClustersApi) + if err != nil { + if apiError, ok := admin20240530.AsError(err); !ok { return diag.FromErr(err) + } else if apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" && !useReplicationSpecPerShard { + return diag.FromErr(fmt.Errorf("please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details. %s", err)) + } else if apiError.GetErrorCode() != "ASYMMETRIC_SHARD_UNSUPPORTED" { + return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) } + } + diags := setRootFields(d, clusterDesc, false) + if diags.HasError() { + return diags + } - replicationSpecs, err = FlattenAdvancedReplicationSpecsOldSDK(ctx, clusterDescOld.GetReplicationSpecs(), zoneNameToZoneIDs, clusterDescOld.GetDiskSizeGB(), d.Get("replication_specs").([]any), d, connV2) + if !useReplicationSpecPerShard { + replicationSpecs, err = FlattenAdvancedReplicationSpecsOldShardingConfig(ctx, clusterDesc.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, d.Get("replication_specs").([]any), d, connV2) if err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replication_specs", clusterName, err)) } - - diags := setRootFields(d, clusterDescNew, false) - if diags.HasError() { - return diags - } } else { - clusterDescLatest, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - return nil - } - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) - } - - clusterID = clusterDescLatest.GetId() - - // root disk_size_gb defined for backwards compatibility avoiding breaking changes - if err := d.Set("disk_size_gb", GetDiskSizeGBFromReplicationSpec(clusterDescLatest)); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "disk_size_gb", clusterName, err)) - } - - zoneNameToOldReplicationSpecIDs, err := getReplicationSpecIDsFromOldAPI(ctx, projectID, clusterName, connV220240530) - if err != nil { - return diag.FromErr(err) - } - - replicationSpecs, err = flattenAdvancedReplicationSpecsDS(ctx, clusterDescLatest.GetReplicationSpecs(), zoneNameToOldReplicationSpecIDs, d, connV2) + replicationSpecs, err = flattenAdvancedReplicationSpecsDS(ctx, clusterDesc.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, d, connV2) if err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replication_specs", clusterName, err)) } - - diags := setRootFields(d, clusterDescLatest, false) - if diags.HasError() { - return diags - } } if err := d.Set("replication_specs", replicationSpecs); err != nil { @@ -381,6 +343,6 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag. return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "advanced_configuration", clusterName, err)) } - d.SetId(clusterID) + d.SetId(clusterDesc.GetId()) return nil } diff --git a/internal/service/advancedcluster/data_source_advanced_clusters.go b/internal/service/advancedcluster/data_source_advanced_clusters.go index d3cbb1875a..90cc4ab867 100644 --- a/internal/service/advancedcluster/data_source_advanced_clusters.go +++ b/internal/service/advancedcluster/data_source_advanced_clusters.go @@ -308,41 +308,25 @@ func dataSourcePluralRead(ctx context.Context, d *schema.ResourceData, meta any) useReplicationSpecPerShard = v.(bool) } - if !useReplicationSpecPerShard { - list, resp, err := connV220240530.ClustersApi.ListClusters(ctx, projectID).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - return nil - } - return diag.FromErr(fmt.Errorf(errorListRead, projectID, err)) - } - results, diags := flattenAdvancedClustersOldSDK(ctx, connV220240530, connV2, list.GetResults(), d) - if len(diags) > 0 { - return diags - } - if err := d.Set("results", results); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "results", d.Id(), err)) - } - } else { - list, resp, err := connV2.ClustersApi.ListClusters(ctx, projectID).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - return nil - } - return diag.FromErr(fmt.Errorf(errorListRead, projectID, err)) - } - results, diags := flattenAdvancedClusters(ctx, connV220240530, connV2, list.GetResults(), d) - if len(diags) > 0 { - return diags - } - if err := d.Set("results", results); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "results", d.Id(), err)) + list, resp, err := connV2.ClustersApi.ListClusters(ctx, projectID).Execute() + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + return nil } + return diag.FromErr(fmt.Errorf(errorListRead, projectID, err)) + } + results, diags := flattenAdvancedClusters(ctx, connV220240530, connV2, list.GetResults(), d, useReplicationSpecPerShard) + if len(diags) > 0 { + return diags } + if err := d.Set("results", results); err != nil { + return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "results", d.Id(), err)) + } + return nil } -func flattenAdvancedClusters(ctx context.Context, connV220240530 *admin20240530.APIClient, connV2 *admin.APIClient, clusters []admin.ClusterDescription20240805, d *schema.ResourceData) ([]map[string]any, diag.Diagnostics) { +func flattenAdvancedClusters(ctx context.Context, connV220240530 *admin20240530.APIClient, connV2 *admin.APIClient, clusters []admin.ClusterDescription20240805, d *schema.ResourceData, useReplicationSpecPerShard bool) ([]map[string]any, diag.Diagnostics) { results := make([]map[string]any, 0, len(clusters)) for i := range clusters { cluster := &clusters[i] @@ -355,14 +339,29 @@ func flattenAdvancedClusters(ctx context.Context, connV220240530 *admin20240530. log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", cluster.GetId(), err) } - zoneNameToOldReplicationSpecIDs, err := getReplicationSpecIDsFromOldAPI(ctx, cluster.GetGroupId(), cluster.GetName(), connV220240530) + zoneNameToOldReplicationSpecMeta, err := GetReplicationSpecAttributesFromOldAPI(ctx, cluster.GetGroupId(), cluster.GetName(), connV220240530.ClustersApi) if err != nil { - return nil, diag.FromErr(err) + if apiError, ok := admin20240530.AsError(err); !ok { + return nil, diag.FromErr(err) + } else if apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" && !useReplicationSpecPerShard { + continue + } else if apiError.GetErrorCode() != "ASYMMETRIC_SHARD_UNSUPPORTED" { + return nil, diag.FromErr(err) + } } - replicationSpecs, err := flattenAdvancedReplicationSpecsDS(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecIDs, d, connV2) - if err != nil { - log.Printf("[WARN] Error setting `replication_specs` for the cluster(%s): %s", cluster.GetId(), err) + var replicationSpecs []map[string]any + + if !useReplicationSpecPerShard { + replicationSpecs, err = FlattenAdvancedReplicationSpecsOldShardingConfig(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, nil, d, connV2) + if err != nil { + log.Printf("[WARN] Error setting `replication_specs` for the cluster(%s): %s", cluster.GetId(), err) + } + } else { + replicationSpecs, err = flattenAdvancedReplicationSpecsDS(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, d, connV2) + if err != nil { + log.Printf("[WARN] Error setting `replication_specs` for the cluster(%s): %s", cluster.GetId(), err) + } } result := map[string]any{ @@ -397,63 +396,3 @@ func flattenAdvancedClusters(ctx context.Context, connV220240530 *admin20240530. } return results, nil } - -func flattenAdvancedClustersOldSDK(ctx context.Context, connV20240530 *admin20240530.APIClient, connV2 *admin.APIClient, clusters []admin20240530.AdvancedClusterDescription, d *schema.ResourceData) ([]map[string]any, diag.Diagnostics) { - results := make([]map[string]any, 0, len(clusters)) - for i := range clusters { - cluster := &clusters[i] - processArgs20240530, _, err := connV20240530.ClustersApi.GetClusterAdvancedConfiguration(ctx, cluster.GetGroupId(), cluster.GetName()).Execute() - if err != nil { - log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", cluster.GetId(), err) - } - processArgs, _, err := connV2.ClustersApi.GetClusterAdvancedConfiguration(ctx, cluster.GetGroupId(), cluster.GetName()).Execute() - if err != nil { - log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", cluster.GetId(), err) - } - - clusterDescNew, _, err := connV2.ClustersApi.GetCluster(ctx, cluster.GetGroupId(), cluster.GetName()).Execute() - if err != nil { - return nil, diag.FromErr(err) - } - zoneNameToZoneIDs, err := getZoneIDsFromNewAPI(clusterDescNew) - if err != nil { - return nil, diag.FromErr(err) - } - - replicationSpecs, err := FlattenAdvancedReplicationSpecsOldSDK(ctx, cluster.GetReplicationSpecs(), zoneNameToZoneIDs, cluster.GetDiskSizeGB(), nil, d, connV2) - if err != nil { - log.Printf("[WARN] Error setting `replication_specs` for the cluster(%s): %s", cluster.GetId(), err) - } - - result := map[string]any{ - "advanced_configuration": flattenProcessArgs(processArgs20240530, processArgs), - "backup_enabled": cluster.GetBackupEnabled(), - "bi_connector_config": flattenBiConnectorConfig(convertBiConnectToLatest(cluster.BiConnector)), - "cluster_type": cluster.GetClusterType(), - "create_date": conversion.TimePtrToStringPtr(cluster.CreateDate), - "connection_strings": flattenConnectionStrings(*convertConnectionStringToLatest(cluster.ConnectionStrings)), - "disk_size_gb": cluster.GetDiskSizeGB(), - "encryption_at_rest_provider": cluster.GetEncryptionAtRestProvider(), - "labels": flattenLabels(*convertLabelsToLatest(cluster.Labels)), - "tags": conversion.FlattenTags(convertTagsToLatest(cluster.GetTags())), - "mongo_db_version": cluster.GetMongoDBVersion(), - "name": cluster.GetName(), - "paused": cluster.GetPaused(), - "pit_enabled": cluster.GetPitEnabled(), - "replication_specs": replicationSpecs, - "root_cert_type": cluster.GetRootCertType(), - "state_name": cluster.GetStateName(), - "termination_protection_enabled": cluster.GetTerminationProtectionEnabled(), - "version_release_system": cluster.GetVersionReleaseSystem(), - "global_cluster_self_managed_sharding": cluster.GetGlobalClusterSelfManagedSharding(), - "mongo_db_major_version": clusterDescNew.GetMongoDBMajorVersion(), // uses 2024-08-05 as it has fix for correct value when FCV is active - "replica_set_scaling_strategy": clusterDescNew.GetReplicaSetScalingStrategy(), - "redact_client_log_data": clusterDescNew.GetRedactClientLogData(), - "config_server_management_mode": clusterDescNew.GetConfigServerManagementMode(), - "config_server_type": clusterDescNew.GetConfigServerType(), - "pinned_fcv": FlattenPinnedFCV(clusterDescNew), - } - results = append(results, result) - } - return results, nil -} diff --git a/internal/service/advancedcluster/model_advanced_cluster.go b/internal/service/advancedcluster/model_advanced_cluster.go index f4c872f680..3e9d9a35eb 100644 --- a/internal/service/advancedcluster/model_advanced_cluster.go +++ b/internal/service/advancedcluster/model_advanced_cluster.go @@ -12,7 +12,6 @@ import ( "strings" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" - admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -27,6 +26,11 @@ import ( const minVersionForChangeStreamOptions = 6.0 const minVersionForDefaultMaxTimeMS = 8.0 +type OldShardConfigMeta struct { + ID string + NumShard int +} + var ( DSTagsSchema = schema.Schema{ Type: schema.TypeSet, @@ -410,7 +414,7 @@ func flattenTags(tags *[]admin.ResourceTag) []map[string]string { } // CheckRegionConfigsPriorityOrder will be deleted in CLOUDP-275825 -func CheckRegionConfigsPriorityOrder(regionConfigs []admin20240805.ReplicationSpec20240805) error { +func CheckRegionConfigsPriorityOrder(regionConfigs []admin.ReplicationSpec20240805) error { for _, spec := range regionConfigs { configs := spec.GetRegionConfigs() for i := 0; i < len(configs)-1; i++ { @@ -492,11 +496,11 @@ func flattenBiConnectorConfig(biConnector *admin.BiConnector) []map[string]any { } } -func expandBiConnectorConfig(d *schema.ResourceData) *admin20240805.BiConnector { +func expandBiConnectorConfig(d *schema.ResourceData) *admin.BiConnector { if v, ok := d.GetOk("bi_connector_config"); ok { if biConn := v.([]any); len(biConn) > 0 { biConnMap := biConn[0].(map[string]any) - return &admin20240805.BiConnector{ + return &admin.BiConnector{ Enabled: conversion.Pointer(cast.ToBool(biConnMap["enabled"])), ReadPreference: conversion.StringPtr(cast.ToString(biConnMap["read_preference"])), } @@ -539,26 +543,50 @@ func flattenProcessArgs(p20240530 *admin20240530.ClusterDescriptionProcessArgs, return flattenedProcessArgs } -func FlattenAdvancedReplicationSpecsOldSDK(ctx context.Context, apiObjects []admin20240530.ReplicationSpec, zoneNameToZoneIDs map[string]string, rootDiskSizeGB float64, tfMapObjects []any, +func FlattenAdvancedReplicationSpecsOldShardingConfig(ctx context.Context, apiObjects []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecMeta map[string]OldShardConfigMeta, tfMapObjects []any, d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error) { - // for flattening old model we need information of value defined at root disk_size_gb so we set the value in new location under hardware specs - replicationSpecFlattener := func(ctx context.Context, sdkModel *admin20240530.ReplicationSpec, tfModel map[string]any, resourceData *schema.ResourceData, client *admin.APIClient) (map[string]any, error) { - return flattenAdvancedReplicationSpecOldSDK(ctx, sdkModel, zoneNameToZoneIDs, rootDiskSizeGB, tfModel, resourceData, connV2) + replicationSpecFlattener := func(ctx context.Context, sdkModel *admin.ReplicationSpec20240805, tfModel map[string]any, resourceData *schema.ResourceData, client *admin.APIClient) (map[string]any, error) { + return flattenAdvancedReplicationSpecOldShardingConfig(ctx, sdkModel, zoneNameToOldReplicationSpecMeta, tfModel, resourceData, connV2) } - return flattenAdvancedReplicationSpecsLogic[admin20240530.ReplicationSpec](ctx, apiObjects, tfMapObjects, d, - doesAdvancedReplicationSpecMatchAPIOldSDK, replicationSpecFlattener, connV2) + compressedAPIObjects := compressAPIObjectList(apiObjects) + return flattenAdvancedReplicationSpecsLogic(ctx, compressedAPIObjects, tfMapObjects, d, + doesAdvancedReplicationSpecMatchAPIOldShardConfig, replicationSpecFlattener, connV2) } -func flattenAdvancedReplicationSpecs(ctx context.Context, apiObjects []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecIDs map[string]string, tfMapObjects []any, +func flattenAdvancedReplicationSpecs(ctx context.Context, apiObjects []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecMeta map[string]OldShardConfigMeta, tfMapObjects []any, d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error) { // for flattening new model we need information of replication spec ids associated to old API to avoid breaking changes for users referencing replication_specs.*.id replicationSpecFlattener := func(ctx context.Context, sdkModel *admin.ReplicationSpec20240805, tfModel map[string]any, resourceData *schema.ResourceData, client *admin.APIClient) (map[string]any, error) { - return flattenAdvancedReplicationSpec(ctx, sdkModel, zoneNameToOldReplicationSpecIDs, tfModel, resourceData, connV2) + return flattenAdvancedReplicationSpec(ctx, sdkModel, zoneNameToOldReplicationSpecMeta, tfModel, resourceData, connV2) } - return flattenAdvancedReplicationSpecsLogic[admin.ReplicationSpec20240805](ctx, apiObjects, tfMapObjects, d, + return flattenAdvancedReplicationSpecsLogic(ctx, apiObjects, tfMapObjects, d, doesAdvancedReplicationSpecMatchAPI, replicationSpecFlattener, connV2) } +// compressAPIObjectList returns an array of ReplicationSpec20240805. The input array is reduced from all shards to only one shard per zoneName +func compressAPIObjectList(apiObjects []admin.ReplicationSpec20240805) []admin.ReplicationSpec20240805 { + var compressedAPIObjectList []admin.ReplicationSpec20240805 + wasZoneNameUsed := populateZoneNameMap(apiObjects) + for _, apiObject := range apiObjects { + if !wasZoneNameUsed[apiObject.GetZoneName()] { + compressedAPIObjectList = append(compressedAPIObjectList, apiObject) + wasZoneNameUsed[apiObject.GetZoneName()] = true + } + } + return compressedAPIObjectList +} + +// populateZoneNameMap returns a map of zoneNames and initializes all keys to false. +func populateZoneNameMap(apiObjects []admin.ReplicationSpec20240805) map[string]bool { + zoneNames := make(map[string]bool) + for _, apiObject := range apiObjects { + if _, exists := zoneNames[apiObject.GetZoneName()]; !exists { + zoneNames[apiObject.GetZoneName()] = false + } + } + return zoneNames +} + type ReplicationSpecSDKModel interface { admin20240530.ReplicationSpec | admin.ReplicationSpec20240805 } @@ -581,7 +609,6 @@ func flattenAdvancedReplicationSpecsLogic[T ReplicationSpecSDKModel]( if len(tfMapObjects) > i { tfMapObject = tfMapObjects[i].(map[string]any) } - for j := 0; j < len(apiObjects); j++ { if wasAPIObjectUsed[j] || !tfModelWithSDKMatcher(tfMapObject, &apiObjects[j]) { continue @@ -624,8 +651,8 @@ func flattenAdvancedReplicationSpecsLogic[T ReplicationSpecSDKModel]( return tfList, nil } -func doesAdvancedReplicationSpecMatchAPIOldSDK(tfObject map[string]any, apiObject *admin20240530.ReplicationSpec) bool { - return tfObject["id"] == apiObject.GetId() || (tfObject["id"] == nil && tfObject["zone_name"] == apiObject.GetZoneName()) +func doesAdvancedReplicationSpecMatchAPIOldShardConfig(tfObject map[string]any, apiObject *admin.ReplicationSpec20240805) bool { + return tfObject["zone_name"] == apiObject.GetZoneName() } func doesAdvancedReplicationSpecMatchAPI(tfObject map[string]any, apiObject *admin.ReplicationSpec20240805) bool { @@ -719,11 +746,11 @@ func hwSpecToDedicatedHwSpec(apiObject *admin.HardwareSpec20240805) *admin.Dedic } } -func dedicatedHwSpecToHwSpec(apiObject *admin20240805.DedicatedHardwareSpec20240805) *admin20240805.HardwareSpec20240805 { +func dedicatedHwSpecToHwSpec(apiObject *admin.DedicatedHardwareSpec20240805) *admin.HardwareSpec20240805 { if apiObject == nil { return nil } - return &admin20240805.HardwareSpec20240805{ + return &admin.HardwareSpec20240805{ DiskSizeGB: apiObject.DiskSizeGB, NodeCount: apiObject.NodeCount, DiskIOPS: apiObject.DiskIOPS, @@ -913,16 +940,16 @@ func IsDefaultMaxTimeMinRequiredMajorVersion(input *string) bool { return isMinRequiredMajorVersion(input, minVersionForDefaultMaxTimeMS) } -func expandLabelSliceFromSetSchema(d *schema.ResourceData) ([]admin20240805.ComponentLabel, diag.Diagnostics) { +func expandLabelSliceFromSetSchema(d *schema.ResourceData) ([]admin.ComponentLabel, diag.Diagnostics) { list := d.Get("labels").(*schema.Set) - res := make([]admin20240805.ComponentLabel, list.Len()) + res := make([]admin.ComponentLabel, list.Len()) for i, val := range list.List() { v := val.(map[string]any) key := v["key"].(string) if key == ignoreLabel { return nil, diag.FromErr(fmt.Errorf("you should not set `Infrastructure Tool` label, it is used for internal purposes")) } - res[i] = admin20240805.ComponentLabel{ + res[i] = admin.ComponentLabel{ Key: conversion.StringPtr(key), Value: conversion.StringPtr(v["value"].(string)), } @@ -930,8 +957,8 @@ func expandLabelSliceFromSetSchema(d *schema.ResourceData) ([]admin20240805.Comp return res, nil } -func expandAdvancedReplicationSpecs(tfList []any, rootDiskSizeGB *float64) *[]admin20240805.ReplicationSpec20240805 { - var apiObjects []admin20240805.ReplicationSpec20240805 +func expandAdvancedReplicationSpecs(tfList []any, rootDiskSizeGB *float64) *[]admin.ReplicationSpec20240805 { + var apiObjects []admin.ReplicationSpec20240805 for _, tfMapRaw := range tfList { tfMap, ok := tfMapRaw.(map[string]any) if !ok || tfMap == nil { @@ -968,8 +995,8 @@ func expandAdvancedReplicationSpecsOldSDK(tfList []any) *[]admin20240530.Replica return &apiObjects } -func expandAdvancedReplicationSpec(tfMap map[string]any, rootDiskSizeGB *float64) *admin20240805.ReplicationSpec20240805 { - apiObject := &admin20240805.ReplicationSpec20240805{ +func expandAdvancedReplicationSpec(tfMap map[string]any, rootDiskSizeGB *float64) *admin.ReplicationSpec20240805 { + apiObject := &admin.ReplicationSpec20240805{ ZoneName: conversion.StringPtr(tfMap["zone_name"].(string)), RegionConfigs: expandRegionConfigs(tfMap["region_configs"].([]any), rootDiskSizeGB), } @@ -991,8 +1018,8 @@ func expandAdvancedReplicationSpecOldSDK(tfMap map[string]any) *admin20240530.Re return apiObject } -func expandRegionConfigs(tfList []any, rootDiskSizeGB *float64) *[]admin20240805.CloudRegionConfig20240805 { - var apiObjects []admin20240805.CloudRegionConfig20240805 +func expandRegionConfigs(tfList []any, rootDiskSizeGB *float64) *[]admin.CloudRegionConfig20240805 { + var apiObjects []admin.CloudRegionConfig20240805 for _, tfMapRaw := range tfList { tfMap, ok := tfMapRaw.(map[string]any) if !ok || tfMap == nil { @@ -1007,9 +1034,9 @@ func expandRegionConfigs(tfList []any, rootDiskSizeGB *float64) *[]admin20240805 return &apiObjects } -func expandRegionConfig(tfMap map[string]any, rootDiskSizeGB *float64) *admin20240805.CloudRegionConfig20240805 { +func expandRegionConfig(tfMap map[string]any, rootDiskSizeGB *float64) *admin.CloudRegionConfig20240805 { providerName := tfMap["provider_name"].(string) - apiObject := &admin20240805.CloudRegionConfig20240805{ + apiObject := &admin.CloudRegionConfig20240805{ Priority: conversion.Pointer(cast.ToInt(tfMap["priority"])), ProviderName: conversion.StringPtr(providerName), RegionName: conversion.StringPtr(tfMap["region_name"].(string)), @@ -1036,9 +1063,9 @@ func expandRegionConfig(tfMap map[string]any, rootDiskSizeGB *float64) *admin202 return apiObject } -func expandRegionConfigSpec(tfList []any, providerName string, rootDiskSizeGB *float64) *admin20240805.DedicatedHardwareSpec20240805 { +func expandRegionConfigSpec(tfList []any, providerName string, rootDiskSizeGB *float64) *admin.DedicatedHardwareSpec20240805 { tfMap, _ := tfList[0].(map[string]any) - apiObject := new(admin20240805.DedicatedHardwareSpec20240805) + apiObject := new(admin.DedicatedHardwareSpec20240805) if providerName == constant.AWS || providerName == constant.AZURE { if v, ok := tfMap["disk_iops"]; ok && v.(int) > 0 { apiObject.DiskIOPS = conversion.Pointer(v.(int)) @@ -1068,11 +1095,11 @@ func expandRegionConfigSpec(tfList []any, providerName string, rootDiskSizeGB *f return apiObject } -func expandRegionConfigAutoScaling(tfList []any) *admin20240805.AdvancedAutoScalingSettings { +func expandRegionConfigAutoScaling(tfList []any) *admin.AdvancedAutoScalingSettings { tfMap, _ := tfList[0].(map[string]any) - settings := admin20240805.AdvancedAutoScalingSettings{ - DiskGB: new(admin20240805.DiskGBAutoScaling), - Compute: new(admin20240805.AdvancedComputeAutoScaling), + settings := admin.AdvancedAutoScalingSettings{ + DiskGB: new(admin.DiskGBAutoScaling), + Compute: new(admin.AdvancedComputeAutoScaling), } if v, ok := tfMap["disk_gb_enabled"]; ok { @@ -1099,7 +1126,7 @@ func expandRegionConfigAutoScaling(tfList []any) *admin20240805.AdvancedAutoScal return &settings } -func flattenAdvancedReplicationSpecsDS(ctx context.Context, apiRepSpecs []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecIDs map[string]string, d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error) { +func flattenAdvancedReplicationSpecsDS(ctx context.Context, apiRepSpecs []admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecMeta map[string]OldShardConfigMeta, d *schema.ResourceData, connV2 *admin.APIClient) ([]map[string]any, error) { if len(apiRepSpecs) == 0 { return nil, nil } @@ -1107,7 +1134,7 @@ func flattenAdvancedReplicationSpecsDS(ctx context.Context, apiRepSpecs []admin. tfList := make([]map[string]any, len(apiRepSpecs)) for i, apiRepSpec := range apiRepSpecs { - tfReplicationSpec, err := flattenAdvancedReplicationSpec(ctx, &apiRepSpec, zoneNameToOldReplicationSpecIDs, nil, d, connV2) + tfReplicationSpec, err := flattenAdvancedReplicationSpec(ctx, &apiRepSpec, zoneNameToOldReplicationSpecMeta, nil, d, connV2) if err != nil { return nil, err } @@ -1116,7 +1143,7 @@ func flattenAdvancedReplicationSpecsDS(ctx context.Context, apiRepSpecs []admin. return tfList, nil } -func flattenAdvancedReplicationSpec(ctx context.Context, apiObject *admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecIDs map[string]string, tfMapObject map[string]any, +func flattenAdvancedReplicationSpec(ctx context.Context, apiObject *admin.ReplicationSpec20240805, zoneNameToOldReplicationSpecMeta map[string]OldShardConfigMeta, tfMapObject map[string]any, d *schema.ResourceData, connV2 *admin.APIClient) (map[string]any, error) { if apiObject == nil { return nil, nil @@ -1125,8 +1152,8 @@ func flattenAdvancedReplicationSpec(ctx context.Context, apiObject *admin.Replic tfMap := map[string]any{} tfMap["external_id"] = apiObject.GetId() - if oldID, ok := zoneNameToOldReplicationSpecIDs[apiObject.GetZoneName()]; ok { - tfMap["id"] = oldID // replicationSpecs.*.id stores value associated to old cluster API (2023-02-01) + if oldShardConfig, ok := zoneNameToOldReplicationSpecMeta[apiObject.GetZoneName()]; ok { + tfMap["id"] = oldShardConfig.ID // replicationSpecs.*.id stores value associated to old cluster API (2023-02-01) } // define num_shards for backwards compatibility as this attribute has default value of 1. @@ -1153,24 +1180,26 @@ func flattenAdvancedReplicationSpec(ctx context.Context, apiObject *admin.Replic return tfMap, nil } -func flattenAdvancedReplicationSpecOldSDK(ctx context.Context, apiObject *admin20240530.ReplicationSpec, zoneNameToZoneIDs map[string]string, rootDiskSizeGB float64, tfMapObject map[string]any, +func flattenAdvancedReplicationSpecOldShardingConfig(ctx context.Context, apiObject *admin.ReplicationSpec20240805, zoneNameToOldShardConfigMeta map[string]OldShardConfigMeta, tfMapObject map[string]any, d *schema.ResourceData, connV2 *admin.APIClient) (map[string]any, error) { if apiObject == nil { return nil, nil } tfMap := map[string]any{} - tfMap["num_shards"] = apiObject.GetNumShards() - tfMap["id"] = apiObject.GetId() + if oldShardConfigData, ok := zoneNameToOldShardConfigMeta[apiObject.GetZoneName()]; ok { + tfMap["num_shards"] = oldShardConfigData.NumShard + tfMap["id"] = oldShardConfigData.ID + } if tfMapObject != nil { - object, containerIDs, err := flattenAdvancedReplicationSpecRegionConfigs(ctx, *convertRegionConfigSliceToLatest(apiObject.RegionConfigs, rootDiskSizeGB), tfMapObject["region_configs"].([]any), d, connV2) + object, containerIDs, err := flattenAdvancedReplicationSpecRegionConfigs(ctx, apiObject.GetRegionConfigs(), tfMapObject["region_configs"].([]any), d, connV2) if err != nil { return nil, err } tfMap["region_configs"] = object tfMap["container_id"] = containerIDs } else { - object, containerIDs, err := flattenAdvancedReplicationSpecRegionConfigs(ctx, *convertRegionConfigSliceToLatest(apiObject.RegionConfigs, rootDiskSizeGB), nil, d, connV2) + object, containerIDs, err := flattenAdvancedReplicationSpecRegionConfigs(ctx, apiObject.GetRegionConfigs(), nil, d, connV2) if err != nil { return nil, err } @@ -1178,9 +1207,7 @@ func flattenAdvancedReplicationSpecOldSDK(ctx context.Context, apiObject *admin2 tfMap["container_id"] = containerIDs } tfMap["zone_name"] = apiObject.GetZoneName() - if zoneID, ok := zoneNameToZoneIDs[apiObject.GetZoneName()]; ok { // zone id is not present on old API SDK, so we fetch values from new API and map them using zone name - tfMap["zone_id"] = zoneID - } + tfMap["zone_id"] = apiObject.GetZoneId() return tfMap, nil } diff --git a/internal/service/advancedcluster/model_advanced_cluster_test.go b/internal/service/advancedcluster/model_advanced_cluster_test.go index 8c05a013c7..88d3f19441 100644 --- a/internal/service/advancedcluster/model_advanced_cluster_test.go +++ b/internal/service/advancedcluster/model_advanced_cluster_test.go @@ -8,7 +8,6 @@ import ( "testing" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" - admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" "go.mongodb.org/atlas-sdk/v20241113003/mockadmin" @@ -28,7 +27,7 @@ var ( advancedClusters = []admin.ClusterDescription20240805{{StateName: conversion.StringPtr("NOT IDLE")}} ) -func TestFlattenReplicationSpecs(t *testing.T) { +func TestFlattenAdvancedReplicationSpecsOldShardingConfig(t *testing.T) { var ( regionName = "EU_WEST_1" providerName = "AWS" @@ -36,7 +35,7 @@ func TestFlattenReplicationSpecs(t *testing.T) { unexpectedID = "id2" expectedZoneName = "z1" unexpectedZoneName = "z2" - regionConfigAdmin = []admin20240530.CloudRegionConfig{{ + regionConfigAdmin = []admin.CloudRegionConfig20240805{{ ProviderName: &providerName, RegionName: ®ionName, }} @@ -49,8 +48,8 @@ func TestFlattenReplicationSpecs(t *testing.T) { "region_name": regionName, "zone_name": unexpectedZoneName, } - apiSpecExpected = admin20240530.ReplicationSpec{Id: &expectedID, ZoneName: &expectedZoneName, RegionConfigs: ®ionConfigAdmin} - apiSpecDifferent = admin20240530.ReplicationSpec{Id: &unexpectedID, ZoneName: &unexpectedZoneName, RegionConfigs: ®ionConfigAdmin} + apiSpecExpected = admin.ReplicationSpec20240805{Id: &expectedID, ZoneName: &expectedZoneName, RegionConfigs: ®ionConfigAdmin} + apiSpecDifferent = admin.ReplicationSpec20240805{Id: &unexpectedID, ZoneName: &unexpectedZoneName, RegionConfigs: ®ionConfigAdmin} testSchema = map[string]*schema.Schema{ "project_id": {Type: schema.TypeString}, } @@ -80,47 +79,56 @@ func TestFlattenReplicationSpecs(t *testing.T) { } ) testCases := map[string]struct { - adminSpecs []admin20240530.ReplicationSpec - tfInputSpecs []any - expectedLen int + adminSpecs []admin.ReplicationSpec20240805 + zoneNameToOldReplicationSpecMeta map[string]advancedcluster.OldShardConfigMeta + tfInputSpecs []any + expectedLen int }{ "empty admin spec should return empty list": { - []admin20240530.ReplicationSpec{}, + []admin.ReplicationSpec20240805{}, + map[string]advancedcluster.OldShardConfigMeta{}, []any{tfSameIDSameZone}, 0, }, "existing id, should match admin": { - []admin20240530.ReplicationSpec{apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{expectedZoneName: {expectedID, 1}}, []any{tfSameIDSameZone}, 1, }, "existing different id, should change to admin spec": { - []admin20240530.ReplicationSpec{apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{expectedZoneName: {expectedID, 1}}, []any{tfdiffIDDiffZone}, 1, }, "missing id, should be set when zone_name matches": { - []admin20240530.ReplicationSpec{apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{expectedZoneName: {expectedID, 1}}, []any{tfNoIDSameZone}, 1, }, "missing id and diff zone, should change to admin spec": { - []admin20240530.ReplicationSpec{apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{expectedZoneName: {expectedID, 1}}, []any{tfNoIDDiffZone}, 1, }, "existing id, should match correct api spec using `id` and extra api spec added": { - []admin20240530.ReplicationSpec{apiSpecDifferent, apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecDifferent, apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{unexpectedZoneName: {unexpectedID, 1}, expectedZoneName: {expectedID, 1}}, []any{tfSameIDSameZone}, 2, }, "missing id, should match correct api spec using `zone_name` and extra api spec added": { - []admin20240530.ReplicationSpec{apiSpecDifferent, apiSpecExpected}, + []admin.ReplicationSpec20240805{apiSpecDifferent, apiSpecExpected}, + map[string]advancedcluster.OldShardConfigMeta{unexpectedZoneName: {unexpectedID, 1}, expectedZoneName: {expectedID, 1}}, []any{tfNoIDSameZone}, 2, }, "two matching specs should be set to api specs": { - []admin20240530.ReplicationSpec{apiSpecExpected, apiSpecDifferent}, + []admin.ReplicationSpec20240805{apiSpecExpected, apiSpecDifferent}, + map[string]advancedcluster.OldShardConfigMeta{expectedZoneName: {expectedID, 1}, unexpectedZoneName: {unexpectedID, 1}}, []any{tfSameIDSameZone, tfdiffIDDiffZone}, 2, }, @@ -138,7 +146,7 @@ func TestFlattenReplicationSpecs(t *testing.T) { } resourceData := schema.TestResourceDataRaw(t, testSchema, map[string]any{"project_id": "p1"}) - tfOutputSpecs, err := advancedcluster.FlattenAdvancedReplicationSpecsOldSDK(context.Background(), tc.adminSpecs, nil, 0, tc.tfInputSpecs, resourceData, client) + tfOutputSpecs, err := advancedcluster.FlattenAdvancedReplicationSpecsOldShardingConfig(context.Background(), tc.adminSpecs, tc.zoneNameToOldReplicationSpecMeta, tc.tfInputSpecs, resourceData, client) require.NoError(t, err) assert.Len(t, tfOutputSpecs, tc.expectedLen) @@ -451,13 +459,13 @@ func TestCheckRegionConfigsPriorityOrder(t *testing.T) { for name, tc := range testCases { t.Run(name, func(t *testing.T) { - configs := make([]admin20240805.CloudRegionConfig20240805, len(tc.priorities)) + configs := make([]admin.CloudRegionConfig20240805, len(tc.priorities)) configsOld := make([]admin20240530.CloudRegionConfig, len(tc.priorities)) for i, priority := range tc.priorities { configs[i].Priority = conversion.IntPtr(priority) configsOld[i].Priority = conversion.IntPtr(priority) } - err := advancedcluster.CheckRegionConfigsPriorityOrder([]admin20240805.ReplicationSpec20240805{{RegionConfigs: &configs}}) + err := advancedcluster.CheckRegionConfigsPriorityOrder([]admin.ReplicationSpec20240805{{RegionConfigs: &configs}}) assert.Equal(t, tc.errorExpected, err != nil) err = advancedcluster.CheckRegionConfigsPriorityOrderOld([]admin20240530.ReplicationSpec{{RegionConfigs: &configsOld}}) assert.Equal(t, tc.errorExpected, err != nil) diff --git a/internal/service/advancedcluster/model_sdk_version_conversion.go b/internal/service/advancedcluster/model_sdk_version_conversion.go index ba934f7cea..33bcb463ee 100644 --- a/internal/service/advancedcluster/model_sdk_version_conversion.go +++ b/internal/service/advancedcluster/model_sdk_version_conversion.go @@ -12,7 +12,7 @@ import ( // - These functions must not contain any business logic. // - All will be removed once we rely on a single API version. -func convertTagsPtrToOldSDK(tags *[]admin20240805.ResourceTag) *[]admin20240530.ResourceTag { +func convertTagsPtrToOldSDK(tags *[]admin.ResourceTag) *[]admin20240530.ResourceTag { if tags == nil { return nil } @@ -28,19 +28,7 @@ func convertTagsPtrToOldSDK(tags *[]admin20240805.ResourceTag) *[]admin20240530. return &results } -func convertTagsToLatest(tags []admin20240530.ResourceTag) []admin.ResourceTag { - results := make([]admin.ResourceTag, len(tags)) - for i := range len(tags) { - tag := tags[i] - results[i] = admin.ResourceTag{ - Key: tag.Key, - Value: tag.Value, - } - } - return results -} - -func convertBiConnectToOldSDK(biconnector *admin20240805.BiConnector) *admin20240530.BiConnector { +func convertBiConnectToOldSDK(biconnector *admin.BiConnector) *admin20240530.BiConnector { if biconnector == nil { return nil } @@ -50,75 +38,7 @@ func convertBiConnectToOldSDK(biconnector *admin20240805.BiConnector) *admin2024 } } -func convertBiConnectToLatest(biconnector *admin20240530.BiConnector) *admin.BiConnector { - return &admin.BiConnector{ - Enabled: biconnector.Enabled, - ReadPreference: biconnector.ReadPreference, - } -} - -func convertConnectionStringToLatest(connStrings *admin20240530.ClusterConnectionStrings) *admin.ClusterConnectionStrings { - return &admin.ClusterConnectionStrings{ - AwsPrivateLink: connStrings.AwsPrivateLink, - AwsPrivateLinkSrv: connStrings.AwsPrivateLinkSrv, - Private: connStrings.Private, - PrivateEndpoint: convertPrivateEndpointToLatest(connStrings.PrivateEndpoint), - PrivateSrv: connStrings.PrivateSrv, - Standard: connStrings.Standard, - StandardSrv: connStrings.StandardSrv, - } -} - -func convertPrivateEndpointToLatest(privateEndpoints *[]admin20240530.ClusterDescriptionConnectionStringsPrivateEndpoint) *[]admin.ClusterDescriptionConnectionStringsPrivateEndpoint { - if privateEndpoints == nil { - return nil - } - peSlice := *privateEndpoints - results := make([]admin.ClusterDescriptionConnectionStringsPrivateEndpoint, len(peSlice)) - for i := range len(peSlice) { - pe := peSlice[i] - results[i] = admin.ClusterDescriptionConnectionStringsPrivateEndpoint{ - ConnectionString: pe.ConnectionString, - Endpoints: convertEndpointsToLatest(pe.Endpoints), - SrvConnectionString: pe.SrvConnectionString, - SrvShardOptimizedConnectionString: pe.SrvShardOptimizedConnectionString, - Type: pe.Type, - } - } - return &results -} - -func convertEndpointsToLatest(privateEndpoints *[]admin20240530.ClusterDescriptionConnectionStringsPrivateEndpointEndpoint) *[]admin.ClusterDescriptionConnectionStringsPrivateEndpointEndpoint { - if privateEndpoints == nil { - return nil - } - peSlice := *privateEndpoints - results := make([]admin.ClusterDescriptionConnectionStringsPrivateEndpointEndpoint, len(peSlice)) - for i := range len(peSlice) { - pe := peSlice[i] - results[i] = admin.ClusterDescriptionConnectionStringsPrivateEndpointEndpoint{ - EndpointId: pe.EndpointId, - ProviderName: pe.ProviderName, - Region: pe.Region, - } - } - return &results -} - -func convertLabelsToLatest(labels *[]admin20240530.ComponentLabel) *[]admin.ComponentLabel { - labelSlice := *labels - results := make([]admin.ComponentLabel, len(labelSlice)) - for i := range len(labelSlice) { - label := labelSlice[i] - results[i] = admin.ComponentLabel{ - Key: label.Key, - Value: label.Value, - } - } - return &results -} - -func convertLabelSliceToOldSDK(slice []admin20240805.ComponentLabel, err diag.Diagnostics) ([]admin20240530.ComponentLabel, diag.Diagnostics) { +func convertLabelSliceToOldSDK(slice []admin.ComponentLabel, err diag.Diagnostics) ([]admin20240530.ComponentLabel, diag.Diagnostics) { if err != nil { return nil, err } @@ -133,7 +53,7 @@ func convertLabelSliceToOldSDK(slice []admin20240805.ComponentLabel, err diag.Di return results, nil } -func convertRegionConfigSliceToOldSDK(slice *[]admin20240805.CloudRegionConfig20240805) *[]admin20240530.CloudRegionConfig { +func convertRegionConfigSliceToOldSDK(slice *[]admin.CloudRegionConfig20240805) *[]admin20240530.CloudRegionConfig { if slice == nil { return nil } @@ -156,7 +76,7 @@ func convertRegionConfigSliceToOldSDK(slice *[]admin20240805.CloudRegionConfig20 return &results } -func convertHardwareSpecToOldSDK(hwspec *admin20240805.HardwareSpec20240805) *admin20240530.HardwareSpec { +func convertHardwareSpecToOldSDK(hwspec *admin.HardwareSpec20240805) *admin20240530.HardwareSpec { if hwspec == nil { return nil } @@ -168,7 +88,7 @@ func convertHardwareSpecToOldSDK(hwspec *admin20240805.HardwareSpec20240805) *ad } } -func convertAdvancedAutoScalingSettingsToOldSDK(settings *admin20240805.AdvancedAutoScalingSettings) *admin20240530.AdvancedAutoScalingSettings { +func convertAdvancedAutoScalingSettingsToOldSDK(settings *admin.AdvancedAutoScalingSettings) *admin20240530.AdvancedAutoScalingSettings { if settings == nil { return nil } @@ -178,7 +98,7 @@ func convertAdvancedAutoScalingSettingsToOldSDK(settings *admin20240805.Advanced } } -func convertAdvancedComputeAutoScalingToOldSDK(settings *admin20240805.AdvancedComputeAutoScaling) *admin20240530.AdvancedComputeAutoScaling { +func convertAdvancedComputeAutoScalingToOldSDK(settings *admin.AdvancedComputeAutoScaling) *admin20240530.AdvancedComputeAutoScaling { if settings == nil { return nil } @@ -190,7 +110,7 @@ func convertAdvancedComputeAutoScalingToOldSDK(settings *admin20240805.AdvancedC } } -func convertDiskGBAutoScalingToOldSDK(settings *admin20240805.DiskGBAutoScaling) *admin20240530.DiskGBAutoScaling { +func convertDiskGBAutoScalingToOldSDK(settings *admin.DiskGBAutoScaling) *admin20240530.DiskGBAutoScaling { if settings == nil { return nil } @@ -199,7 +119,7 @@ func convertDiskGBAutoScalingToOldSDK(settings *admin20240805.DiskGBAutoScaling) } } -func convertDedicatedHardwareSpecToOldSDK(spec *admin20240805.DedicatedHardwareSpec20240805) *admin20240530.DedicatedHardwareSpec { +func convertDedicatedHardwareSpecToOldSDK(spec *admin.DedicatedHardwareSpec20240805) *admin20240530.DedicatedHardwareSpec { if spec == nil { return nil } @@ -211,82 +131,156 @@ func convertDedicatedHardwareSpecToOldSDK(spec *admin20240805.DedicatedHardwareS } } -func convertDedicatedHwSpecToLatest(spec *admin20240530.DedicatedHardwareSpec, rootDiskSizeGB float64) *admin.DedicatedHardwareSpec20240805 { - if spec == nil { +func ConvertClusterDescription20241023to20240805(clusterDescription *admin.ClusterDescription20240805) *admin20240805.ClusterDescription20240805 { + return &admin20240805.ClusterDescription20240805{ + Name: clusterDescription.Name, + ClusterType: clusterDescription.ClusterType, + ReplicationSpecs: convertReplicationSpecs20241023to20240805(clusterDescription.ReplicationSpecs), + BackupEnabled: clusterDescription.BackupEnabled, + BiConnector: convertBiConnector20241023to20240805(clusterDescription.BiConnector), + EncryptionAtRestProvider: clusterDescription.EncryptionAtRestProvider, + Labels: convertLabels20241023to20240805(clusterDescription.Labels), + Tags: convertTag20241023to20240805(clusterDescription.Tags), + MongoDBMajorVersion: clusterDescription.MongoDBMajorVersion, + PitEnabled: clusterDescription.PitEnabled, + RootCertType: clusterDescription.RootCertType, + TerminationProtectionEnabled: clusterDescription.TerminationProtectionEnabled, + VersionReleaseSystem: clusterDescription.VersionReleaseSystem, + GlobalClusterSelfManagedSharding: clusterDescription.GlobalClusterSelfManagedSharding, + ReplicaSetScalingStrategy: clusterDescription.ReplicaSetScalingStrategy, + RedactClientLogData: clusterDescription.RedactClientLogData, + ConfigServerManagementMode: clusterDescription.ConfigServerManagementMode, + } +} + +func convertReplicationSpecs20241023to20240805(replicationSpecs *[]admin.ReplicationSpec20240805) *[]admin20240805.ReplicationSpec20240805 { + if replicationSpecs == nil { return nil } - return &admin.DedicatedHardwareSpec20240805{ - NodeCount: spec.NodeCount, - DiskIOPS: spec.DiskIOPS, - EbsVolumeType: spec.EbsVolumeType, - InstanceSize: spec.InstanceSize, - DiskSizeGB: &rootDiskSizeGB, + result := make([]admin20240805.ReplicationSpec20240805, len(*replicationSpecs)) + for i, replicationSpec := range *replicationSpecs { + result[i] = admin20240805.ReplicationSpec20240805{ + Id: replicationSpec.Id, + ZoneName: replicationSpec.ZoneName, + ZoneId: replicationSpec.ZoneId, + RegionConfigs: convertCloudRegionConfig20241023to20240805(replicationSpec.RegionConfigs), + } } + return &result } -func convertAdvancedAutoScalingSettingsToLatest(settings *admin20240530.AdvancedAutoScalingSettings) *admin.AdvancedAutoScalingSettings { - if settings == nil { +func convertCloudRegionConfig20241023to20240805(cloudRegionConfig *[]admin.CloudRegionConfig20240805) *[]admin20240805.CloudRegionConfig20240805 { + if cloudRegionConfig == nil { return nil } - return &admin.AdvancedAutoScalingSettings{ - Compute: convertAdvancedComputeAutoScalingToLatest(settings.Compute), - DiskGB: convertDiskGBAutoScalingToLatest(settings.DiskGB), + result := make([]admin20240805.CloudRegionConfig20240805, len(*cloudRegionConfig)) + for i, regionConfig := range *cloudRegionConfig { + result[i] = admin20240805.CloudRegionConfig20240805{ + ProviderName: regionConfig.ProviderName, + RegionName: regionConfig.RegionName, + BackingProviderName: regionConfig.BackingProviderName, + Priority: regionConfig.Priority, + ElectableSpecs: convertHardwareSpec20241023to20240805(regionConfig.ElectableSpecs), + ReadOnlySpecs: convertDedicatedHardwareSpec20241023to20240805(regionConfig.ReadOnlySpecs), + AnalyticsSpecs: convertDedicatedHardwareSpec20241023to20240805(regionConfig.AnalyticsSpecs), + AutoScaling: convertAdvancedAutoScalingSettings20241023to20240805(regionConfig.AutoScaling), + AnalyticsAutoScaling: convertAdvancedAutoScalingSettings20241023to20240805(regionConfig.AnalyticsAutoScaling), + } } + return &result } -func convertAdvancedComputeAutoScalingToLatest(settings *admin20240530.AdvancedComputeAutoScaling) *admin.AdvancedComputeAutoScaling { - if settings == nil { +func convertAdvancedAutoScalingSettings20241023to20240805(advancedAutoScalingSettings *admin.AdvancedAutoScalingSettings) *admin20240805.AdvancedAutoScalingSettings { + if advancedAutoScalingSettings == nil { return nil } - return &admin.AdvancedComputeAutoScaling{ - Enabled: settings.Enabled, - MaxInstanceSize: settings.MaxInstanceSize, - MinInstanceSize: settings.MinInstanceSize, - ScaleDownEnabled: settings.ScaleDownEnabled, + return &admin20240805.AdvancedAutoScalingSettings{ + Compute: convertAdvancedComputeAutoScaling20241023to20240805(advancedAutoScalingSettings.Compute), + DiskGB: convertDiskGBAutoScaling20241023to20240805(advancedAutoScalingSettings.DiskGB), } } -func convertDiskGBAutoScalingToLatest(settings *admin20240530.DiskGBAutoScaling) *admin.DiskGBAutoScaling { - if settings == nil { +func convertDiskGBAutoScaling20241023to20240805(diskGBAutoScaling *admin.DiskGBAutoScaling) *admin20240805.DiskGBAutoScaling { + if diskGBAutoScaling == nil { return nil } - return &admin.DiskGBAutoScaling{ - Enabled: settings.Enabled, + return &admin20240805.DiskGBAutoScaling{ + Enabled: diskGBAutoScaling.Enabled, } } -func convertHardwareSpecToLatest(hwspec *admin20240530.HardwareSpec, rootDiskSizeGB float64) *admin.HardwareSpec20240805 { - if hwspec == nil { +func convertAdvancedComputeAutoScaling20241023to20240805(advancedComputeAutoScaling *admin.AdvancedComputeAutoScaling) *admin20240805.AdvancedComputeAutoScaling { + if advancedComputeAutoScaling == nil { return nil } - return &admin.HardwareSpec20240805{ - DiskIOPS: hwspec.DiskIOPS, - EbsVolumeType: hwspec.EbsVolumeType, - InstanceSize: hwspec.InstanceSize, - NodeCount: hwspec.NodeCount, - DiskSizeGB: &rootDiskSizeGB, + return &admin20240805.AdvancedComputeAutoScaling{ + Enabled: advancedComputeAutoScaling.Enabled, + MaxInstanceSize: advancedComputeAutoScaling.MaxInstanceSize, + MinInstanceSize: advancedComputeAutoScaling.MinInstanceSize, + ScaleDownEnabled: advancedComputeAutoScaling.ScaleDownEnabled, } } -func convertRegionConfigSliceToLatest(slice *[]admin20240530.CloudRegionConfig, rootDiskSizeGB float64) *[]admin.CloudRegionConfig20240805 { - if slice == nil { +func convertHardwareSpec20241023to20240805(hardwareSpec *admin.HardwareSpec20240805) *admin20240805.HardwareSpec20240805 { + if hardwareSpec == nil { return nil } - cloudRegionSlice := *slice - results := make([]admin.CloudRegionConfig20240805, len(cloudRegionSlice)) - for i := range len(cloudRegionSlice) { - cloudRegion := cloudRegionSlice[i] - results[i] = admin.CloudRegionConfig20240805{ - ElectableSpecs: convertHardwareSpecToLatest(cloudRegion.ElectableSpecs, rootDiskSizeGB), - Priority: cloudRegion.Priority, - ProviderName: cloudRegion.ProviderName, - RegionName: cloudRegion.RegionName, - AnalyticsAutoScaling: convertAdvancedAutoScalingSettingsToLatest(cloudRegion.AnalyticsAutoScaling), - AnalyticsSpecs: convertDedicatedHwSpecToLatest(cloudRegion.AnalyticsSpecs, rootDiskSizeGB), - AutoScaling: convertAdvancedAutoScalingSettingsToLatest(cloudRegion.AutoScaling), - ReadOnlySpecs: convertDedicatedHwSpecToLatest(cloudRegion.ReadOnlySpecs, rootDiskSizeGB), - BackingProviderName: cloudRegion.BackingProviderName, + return &admin20240805.HardwareSpec20240805{ + DiskSizeGB: hardwareSpec.DiskSizeGB, + NodeCount: hardwareSpec.NodeCount, + DiskIOPS: hardwareSpec.DiskIOPS, + EbsVolumeType: hardwareSpec.EbsVolumeType, + InstanceSize: hardwareSpec.InstanceSize, + } +} + +func convertDedicatedHardwareSpec20241023to20240805(hardwareSpec *admin.DedicatedHardwareSpec20240805) *admin20240805.DedicatedHardwareSpec20240805 { + if hardwareSpec == nil { + return nil + } + return &admin20240805.DedicatedHardwareSpec20240805{ + DiskSizeGB: hardwareSpec.DiskSizeGB, + NodeCount: hardwareSpec.NodeCount, + DiskIOPS: hardwareSpec.DiskIOPS, + EbsVolumeType: hardwareSpec.EbsVolumeType, + InstanceSize: hardwareSpec.InstanceSize, + } +} + +func convertBiConnector20241023to20240805(biConnector *admin.BiConnector) *admin20240805.BiConnector { + if biConnector == nil { + return nil + } + return &admin20240805.BiConnector{ + ReadPreference: biConnector.ReadPreference, + Enabled: biConnector.Enabled, + } +} + +func convertLabels20241023to20240805(labels *[]admin.ComponentLabel) *[]admin20240805.ComponentLabel { + if labels == nil { + return &[]admin20240805.ComponentLabel{} + } + result := make([]admin20240805.ComponentLabel, len(*labels)) + for i, label := range *labels { + result[i] = admin20240805.ComponentLabel{ + Key: label.Key, + Value: label.Value, } } - return &results + return &result +} + +func convertTag20241023to20240805(tags *[]admin.ResourceTag) *[]admin20240805.ResourceTag { + if tags == nil { + return &[]admin20240805.ResourceTag{} + } + result := make([]admin20240805.ResourceTag, len(*tags)) + for i, tag := range *tags { + result[i] = admin20240805.ResourceTag{ + Key: tag.Key, + Value: tag.Value, + } + } + return &result } diff --git a/internal/service/advancedcluster/model_sdk_version_conversion_test.go b/internal/service/advancedcluster/model_sdk_version_conversion_test.go new file mode 100644 index 0000000000..d90b3ac499 --- /dev/null +++ b/internal/service/advancedcluster/model_sdk_version_conversion_test.go @@ -0,0 +1,193 @@ +package advancedcluster_test + +import ( + "testing" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" + "github.com/stretchr/testify/assert" + admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" + "go.mongodb.org/atlas-sdk/v20241113003/admin" +) + +func TestConvertClusterDescription20241023to20240805(t *testing.T) { + var ( + clusterName = "clusterName" + clusterType = "REPLICASET" + earProvider = "AWS" + booleanValue = true + mongoDBMajorVersion = "7.0" + rootCertType = "rootCertType" + replicaSetScalingStrategy = "WORKLOAD_TYPE" + configServerManagementMode = "ATLAS_MANAGED" + readPreference = "primary" + zoneName = "z1" + id = "id1" + regionConfigProvider = "AWS" + region = "EU_WEST_1" + priority = 7 + instanceSize = "M10" + nodeCount = 3 + diskSizeGB = 30.3 + ebsVolumeType = "STANDARD" + diskIOPS = 100 + ) + testCases := []struct { + input *admin.ClusterDescription20240805 + expectedOutput *admin20240805.ClusterDescription20240805 + name string + }{ + { + name: "Converts cluster description from 20241023 to 20240805", + input: &admin.ClusterDescription20240805{ + Name: conversion.StringPtr(clusterName), + ClusterType: conversion.StringPtr(clusterType), + ReplicationSpecs: &[]admin.ReplicationSpec20240805{ + { + Id: conversion.StringPtr(id), + ZoneName: conversion.StringPtr(zoneName), + RegionConfigs: &[]admin.CloudRegionConfig20240805{ + { + ProviderName: conversion.StringPtr(regionConfigProvider), + RegionName: conversion.StringPtr(region), + BackingProviderName: conversion.StringPtr(regionConfigProvider), + Priority: conversion.IntPtr(priority), + AnalyticsSpecs: &admin.DedicatedHardwareSpec20240805{ + InstanceSize: conversion.StringPtr(instanceSize), + NodeCount: conversion.IntPtr(nodeCount), + DiskSizeGB: conversion.Pointer(diskSizeGB), + EbsVolumeType: conversion.StringPtr(ebsVolumeType), + DiskIOPS: conversion.IntPtr(diskIOPS), + }, + ElectableSpecs: &admin.HardwareSpec20240805{ + InstanceSize: conversion.StringPtr(instanceSize), + NodeCount: conversion.IntPtr(nodeCount), + DiskSizeGB: conversion.Pointer(diskSizeGB), + EbsVolumeType: conversion.StringPtr(ebsVolumeType), + DiskIOPS: conversion.IntPtr(diskIOPS), + }, + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ + Enabled: conversion.Pointer(booleanValue), + MaxInstanceSize: conversion.Pointer(instanceSize), + MinInstanceSize: conversion.Pointer(instanceSize), + ScaleDownEnabled: conversion.Pointer(booleanValue), + }, + DiskGB: &admin.DiskGBAutoScaling{ + Enabled: conversion.Pointer(booleanValue), + }, + }, + }, + }, + }, + }, + BackupEnabled: conversion.Pointer(booleanValue), + BiConnector: &admin.BiConnector{ + Enabled: conversion.Pointer(booleanValue), + ReadPreference: conversion.StringPtr(readPreference), + }, + EncryptionAtRestProvider: conversion.StringPtr(earProvider), + Labels: &[]admin.ComponentLabel{ + {Key: conversion.StringPtr("key1"), Value: conversion.StringPtr("value1")}, + {Key: conversion.StringPtr("key2"), Value: conversion.StringPtr("value2")}, + }, + Tags: &[]admin.ResourceTag{ + {Key: "key1", Value: "value1"}, + {Key: "key2", Value: "value2"}, + }, + MongoDBMajorVersion: conversion.StringPtr(mongoDBMajorVersion), + PitEnabled: conversion.Pointer(booleanValue), + RootCertType: conversion.StringPtr(rootCertType), + TerminationProtectionEnabled: conversion.Pointer(booleanValue), + VersionReleaseSystem: conversion.StringPtr(""), + GlobalClusterSelfManagedSharding: conversion.Pointer(booleanValue), + ReplicaSetScalingStrategy: conversion.StringPtr(replicaSetScalingStrategy), + RedactClientLogData: conversion.Pointer(booleanValue), + ConfigServerManagementMode: conversion.StringPtr(configServerManagementMode), + }, + expectedOutput: &admin20240805.ClusterDescription20240805{ + Name: conversion.StringPtr(clusterName), + ClusterType: conversion.StringPtr(clusterType), + ReplicationSpecs: &[]admin20240805.ReplicationSpec20240805{ + { + Id: conversion.StringPtr(id), + ZoneName: conversion.StringPtr(zoneName), + RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + { + ProviderName: conversion.StringPtr(regionConfigProvider), + RegionName: conversion.StringPtr(region), + BackingProviderName: conversion.StringPtr(regionConfigProvider), + Priority: conversion.IntPtr(priority), + AnalyticsSpecs: &admin20240805.DedicatedHardwareSpec20240805{ + InstanceSize: conversion.StringPtr(instanceSize), + NodeCount: conversion.IntPtr(nodeCount), + DiskSizeGB: conversion.Pointer(diskSizeGB), + EbsVolumeType: conversion.StringPtr(ebsVolumeType), + DiskIOPS: conversion.IntPtr(diskIOPS), + }, + ElectableSpecs: &admin20240805.HardwareSpec20240805{ + InstanceSize: conversion.StringPtr(instanceSize), + NodeCount: conversion.IntPtr(nodeCount), + DiskSizeGB: conversion.Pointer(diskSizeGB), + EbsVolumeType: conversion.StringPtr(ebsVolumeType), + DiskIOPS: conversion.IntPtr(diskIOPS), + }, + AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ + Compute: &admin20240805.AdvancedComputeAutoScaling{ + Enabled: conversion.Pointer(booleanValue), + MaxInstanceSize: conversion.Pointer(instanceSize), + MinInstanceSize: conversion.Pointer(instanceSize), + ScaleDownEnabled: conversion.Pointer(booleanValue), + }, + DiskGB: &admin20240805.DiskGBAutoScaling{ + Enabled: conversion.Pointer(booleanValue), + }, + }, + }, + }, + }, + }, + BackupEnabled: conversion.Pointer(booleanValue), + BiConnector: &admin20240805.BiConnector{ + Enabled: conversion.Pointer(booleanValue), + ReadPreference: conversion.StringPtr(readPreference), + }, + EncryptionAtRestProvider: conversion.StringPtr(earProvider), + Labels: &[]admin20240805.ComponentLabel{ + {Key: conversion.StringPtr("key1"), Value: conversion.StringPtr("value1")}, + {Key: conversion.StringPtr("key2"), Value: conversion.StringPtr("value2")}, + }, + Tags: &[]admin20240805.ResourceTag{ + {Key: "key1", Value: "value1"}, + {Key: "key2", Value: "value2"}, + }, + MongoDBMajorVersion: conversion.StringPtr(mongoDBMajorVersion), + PitEnabled: conversion.Pointer(booleanValue), + RootCertType: conversion.StringPtr(rootCertType), + TerminationProtectionEnabled: conversion.Pointer(booleanValue), + VersionReleaseSystem: conversion.StringPtr(""), + GlobalClusterSelfManagedSharding: conversion.Pointer(booleanValue), + ReplicaSetScalingStrategy: conversion.StringPtr(replicaSetScalingStrategy), + RedactClientLogData: conversion.Pointer(booleanValue), + ConfigServerManagementMode: conversion.StringPtr(configServerManagementMode), + }, + }, + { + name: "Converts cluster description from 20241023 to 20240805 with nil values", + input: &admin.ClusterDescription20240805{}, + expectedOutput: &admin20240805.ClusterDescription20240805{ + ReplicationSpecs: nil, + BiConnector: nil, + Labels: &[]admin20240805.ComponentLabel{}, + Tags: &[]admin20240805.ResourceTag{}, + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + result := advancedcluster.ConvertClusterDescription20241023to20240805(tc.input) + assert.Equal(t, tc.expectedOutput, result) + }) + } +} diff --git a/internal/service/advancedcluster/resource_advanced_cluster.go b/internal/service/advancedcluster/resource_advanced_cluster.go index cd578bd8dc..d8f2012472 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster.go +++ b/internal/service/advancedcluster/resource_advanced_cluster.go @@ -434,7 +434,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. rootDiskSizeGB = conversion.Pointer(v.(float64)) } - params := &admin20240805.ClusterDescription20240805{ + params := &admin.ClusterDescription20240805{ Name: conversion.StringPtr(cast.ToString(d.Get("name"))), ClusterType: conversion.StringPtr(cast.ToString(d.Get("cluster_type"))), ReplicationSpecs: expandAdvancedReplicationSpecs(d.Get("replication_specs").([]any), rootDiskSizeGB), @@ -460,7 +460,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. } if _, ok := d.GetOk("tags"); ok { - params.Tags = conversion.ExpandTagsFromSetSchemaV220240805(d) + params.Tags = conversion.ExpandTagsFromSetSchema(d) } if v, ok := d.GetOk("mongo_db_major_version"); ok { params.MongoDBMajorVersion = conversion.StringPtr(FormatMongoDBMajorVersion(v.(string))) @@ -505,10 +505,27 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. if err := CheckRegionConfigsPriorityOrder(params.GetReplicationSpecs()); err != nil { return diag.FromErr(err) } - // cannot call latest API (2024-10-23 or newer) as it can enable ISS autoscaling - cluster, _, err := connV220240805.ClustersApi.CreateCluster(ctx, projectID, params).Execute() - if err != nil { - return diag.FromErr(fmt.Errorf(errorCreate, err)) + + var clusterName string + var clusterID string + var err error + // With old sharding config we call older API (2024-08-05) to avoid cluster having asymmetric autoscaling mode. Old sharding config can only represent symmetric clusters. + if isUsingOldShardingConfiguration(d) { + var cluster20240805 *admin20240805.ClusterDescription20240805 + cluster20240805, _, err = connV220240805.ClustersApi.CreateCluster(ctx, projectID, ConvertClusterDescription20241023to20240805(params)).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(errorCreate, err)) + } + clusterName = cluster20240805.GetName() + clusterID = cluster20240805.GetId() + } else { + var cluster *admin.ClusterDescription20240805 + cluster, _, err = connV2.ClustersApi.CreateCluster(ctx, projectID, params).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(errorCreate, err)) + } + clusterName = cluster.GetName() + clusterID = cluster.GetId() } timeout := d.Timeout(schema.TimeoutCreate) @@ -521,13 +538,13 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. if ac, ok := d.GetOk("advanced_configuration"); ok { if aclist, ok := ac.([]any); ok && len(aclist) > 0 { params20240530, params := expandProcessArgs(d, aclist[0].(map[string]any), params.MongoDBMajorVersion) - _, _, err = connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.GetName(), ¶ms20240530).Execute() + _, _, err := connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, ¶ms20240530).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(errorConfigUpdate, cluster.GetName(), err)) + return diag.FromErr(fmt.Errorf(errorConfigUpdate, clusterName, err)) } - _, _, err = connV2.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.GetName(), ¶ms).Execute() + _, _, err = connV2.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, ¶ms).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(errorConfigUpdate, cluster.GetName(), err)) + return diag.FromErr(fmt.Errorf(errorConfigUpdate, clusterName, err)) } } } @@ -545,7 +562,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. } if pinnedFCVBlock, _ := d.Get("pinned_fcv").([]any); len(pinnedFCVBlock) > 0 { - if diags := PinFCV(ctx, connV2, projectID, cluster.GetName(), pinnedFCVBlock[0]); diags.HasError() { + if diags := PinFCV(ctx, connV2, projectID, clusterName, pinnedFCVBlock[0]); diags.HasError() { return diags } waitForChanges = true @@ -558,9 +575,9 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. } d.SetId(conversion.EncodeStateID(map[string]string{ - "cluster_id": cluster.GetId(), + "cluster_id": clusterID, "project_id": projectID, - "cluster_name": cluster.GetName(), + "cluster_name": clusterName, })) return resourceRead(ctx, d, meta) @@ -584,72 +601,40 @@ func resourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Di projectID := ids["project_id"] clusterName := ids["cluster_name"] - var clusterResp *admin.ClusterDescription20240805 - var replicationSpecs []map[string]any - if isUsingOldAPISchemaStructure(d) { - clusterOldSDK, resp, err := connV220240530.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - d.SetId("") - return nil - } - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) - } - if err := d.Set("disk_size_gb", clusterOldSDK.GetDiskSizeGB()); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "disk_size_gb", clusterName, err)) - } - cluster, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - d.SetId("") - return nil - } - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + cluster, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() + if err != nil { + if resp != nil && resp.StatusCode == http.StatusNotFound { + d.SetId("") + return nil } + return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + } - zoneNameToZoneIDs, err := getZoneIDsFromNewAPI(cluster) - if err != nil { + zoneNameToOldReplicationSpecMeta, err := GetReplicationSpecAttributesFromOldAPI(ctx, projectID, clusterName, connV220240530.ClustersApi) + if err != nil { + if apiError, ok := admin20240530.AsError(err); !ok { return diag.FromErr(err) + } else if apiError.GetErrorCode() != "ASYMMETRIC_SHARD_UNSUPPORTED" || (apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" && isUsingOldShardingConfiguration(d)) { + return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) } - - replicationSpecs, err = FlattenAdvancedReplicationSpecsOldSDK(ctx, clusterOldSDK.GetReplicationSpecs(), zoneNameToZoneIDs, clusterOldSDK.GetDiskSizeGB(), d.Get("replication_specs").([]any), d, connV2) + } + // if config uses old sharding configuration we call latest API but group replications specs from the same zone and define num_shards attribute + if isUsingOldShardingConfiguration(d) { + replicationSpecs, err = FlattenAdvancedReplicationSpecsOldShardingConfig(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, d.Get("replication_specs").([]any), d, connV2) if err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replication_specs", clusterName, err)) } - - clusterResp = cluster } else { - cluster, resp, err := connV2.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if resp != nil && resp.StatusCode == http.StatusNotFound { - d.SetId("") - return nil - } - return diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) - } - - // root disk_size_gb defined for backwards compatibility avoiding breaking changes - if err := d.Set("disk_size_gb", GetDiskSizeGBFromReplicationSpec(cluster)); err != nil { - return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "disk_size_gb", clusterName, err)) - } - - zoneNameToOldReplicationSpecIDs, err := getReplicationSpecIDsFromOldAPI(ctx, projectID, clusterName, connV220240530) - if err != nil { - return diag.FromErr(err) - } - - replicationSpecs, err = flattenAdvancedReplicationSpecs(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecIDs, d.Get("replication_specs").([]any), d, connV2) + replicationSpecs, err = flattenAdvancedReplicationSpecs(ctx, cluster.GetReplicationSpecs(), zoneNameToOldReplicationSpecMeta, d.Get("replication_specs").([]any), d, connV2) if err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replication_specs", clusterName, err)) } - - clusterResp = cluster } - warning := WarningIfFCVExpiredOrUnpinnedExternally(d, clusterResp) // has to be called before pinned_fcv value is updated in ResourceData to know prior state value - diags := setRootFields(d, clusterResp, true) + warning := WarningIfFCVExpiredOrUnpinnedExternally(d, cluster) // has to be called before pinned_fcv value is updated in ResourceData to know prior state value + diags := setRootFields(d, cluster, true) if diags.HasError() { return diags } @@ -674,31 +659,17 @@ func resourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Di return warning } -// getReplicationSpecIDsFromOldAPI returns the id values of replication specs coming from old API. This is used to populate old replication_specs.*.id attribute avoiding breaking changes. -// In the old API each replications spec has a 1:1 relation with each zone, so ids are returned in a map from zoneName to id. -func getReplicationSpecIDsFromOldAPI(ctx context.Context, projectID, clusterName string, connV220240530 *admin20240530.APIClient) (map[string]string, error) { - clusterOldAPI, _, err := connV220240530.ClustersApi.GetCluster(ctx, projectID, clusterName).Execute() - if apiError, ok := admin20240530.AsError(err); ok { - if apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" { - return nil, nil // if its the case of an asymmetric shard an error is expected in old API, replication_specs.*.id attribute will not be populated - } - readErrorMsg := "error reading advanced cluster with 2023-02-01 API (%s): %s" - return nil, fmt.Errorf(readErrorMsg, clusterName, err) +// GetReplicationSpecAttributesFromOldAPI returns the id and num shard values of replication specs coming from old API. This is used to populate replication_specs.*.id and replication_specs.*.num_shard attributes for old sharding confirgurations. +// In the old API (2023-02-01), each replications spec has a 1:1 relation with each zone, so ids and num shards are stored in a struct oldShardConfigMeta and are returned in a map from zoneName to oldShardConfigMeta. +func GetReplicationSpecAttributesFromOldAPI(ctx context.Context, projectID, clusterName string, client20240530 admin20240530.ClustersApi) (map[string]OldShardConfigMeta, error) { + clusterOldAPI, _, err := client20240530.GetCluster(ctx, projectID, clusterName).Execute() + if err != nil { + return nil, err } specs := clusterOldAPI.GetReplicationSpecs() - result := make(map[string]string, len(specs)) - for _, spec := range specs { - result[spec.GetZoneName()] = spec.GetId() - } - return result, nil -} - -// getZoneIDsFromNewAPI returns the zone id values of replication specs coming from new API. This is used to populate zone_id when old API is called in the read. -func getZoneIDsFromNewAPI(cluster *admin.ClusterDescription20240805) (map[string]string, error) { - specs := cluster.GetReplicationSpecs() - result := make(map[string]string, len(specs)) + result := make(map[string]OldShardConfigMeta, len(specs)) for _, spec := range specs { - result[spec.GetZoneName()] = spec.GetZoneId() + result[spec.GetZoneName()] = OldShardConfigMeta{spec.GetId(), spec.GetNumShards()} } return result, nil } @@ -736,6 +707,11 @@ func setRootFields(d *schema.ResourceData, cluster *admin.ClusterDescription2024 return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "create_date", clusterName, err)) } + // root disk_size_gb defined for backwards compatibility avoiding breaking changes + if err := d.Set("disk_size_gb", GetDiskSizeGBFromReplicationSpec(cluster)); err != nil { + return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "disk_size_gb", clusterName, err)) + } + if err := d.Set("encryption_at_rest_provider", cluster.GetEncryptionAtRestProvider()); err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "encryption_at_rest_provider", clusterName, err)) } @@ -788,12 +764,9 @@ func setRootFields(d *schema.ResourceData, cluster *admin.ClusterDescription2024 return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "global_cluster_self_managed_sharding", clusterName, err)) } - // fields not supported in connV220240530 SDK (mapping to 2023-02-01 API) - if err := d.Set("replica_set_scaling_strategy", cluster.GetReplicaSetScalingStrategy()); err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "replica_set_scaling_strategy", clusterName, err)) } - if err := d.Set("redact_client_log_data", cluster.GetRedactClientLogData()); err != nil { return diag.FromErr(fmt.Errorf(ErrorClusterAdvancedSetting, "redact_client_log_data", clusterName, err)) } @@ -841,8 +814,8 @@ func WarningIfFCVExpiredOrUnpinnedExternally(d *schema.ResourceData, cluster *ad return nil } -// For both read and update operations if old sharding schema structure is used (at least one replication spec with numShards > 1) we continue to invoke the old API -func isUsingOldAPISchemaStructure(d *schema.ResourceData) bool { +// isUsingOldShardingConfiguration is identified if at least one replication spec defines num_shards > 1. This legacy form is from 2023-02-01 API and can only represent symmetric sharded clusters. +func isUsingOldShardingConfiguration(d *schema.ResourceData) bool { tfList := d.Get("replication_specs").([]any) for _, tfMapRaw := range tfList { tfMap, ok := tfMapRaw.(map[string]any) @@ -887,7 +860,6 @@ func resourceUpgrade(ctx context.Context, upgradeRequest *admin.LegacyAtlasTenan func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { connV220240530 := meta.(*config.MongoDBClient).AtlasV220240530 - connV220240805 := meta.(*config.MongoDBClient).AtlasV220240805 connV2 := meta.(*config.MongoDBClient).AtlasV2 ids := conversion.DecodeStateID(d.Id()) projectID := ids["project_id"] @@ -904,7 +876,8 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. return diags } - if isUsingOldAPISchemaStructure(d) { + // With old sharding config we call older API (2023-02-01) to avoid cluster having asymmetric autoscaling mode. Old sharding config can only represent symmetric clusters. + if isUsingOldShardingConfiguration(d) { req, diags := updateRequestOldAPI(d, clusterName) if diags != nil { return diags @@ -921,7 +894,7 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. waitOnUpdate = true } if d.HasChange("replica_set_scaling_strategy") || d.HasChange("redact_client_log_data") || d.HasChange("config_server_management_mode") { - request := new(admin20240805.ClusterDescription20240805) + request := new(admin.ClusterDescription20240805) if d.HasChange("replica_set_scaling_strategy") { request.ReplicaSetScalingStrategy = conversion.Pointer(d.Get("replica_set_scaling_strategy").(string)) } @@ -931,8 +904,8 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. if d.HasChange("config_server_management_mode") { request.ConfigServerManagementMode = conversion.StringPtr(d.Get("config_server_management_mode").(string)) } - // can call latest API (2024-10-23 or newer) as autoscaling property is not specified, using older version just for caution until iss autoscaling epic is done - if _, _, err := connV220240805.ClustersApi.UpdateCluster(ctx, projectID, clusterName, request).Execute(); err != nil { + // can call latest API (2024-10-23 or newer) as replications specs (with nested autoscaling property) is not specified + if _, _, err := connV2.ClustersApi.UpdateCluster(ctx, projectID, clusterName, request).Execute(); err != nil { return diag.FromErr(fmt.Errorf(errorUpdate, clusterName, err)) } waitOnUpdate = true @@ -952,8 +925,7 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. if err := CheckRegionConfigsPriorityOrder(req.GetReplicationSpecs()); err != nil { return diag.FromErr(err) } - // cannot call latest API (2024-10-23 or newer) as it can enable ISS autoscaling - if _, _, err := connV220240805.ClustersApi.UpdateCluster(ctx, projectID, clusterName, req).Execute(); err != nil { + if _, _, err := connV2.ClustersApi.UpdateCluster(ctx, projectID, clusterName, req).Execute(); err != nil { return diag.FromErr(fmt.Errorf(errorUpdate, clusterName, err)) } if err := waitForUpdateToFinish(ctx, connV2, projectID, clusterName, timeout); err != nil { @@ -987,11 +959,10 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. } if d.Get("paused").(bool) { - clusterRequest := &admin20240805.ClusterDescription20240805{ + clusterRequest := &admin.ClusterDescription20240805{ Paused: conversion.Pointer(true), } - // can call latest API (2024-10-23 or newer) as autoscaling property is not specified, using older version just for caution until iss autoscaling epic is done - if _, _, err := connV220240805.ClustersApi.UpdateCluster(ctx, projectID, clusterName, clusterRequest).Execute(); err != nil { + if _, _, err := connV2.ClustersApi.UpdateCluster(ctx, projectID, clusterName, clusterRequest).Execute(); err != nil { return diag.FromErr(fmt.Errorf(errorUpdate, clusterName, err)) } if err := waitForUpdateToFinish(ctx, connV2, projectID, clusterName, timeout); err != nil { @@ -1041,8 +1012,8 @@ func PinFCV(ctx context.Context, connV2 *admin.APIClient, projectID, clusterName return nil } -func updateRequest(ctx context.Context, d *schema.ResourceData, projectID, clusterName string, connV2 *admin.APIClient) (*admin20240805.ClusterDescription20240805, diag.Diagnostics) { - cluster := new(admin20240805.ClusterDescription20240805) +func updateRequest(ctx context.Context, d *schema.ResourceData, projectID, clusterName string, connV2 *admin.APIClient) (*admin.ClusterDescription20240805, diag.Diagnostics) { + cluster := new(admin.ClusterDescription20240805) if d.HasChange("replication_specs") || d.HasChange("disk_size_gb") { var updatedDiskSizeGB *float64 @@ -1089,7 +1060,7 @@ func updateRequest(ctx context.Context, d *schema.ResourceData, projectID, clust } if d.HasChange("tags") { - cluster.Tags = conversion.ExpandTagsFromSetSchemaV220240805(d) + cluster.Tags = conversion.ExpandTagsFromSetSchema(d) } if d.HasChange("mongo_db_major_version") { @@ -1183,7 +1154,7 @@ func updateRequestOldAPI(d *schema.ResourceData, clusterName string) (*admin2024 } if d.HasChange("tags") { - cluster.Tags = convertTagsPtrToOldSDK(conversion.ExpandTagsFromSetSchemaV220240805(d)) + cluster.Tags = convertTagsPtrToOldSDK(conversion.ExpandTagsFromSetSchema(d)) } if d.HasChange("mongo_db_major_version") { diff --git a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go index de6aa266ad..5d34349677 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go @@ -47,6 +47,7 @@ func TestMigAdvancedCluster_asymmetricShardedNewSchema(t *testing.T) { // Check 10/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.disk_size_gb' not found // Check 11/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.1.region_configs.0.electable_specs.disk_iops' not found acc.SkipIfAdvancedClusterV2Schema(t) + mig.SkipIfVersionBelow(t, "1.23.0") // version where sharded cluster tier auto-scaling was introduced testCase := asymmetricShardedNewSchemaTestCase(t, false) mig.CreateAndRunTest(t, &testCase) } @@ -116,12 +117,12 @@ func TestMigAdvancedCluster_shardedMigrationFromOldToNewSchema(t *testing.T) { Steps: []resource.TestStep{ { ExternalProviders: acc.ExternalProviders(versionBeforeISSRelease), - Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, false), + Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, false, false), Check: checkShardedTransitionOldToNewSchema(false, false), }, { ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, - Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, true), + Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, true, false), Check: checkShardedTransitionOldToNewSchema(false, true), }, }, @@ -237,6 +238,32 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { }) } +func TestMigAdvancedCluster_newSchemaFromAutoscalingDisabledToEnabled(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + ) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: acc.PreCheckBasicSleep(t, nil, orgID, projectName), + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + ExternalProviders: acc.ExternalProviders("1.22.0"), // last version before cluster tier auto-scaling per shard was introduced + Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, true, false), + Check: checkIndependentShardScalingMode(clusterName, "CLUSTER"), + }, + { + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + Config: configShardedTransitionOldToNewSchema(t, false, orgID, projectName, clusterName, true, true), + Check: checkIndependentShardScalingMode(clusterName, "SHARD"), + }, + }, + }) +} + func configPartialAdvancedConfig(projectID, clusterName, extraArgs, autoScaling string) string { return fmt.Sprintf(` resource "mongodbatlas_advanced_cluster" "test" { diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index d68ea5e23f..16e2e787c5 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -1,7 +1,9 @@ package advancedcluster_test import ( + "context" "fmt" + "net/http" "os" "regexp" "strconv" @@ -9,9 +11,13 @@ import ( "time" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" + mockadmin20240530 "go.mongodb.org/atlas-sdk/v20240530005/mockadmin" "go.mongodb.org/atlas-sdk/v20241113003/admin" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" @@ -29,6 +35,61 @@ var ( configServerManagementModeAtlasManaged = "ATLAS_MANAGED" ) +func TestGetReplicationSpecAttributesFromOldAPI(t *testing.T) { + var ( + projectID = "11111" + clusterName = "testCluster" + ID = "111111" + numShard = 2 + zoneName = "ZoneName managed by Terraform" + ) + + testCases := map[string]struct { + mockCluster *admin20240530.AdvancedClusterDescription + mockResponse *http.Response + mockError error + expectedResult map[string]advancedcluster.OldShardConfigMeta + expectedError error + }{ + "Error in the API call": { + mockCluster: &admin20240530.AdvancedClusterDescription{}, + mockResponse: &http.Response{StatusCode: 400}, + mockError: errGeneric, + expectedError: errGeneric, + expectedResult: nil, + }, + "Successful": { + mockCluster: &admin20240530.AdvancedClusterDescription{ + ReplicationSpecs: &[]admin20240530.ReplicationSpec{ + { + NumShards: &numShard, + Id: &ID, + ZoneName: &zoneName, + }, + }, + }, + mockResponse: &http.Response{}, + mockError: nil, + expectedError: nil, + expectedResult: map[string]advancedcluster.OldShardConfigMeta{ + zoneName: {ID: ID, NumShard: numShard}, + }, + }, + } + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + testObject := mockadmin20240530.NewClustersApi(t) + + testObject.EXPECT().GetCluster(mock.Anything, mock.Anything, mock.Anything).Return(admin20240530.GetClusterApiRequest{ApiService: testObject}).Once() + testObject.EXPECT().GetClusterExecute(mock.Anything).Return(tc.mockCluster, tc.mockResponse, tc.mockError).Once() + + result, err := advancedcluster.GetReplicationSpecAttributesFromOldAPI(context.Background(), projectID, clusterName, testObject) + assert.Equal(t, tc.expectedError, err) + assert.Equal(t, tc.expectedResult, result) + }) + } +} + func TestAccClusterAdvancedCluster_basicTenant(t *testing.T) { var ( projectID = acc.ProjectIDExecution(t) @@ -637,11 +698,15 @@ func symmetricGeoShardedOldSchemaTestCase(t *testing.T, isAcc bool) resource.Tes Steps: []resource.TestStep{ { Config: configGeoShardedOldSchema(t, isAcc, orgID, projectName, clusterName, 2, 2, false), - Check: checkGeoShardedOldSchema(isAcc, clusterName, 2, 2, true, false), + Check: resource.ComposeAggregateTestCheckFunc( + checkGeoShardedOldSchema(isAcc, clusterName, 2, 2, true, false), + checkIndependentShardScalingMode(clusterName, "CLUSTER")), }, { Config: configGeoShardedOldSchema(t, isAcc, orgID, projectName, clusterName, 3, 3, false), - Check: checkGeoShardedOldSchema(isAcc, clusterName, 3, 3, true, false), + Check: resource.ComposeAggregateTestCheckFunc( + checkGeoShardedOldSchema(isAcc, clusterName, 3, 3, true, false), + checkIndependentShardScalingMode(clusterName, "CLUSTER")), }, }, } @@ -726,7 +791,10 @@ func asymmetricShardedNewSchemaTestCase(t *testing.T, isAcc bool) resource.TestC Steps: []resource.TestStep{ { Config: configShardedNewSchema(t, isAcc, orgID, projectName, clusterName, 50, "M30", "M40", admin.PtrInt(2000), admin.PtrInt(2500), false), - Check: checkShardedNewSchema(isAcc, 50, "M30", "M40", admin.PtrInt(2000), admin.PtrInt(2500), true, false), + Check: resource.ComposeAggregateTestCheckFunc( + checkShardedNewSchema(isAcc, 50, "M30", "M40", admin.PtrInt(2000), admin.PtrInt(2500), true, false), + resource.TestCheckResourceAttr("data.mongodbatlas_advanced_clusters.test-replication-specs-per-shard-false", "results.#", "0"), + checkIndependentShardScalingMode(clusterName, "SHARD")), }, }, } @@ -779,11 +847,13 @@ func TestAccClusterAdvancedClusterConfig_shardedTransitionFromOldToNewSchema(t * CheckDestroy: acc.CheckDestroyCluster, Steps: []resource.TestStep{ { - Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, false), - Check: checkShardedTransitionOldToNewSchema(true, false), + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, false, false), + Check: resource.ComposeAggregateTestCheckFunc( + checkShardedTransitionOldToNewSchema(true, false), + checkIndependentShardScalingMode(clusterName, "CLUSTER")), }, { - Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, true), + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, true, false), Check: checkShardedTransitionOldToNewSchema(true, true), }, }, @@ -1022,6 +1092,81 @@ func TestAccClusterAdvancedCluster_pinnedFCVWithVersionUpgradeAndDowngrade(t *te }) } +func TestAccAdvancedCluster_oldToNewSchemaWithAutoscalingEnabled(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + ) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: acc.PreCheckBasicSleep(t, nil, orgID, projectName), + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, false, true), + Check: checkIndependentShardScalingMode(clusterName, "CLUSTER"), + }, + { + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, true, true), + Check: checkIndependentShardScalingMode(clusterName, "SHARD"), + }, + }, + }) +} + +func TestAccAdvancedCluster_oldToNewSchemaWithAutoscalingDisabledToEnabled(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + clusterName = acc.RandomClusterName() + ) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: acc.PreCheckBasicSleep(t, nil, orgID, projectName), + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyCluster, + Steps: []resource.TestStep{ + { + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, false, false), + Check: checkIndependentShardScalingMode(clusterName, "CLUSTER"), + }, + { + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, true, false), + Check: checkIndependentShardScalingMode(clusterName, "CLUSTER"), + }, + { + Config: configShardedTransitionOldToNewSchema(t, true, orgID, projectName, clusterName, true, true), + Check: checkIndependentShardScalingMode(clusterName, "SHARD"), + }, + }, + }) +} + +func checkIndependentShardScalingMode(clusterName, expectedMode string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("not found: %s", resourceName) + } + if rs.Primary.ID == "" { + return fmt.Errorf("no ID is set") + } + projectID := rs.Primary.Attributes["project_id"] + issMode, _, err := acc.GetIndependentShardScalingMode(context.Background(), projectID, clusterName) + if err != nil { + return fmt.Errorf("error getting independent shard scaling mode: %w", err) + } + if *issMode != expectedMode { + return fmt.Errorf("expected independent shard scaling mode to be %s, got %s", expectedMode, *issMode) + } + return nil + } +} + func checkAggr(isAcc bool, attrsSet []string, attrsMap map[string]string, extra ...resource.TestCheckFunc) resource.TestCheckFunc { checks := []resource.TestCheckFunc{acc.CheckExistsCluster(resourceName)} checks = acc.AddAttrChecksSchemaV2(isAcc, resourceName, checks, attrsMap) @@ -1950,6 +2095,11 @@ func configShardedNewSchema(t *testing.T, isAcc bool, orgID, projectName, name s use_replication_spec_per_shard = true } + data "mongodbatlas_advanced_clusters" "test-replication-specs-per-shard-false" { + project_id = mongodbatlas_advanced_cluster.test.project_id + use_replication_spec_per_shard = false + } + data "mongodbatlas_advanced_clusters" "test" { project_id = mongodbatlas_advanced_cluster.test.project_id use_replication_spec_per_shard = true @@ -2095,12 +2245,20 @@ func checkGeoShardedNewSchema(isAcc, includeThirdShardInFirstZone bool) resource return checkAggr(isAcc, []string{}, clusterChecks) } -func configShardedTransitionOldToNewSchema(t *testing.T, isAcc bool, orgID, projectName, name string, useNewSchema bool) string { +func configShardedTransitionOldToNewSchema(t *testing.T, isAcc bool, orgID, projectName, name string, useNewSchema, autoscaling bool) string { t.Helper() var numShardsStr string if !useNewSchema { numShardsStr = `num_shards = 2` } + var autoscalingStr string + if autoscaling { + autoscalingStr = `auto_scaling { + compute_enabled = true + disk_gb_enabled = true + compute_max_instance_size = "M20" + }` + } replicationSpec := fmt.Sprintf(` replication_specs { %[1]s @@ -2116,9 +2274,10 @@ func configShardedTransitionOldToNewSchema(t *testing.T, isAcc bool, orgID, proj provider_name = "AWS" priority = 7 region_name = "EU_WEST_1" + %[2]s } } - `, numShardsStr) + `, numShardsStr, autoscalingStr) var replicationSpecs string if useNewSchema { diff --git a/internal/service/advancedcluster/resource_update_logic.go b/internal/service/advancedcluster/resource_update_logic.go index 978791e573..a8aff3958c 100644 --- a/internal/service/advancedcluster/resource_update_logic.go +++ b/internal/service/advancedcluster/resource_update_logic.go @@ -6,11 +6,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) -func noIDsPopulatedInReplicationSpecs(replicationSpecs *[]admin20240805.ReplicationSpec20240805) bool { +func noIDsPopulatedInReplicationSpecs(replicationSpecs *[]admin.ReplicationSpec20240805) bool { if replicationSpecs == nil || len(*replicationSpecs) == 0 { return false } @@ -22,7 +21,7 @@ func noIDsPopulatedInReplicationSpecs(replicationSpecs *[]admin20240805.Replicat return true } -func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName string, connV2ClusterAPI admin.ClustersApi, replicationSpecs *[]admin20240805.ReplicationSpec20240805) (*[]admin20240805.ReplicationSpec20240805, diag.Diagnostics) { +func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName string, connV2ClusterAPI admin.ClustersApi, replicationSpecs *[]admin.ReplicationSpec20240805) (*[]admin.ReplicationSpec20240805, diag.Diagnostics) { if replicationSpecs == nil || len(*replicationSpecs) == 0 { return replicationSpecs, nil } @@ -36,7 +35,7 @@ func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName str return &result, nil } -func AddIDsToReplicationSpecs(replicationSpecs []admin20240805.ReplicationSpec20240805, zoneToReplicationSpecsIDs map[string][]string) []admin20240805.ReplicationSpec20240805 { +func AddIDsToReplicationSpecs(replicationSpecs []admin.ReplicationSpec20240805, zoneToReplicationSpecsIDs map[string][]string) []admin.ReplicationSpec20240805 { for zoneName, availableIDs := range zoneToReplicationSpecsIDs { var indexOfIDToUse = 0 for i := range replicationSpecs { @@ -65,12 +64,12 @@ func groupIDsByZone(specs []admin.ReplicationSpec20240805) map[string][]string { // - Existing replication specs can have the autoscaling values present in the state with default values even if not defined in the config (case when cluster is imported) // - API expects autoScaling and analyticsAutoScaling aligned cross all region configs in the PATCH request // This function is needed to avoid errors if a new replication spec is added, ensuring the PATCH request will have the auto scaling aligned with other replication specs when not present in config. -func SyncAutoScalingConfigs(replicationSpecs *[]admin20240805.ReplicationSpec20240805) { +func SyncAutoScalingConfigs(replicationSpecs *[]admin.ReplicationSpec20240805) { if replicationSpecs == nil || len(*replicationSpecs) == 0 { return } - var defaultAnalyticsAutoScaling, defaultAutoScaling *admin20240805.AdvancedAutoScalingSettings + var defaultAnalyticsAutoScaling, defaultAutoScaling *admin.AdvancedAutoScalingSettings for _, spec := range *replicationSpecs { for i := range *spec.RegionConfigs { @@ -86,7 +85,7 @@ func SyncAutoScalingConfigs(replicationSpecs *[]admin20240805.ReplicationSpec202 applyDefaultAutoScaling(replicationSpecs, defaultAutoScaling, defaultAnalyticsAutoScaling) } -func applyDefaultAutoScaling(replicationSpecs *[]admin20240805.ReplicationSpec20240805, defaultAutoScaling, defaultAnalyticsAutoScaling *admin20240805.AdvancedAutoScalingSettings) { +func applyDefaultAutoScaling(replicationSpecs *[]admin.ReplicationSpec20240805, defaultAutoScaling, defaultAnalyticsAutoScaling *admin.AdvancedAutoScalingSettings) { for _, spec := range *replicationSpecs { for i := range *spec.RegionConfigs { regionConfig := &(*spec.RegionConfigs)[i] diff --git a/internal/service/advancedcluster/resource_update_logic_test.go b/internal/service/advancedcluster/resource_update_logic_test.go index 607ef5709c..5d7af23929 100644 --- a/internal/service/advancedcluster/resource_update_logic_test.go +++ b/internal/service/advancedcluster/resource_update_logic_test.go @@ -5,18 +5,17 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" "github.com/stretchr/testify/assert" - admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) func TestAddIDsToReplicationSpecs(t *testing.T) { testCases := map[string]struct { - ReplicationSpecs []admin20240805.ReplicationSpec20240805 + ReplicationSpecs []admin.ReplicationSpec20240805 ZoneToReplicationSpecsIDs map[string][]string - ExpectedReplicationSpecs []admin20240805.ReplicationSpec20240805 + ExpectedReplicationSpecs []admin.ReplicationSpec20240805 }{ "two zones with same amount of available ids and replication specs to populate": { - ReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), }, @@ -34,7 +33,7 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { "Zone 1": {"zone1-id1", "zone1-id2"}, "Zone 2": {"zone2-id1", "zone2-id2"}, }, - ExpectedReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ExpectedReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), Id: admin.PtrString("zone1-id1"), @@ -54,7 +53,7 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { }, }, "less available ids than replication specs to populate": { - ReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), }, @@ -72,7 +71,7 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { "Zone 1": {"zone1-id1"}, "Zone 2": {"zone2-id1"}, }, - ExpectedReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ExpectedReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), Id: admin.PtrString("zone1-id1"), @@ -92,7 +91,7 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { }, }, "more available ids than replication specs to populate": { - ReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), }, @@ -104,7 +103,7 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { "Zone 1": {"zone1-id1", "zone1-id2"}, "Zone 2": {"zone2-id1", "zone2-id2"}, }, - ExpectedReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ExpectedReplicationSpecs: []admin.ReplicationSpec20240805{ { ZoneName: admin.PtrString("Zone 1"), Id: admin.PtrString("zone1-id1"), @@ -127,23 +126,23 @@ func TestAddIDsToReplicationSpecs(t *testing.T) { func TestSyncAutoScalingConfigs(t *testing.T) { testCases := map[string]struct { - ReplicationSpecs []admin20240805.ReplicationSpec20240805 - ExpectedReplicationSpecs []admin20240805.ReplicationSpec20240805 + ReplicationSpecs []admin.ReplicationSpec20240805 + ExpectedReplicationSpecs []admin.ReplicationSpec20240805 }{ "apply same autoscaling options for new replication spec which does not have autoscaling defined": { - ReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ReplicationSpecs: []admin.ReplicationSpec20240805{ { Id: admin.PtrString("id-1"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, @@ -153,7 +152,7 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, { Id: admin.PtrString("id-2"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { AutoScaling: nil, AnalyticsAutoScaling: nil, @@ -161,19 +160,19 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, }, }, - ExpectedReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ExpectedReplicationSpecs: []admin.ReplicationSpec20240805{ { Id: admin.PtrString("id-1"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, @@ -183,16 +182,16 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, { Id: admin.PtrString("id-2"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, @@ -204,19 +203,19 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, // for this case the API will respond with an error and guide the user to align autoscaling options cross all nodes "when different autoscaling options are defined values will not be changed": { - ReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ReplicationSpecs: []admin.ReplicationSpec20240805{ { Id: admin.PtrString("id-1"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(true), ScaleDownEnabled: admin.PtrBool(true), }, @@ -226,15 +225,15 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, { Id: admin.PtrString("id-2"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(true), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), }, }, @@ -242,19 +241,19 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, }, }, - ExpectedReplicationSpecs: []admin20240805.ReplicationSpec20240805{ + ExpectedReplicationSpecs: []admin.ReplicationSpec20240805{ { Id: admin.PtrString("id-1"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), ScaleDownEnabled: admin.PtrBool(false), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(true), ScaleDownEnabled: admin.PtrBool(true), }, @@ -264,15 +263,15 @@ func TestSyncAutoScalingConfigs(t *testing.T) { }, { Id: admin.PtrString("id-2"), - RegionConfigs: &[]admin20240805.CloudRegionConfig20240805{ + RegionConfigs: &[]admin.CloudRegionConfig20240805{ { - AutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(true), }, }, - AnalyticsAutoScaling: &admin20240805.AdvancedAutoScalingSettings{ - Compute: &admin20240805.AdvancedComputeAutoScaling{ + AnalyticsAutoScaling: &admin.AdvancedAutoScalingSettings{ + Compute: &admin.AdvancedComputeAutoScaling{ Enabled: admin.PtrBool(false), }, }, diff --git a/internal/service/advancedclustertpf/README.md b/internal/service/advancedclustertpf/README.md index 8e4dcd2ae2..c94fe622b0 100644 --- a/internal/service/advancedclustertpf/README.md +++ b/internal/service/advancedclustertpf/README.md @@ -7,6 +7,6 @@ This package contains the WIP for `mongodbatlas_advanced_cluster` in TPF. Curren ## Changes in advancedcluster that needs to be added here (list changes done in advancedcluster which couldn't also be done here at that moment) - [PR #2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825) Add new `advanced_configuration.0.default_max_time_ms` attribute to mongodbatlas_advanced_cluster resource and data sources. - - +- feat: Ensures asymmetric auto-scaling is not defined in the cluster when using the old sharding configuration in mongodbatlas_advanced_cluster (https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2836) - `pinned_fcv` attribute was a recently added attribute in `advanced_cluster`. It has been defined in the new tpf schema but we need to make sure that the implementation is also present. + diff --git a/internal/testutil/acc/independent_shard_scaling.go b/internal/testutil/acc/independent_shard_scaling.go new file mode 100644 index 0000000000..7dc3f1e544 --- /dev/null +++ b/internal/testutil/acc/independent_shard_scaling.go @@ -0,0 +1,49 @@ +package acc + +import ( + "context" + "io" + "net/http" + "os" + + "github.com/mongodb-forks/digest" +) + +func GetIndependentShardScalingMode(ctx context.Context, projectID, clusterName string) (*string, *http.Response, error) { + baseURL := os.Getenv("MONGODB_ATLAS_BASE_URL") + req, err := http.NewRequestWithContext(ctx, http.MethodGet, baseURL+"test/utils/auth/groups/"+projectID+"/clusters/"+clusterName+"/independentShardScalingMode", http.NoBody) + if err != nil { + return nil, nil, err + } + + req.Header.Add("Accept", "*/*") + + transport := digest.NewTransport(os.Getenv("MONGODB_ATLAS_PUBLIC_KEY"), os.Getenv("MONGODB_ATLAS_PRIVATE_KEY")) + httpClient, err := transport.Client() + if err != nil { + return nil, nil, err + } + + resp, err := httpClient.Do(req) + if err != nil || resp == nil { + return nil, resp, err + } + + var result *string + result, err = decode(resp.Body) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} + +func decode(body io.ReadCloser) (*string, error) { + buf, err := io.ReadAll(body) + _ = body.Close() + if err != nil { + return nil, err + } + result := string(buf) + return &result, nil +} From f379847fc041909019a34a0edb330a0ae0174219 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Mon, 16 Dec 2024 11:37:42 +0000 Subject: [PATCH 08/40] chore: Updates CHANGELOG.md for #2891 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1f2add6b6..97c61b2e70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ ENHANCEMENTS: * data-source/mongodbatlas_cluster: Adds `pinned_fcv` attribute ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) * data-source/mongodbatlas_clusters: Adds `pinned_fcv` attribute ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) * resource/mongodbatlas_advanced_cluster: Adds `pinned_fcv` attribute ([#2789](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2789)) +* resource/mongodbatlas_advanced_cluster: Adjusts create operation to support cluster tier auto scaling per shard. ([#2836](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2836)) +* resource/mongodbatlas_advanced_cluster: Adjusts update operation to support cluster tier auto scaling per shard. ([#2814](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2814)) * resource/mongodbatlas_cluster: Adds `pinned_fcv` attribute ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) BUG FIXES: From 47633cebd85ff2f38137e5a3fc3231cc78832a22 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Mon, 16 Dec 2024 13:37:11 +0000 Subject: [PATCH 09/40] chore: Fixes converting to TPF by including all attributes in replication_specs (#2894) --- internal/testutil/acc/advanced_cluster_schema_v2.go | 6 ++++-- .../testutil/acc/advanced_cluster_schema_v2_test.go | 4 +++- internal/testutil/hcl/common.go | 13 +++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index 1bb7fc0ae0..c8965db6a9 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -146,7 +146,9 @@ func getReplicationSpecs(t *testing.T, body *hclsyntax.Body) cty.Value { assert.Equal(t, name, block.Type, "unexpected block type: %s", block.Type) vals = append(vals, hcl.GetAttrVal(t, block.Body)) } - return cty.ObjectVal(map[string]cty.Value{ + attributeValues := map[string]cty.Value{ name: cty.TupleVal(vals), - }) + } + hcl.AddAttributes(t, body, attributeValues) + return cty.ObjectVal(attributeValues) } diff --git a/internal/testutil/acc/advanced_cluster_schema_v2_test.go b/internal/testutil/acc/advanced_cluster_schema_v2_test.go index 98848f2925..348566fb10 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2_test.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2_test.go @@ -56,6 +56,7 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { cluster_type = "SHARDED" replication_specs { + zone_name = "zone1" region_configs { electable_specs { disk_size_gb = 10 @@ -198,7 +199,8 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { priority = 6 provider_name = "AZURE" region_name = "US_EAST_2" - }] + }] + zone_name = "zone1" }, { region_configs = [{ analytics_specs = { diff --git a/internal/testutil/hcl/common.go b/internal/testutil/hcl/common.go index 79de5a4dab..3ca51adcda 100644 --- a/internal/testutil/hcl/common.go +++ b/internal/testutil/hcl/common.go @@ -53,15 +53,20 @@ func getTF() *tfexec.Terraform { func GetAttrVal(t *testing.T, body *hclsyntax.Body) cty.Value { t.Helper() ret := make(map[string]cty.Value) + AddAttributes(t, body, ret) + for _, block := range body.Blocks { + ret[block.Type] = GetAttrVal(t, block.Body) + } + return cty.ObjectVal(ret) +} + +func AddAttributes(t *testing.T, body *hclsyntax.Body, ret map[string]cty.Value) { + t.Helper() for name, attr := range body.Attributes { val, diags := attr.Expr.Value(nil) require.False(t, diags.HasErrors(), "failed to parse attribute %s: %s", name, diags.Error()) ret[name] = val } - for _, block := range body.Blocks { - ret[block.Type] = GetAttrVal(t, block.Body) - } - return cty.ObjectVal(ret) } func PrettyHCL(t *testing.T, content string) string { From 064955c76fe59c0b4cd834b099ee331914ded1b0 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Mon, 16 Dec 2024 13:38:16 +0000 Subject: [PATCH 10/40] chore: Refactors fail_index_key_too_long to be compatible with old implementation and use zero values in advanced_configuration (#2893) * chore: Refactor fail_index_key_too_long to be compatible with old implementation and use zero values in advanced_configuration * chore: fix formatting * fix: nil pointer error * chore: Update failIndexKeyTooLong retrieval to use getter method --- ...l_ClusterDescriptionProcessArgs20240805.go | 34 +++++++++++++------ internal/service/advancedclustertpf/schema.go | 9 ++--- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go index dbcd79b6b1..ff14a68650 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go @@ -19,19 +19,31 @@ func AddAdvancedConfig(ctx context.Context, tfModel *TFModel, input *admin.Clust // special behavior using -1 when it is unset by the user changeStreamOptionsPreAndPostImagesExpireAfterSeconds = conversion.Pointer(-1) } + // When MongoDBMajorVersion is not 4.4 or lower, the API response for fail_index_key_too_long will always be null, to ensure no consistency issues, we need to match the config + failIndexKeyTooLong := inputLegacy.GetFailIndexKeyTooLong() + if tfModel != nil { + stateConfig := tfModel.AdvancedConfiguration + stateConfigSDK := NewAtlasReqAdvancedConfigurationLegacy(ctx, &stateConfig, diags) + if diags.HasError() { + return + } + if stateConfigSDK != nil && stateConfigSDK.GetFailIndexKeyTooLong() != failIndexKeyTooLong { + failIndexKeyTooLong = stateConfigSDK.GetFailIndexKeyTooLong() + } + } advancedConfig = TFAdvancedConfigurationModel{ ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(changeStreamOptionsPreAndPostImagesExpireAfterSeconds)), - DefaultWriteConcern: types.StringPointerValue(input.DefaultWriteConcern), - DefaultReadConcern: types.StringPointerValue(inputLegacy.DefaultReadConcern), - FailIndexKeyTooLong: types.BoolPointerValue(inputLegacy.FailIndexKeyTooLong), - JavascriptEnabled: types.BoolPointerValue(input.JavascriptEnabled), - MinimumEnabledTlsProtocol: types.StringPointerValue(input.MinimumEnabledTlsProtocol), - NoTableScan: types.BoolPointerValue(input.NoTableScan), - OplogMinRetentionHours: types.Float64PointerValue(input.OplogMinRetentionHours), - OplogSizeMb: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.OplogSizeMB)), - SampleSizeBiconnector: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.SampleSizeBIConnector)), - SampleRefreshIntervalBiconnector: types.Int64PointerValue(conversion.IntPtrToInt64Ptr(input.SampleRefreshIntervalBIConnector)), - TransactionLifetimeLimitSeconds: types.Int64PointerValue(input.TransactionLifetimeLimitSeconds), + DefaultWriteConcern: types.StringValue(conversion.SafeValue(input.DefaultWriteConcern)), + DefaultReadConcern: types.StringValue(conversion.SafeValue(inputLegacy.DefaultReadConcern)), + FailIndexKeyTooLong: types.BoolValue(failIndexKeyTooLong), + JavascriptEnabled: types.BoolValue(conversion.SafeValue(input.JavascriptEnabled)), + MinimumEnabledTlsProtocol: types.StringValue(conversion.SafeValue(input.MinimumEnabledTlsProtocol)), + NoTableScan: types.BoolValue(conversion.SafeValue(input.NoTableScan)), + OplogMinRetentionHours: types.Float64Value(conversion.SafeValue(input.OplogMinRetentionHours)), + OplogSizeMb: types.Int64Value(conversion.SafeValue(conversion.IntPtrToInt64Ptr(input.OplogSizeMB))), + SampleSizeBiconnector: types.Int64Value(conversion.SafeValue(conversion.IntPtrToInt64Ptr(input.SampleSizeBIConnector))), + SampleRefreshIntervalBiconnector: types.Int64Value(conversion.SafeValue(conversion.IntPtrToInt64Ptr(input.SampleRefreshIntervalBIConnector))), + TransactionLifetimeLimitSeconds: types.Int64Value(conversion.SafeValue(input.TransactionLifetimeLimitSeconds)), } } objType, diagsLocal := types.ObjectValueFrom(ctx, AdvancedConfigurationObjType.AttrTypes, advancedConfig) diff --git a/internal/service/advancedclustertpf/schema.go b/internal/service/advancedclustertpf/schema.go index 547390cd18..cc487771bc 100644 --- a/internal/service/advancedclustertpf/schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -527,12 +527,9 @@ func AdvancedConfigurationSchema(ctx context.Context) schema.SingleNestedAttribu MarkdownDescription: "default_read_concern", // TODO: add description }, "fail_index_key_too_long": schema.BoolAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, - Computed: true, - Optional: true, - PlanModifiers: []planmodifier.Bool{ - PlanMustUseMongoDBVersion(4.4, EqualOrLower), - }, + DeprecationMessage: DeprecationMsgOldSchema, + Computed: true, + Optional: true, MarkdownDescription: "fail_index_key_too_long", // TODO: add description }, }, From 61eda15846a6623b9b4906bed1e7d7c1793504d8 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:49:36 +0100 Subject: [PATCH 11/40] chore: Uses `use_replication_spec_per_shard` in data sources (#2896) * enable TestAccClusterAdvancedClusterConfig_asymmetricShardedNewSchema * overrideUsingLegacySchema * numShardsMapFromOldAPI * refactor ExtraAPIInfo build * address feedback * typo * fill some computed null values * Revert "fill some computed null values" This reverts commit bab0bcfd52e28ebf22b8edf03f163eb00f923cae. * fill null value for BackingProviderName * clause when legacy cluster model can't be created * Revert "fill null value for BackingProviderName" This reverts commit 1fb37c1da41f1cc7639f8dd68a8ee90ebc44719e. * skip id checks in replication_specs --- .../resource_advanced_cluster_test.go | 31 +++++++------ .../service/advancedclustertpf/data_source.go | 3 +- .../advancedclustertpf/plural_data_source.go | 3 +- .../service/advancedclustertpf/resource.go | 13 ++++-- .../resource_compatibility_reuse.go | 18 ++------ .../resource_compatiblity.go | 46 +++++++++++++++---- 6 files changed, 66 insertions(+), 48 deletions(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 16e2e787c5..5b61541d39 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -771,8 +772,6 @@ func TestAccClusterAdvancedClusterConfig_symmetricShardedNewSchemaToAsymmetricAd } func TestAccClusterAdvancedClusterConfig_asymmetricShardedNewSchema(t *testing.T) { - // TODO: enable when datasource attribute use_replication_spec_per_shard is used - acc.SkipIfAdvancedClusterV2Schema(t) resource.ParallelTest(t, asymmetricShardedNewSchemaTestCase(t, true)) } @@ -2141,19 +2140,21 @@ func checkShardedNewSchema(isAcc bool, diskSizeGB int, firstInstanceSize, lastIn pluralChecks = acc.AddAttrChecksPrefixSchemaV2(isAcc, dataSourcePluralName, pluralChecks, clusterChecks, "results.0") - // expected id attribute only if cluster is symmetric - if isAsymmetricCluster { - pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{}, map[string]string{ - "replication_specs.0.id": "", - "replication_specs.1.id": "", - })) - pluralChecks = acc.AddAttrChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, map[string]string{ - "results.0.replication_specs.0.id": "", - "results.0.replication_specs.1.id": "", - }) - } else { - pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{"replication_specs.0.id", "replication_specs.1.id"}, map[string]string{})) - pluralChecks = acc.AddAttrSetChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, "results.0.replication_specs.0.id", "results.0.replication_specs.1.id") + if !config.AdvancedClusterV2Schema() { // TODDO: id is not filled yet in + // expected id attribute only if cluster is symmetric + if isAsymmetricCluster { + pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{}, map[string]string{ + "replication_specs.0.id": "", + "replication_specs.1.id": "", + })) + pluralChecks = acc.AddAttrChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, map[string]string{ + "results.0.replication_specs.0.id": "", + "results.0.replication_specs.1.id": "", + }) + } else { + pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{"replication_specs.0.id", "replication_specs.1.id"}, map[string]string{})) + pluralChecks = acc.AddAttrSetChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, "results.0.replication_specs.0.id", "results.0.replication_specs.1.id") + } } return checkAggr(isAcc, diff --git a/internal/service/advancedclustertpf/data_source.go b/internal/service/advancedclustertpf/data_source.go index b95aff557c..d3afe998ab 100644 --- a/internal/service/advancedclustertpf/data_source.go +++ b/internal/service/advancedclustertpf/data_source.go @@ -60,8 +60,7 @@ func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS * ProjectID: modelDS.ProjectID, Name: modelDS.Name, } - // TODO: pass !UseReplicationSpecPerShard to overrideUsingLegacySchema - modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn) + modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn, !useReplicationSpecPerShard) if diags.HasError() { return nil } diff --git a/internal/service/advancedclustertpf/plural_data_source.go b/internal/service/advancedclustertpf/plural_data_source.go index 6c8178345c..f9c83bbcbe 100644 --- a/internal/service/advancedclustertpf/plural_data_source.go +++ b/internal/service/advancedclustertpf/plural_data_source.go @@ -73,8 +73,7 @@ func (d *pluralDS) readClusters(ctx context.Context, diags *diag.Diagnostics, pl ProjectID: pluralModel.ProjectID, Name: types.StringValue(clusterResp.GetName()), } - // TODO: pass !UseReplicationSpecPerShard to overrideUsingLegacySchema - modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn) + modelOut, extraInfo := getBasicClusterModel(ctx, diags, d.Client, clusterResp, modelIn, !useReplicationSpecPerShard) if diags.HasError() { return nil } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 265705ab90..1ed3e8d9bf 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -131,7 +131,7 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou } modelOut := &state if clusterResp != nil { - modelOut, _ = getBasicClusterModel(ctx, diags, r.Client, clusterResp, &plan) + modelOut, _ = getBasicClusterModel(ctx, diags, r.Client, clusterResp, &plan, false) if diags.HasError() { return } @@ -239,7 +239,7 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn return nil } } - modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, clusterResp, plan) + modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, clusterResp, plan, false) if diags.HasError() { return nil } @@ -263,7 +263,7 @@ func (r *rs) readCluster(ctx context.Context, diags *diag.Diagnostics, modelIn * diags.AddError("errorRead", fmt.Sprintf(errorRead, clusterName, err.Error())) return nil } - modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, readResp, modelIn) + modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, readResp, modelIn, false) if diags.HasError() { return nil } @@ -429,11 +429,14 @@ func (r *rs) applyTenantUpgrade(ctx context.Context, plan *TFModel, upgradeReque return AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) } -func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, clusterResp *admin.ClusterDescription20240805, modelIn *TFModel) (*TFModel, *ExtraAPIInfo) { - apiInfo := resolveAPIInfo(ctx, modelIn, diags, clusterResp, client) +func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, clusterResp *admin.ClusterDescription20240805, modelIn *TFModel, forceLegacySchema bool) (*TFModel, *ExtraAPIInfo) { + apiInfo := resolveAPIInfo(ctx, diags, client, modelIn, clusterResp, forceLegacySchema) if diags.HasError() { return nil, nil } + if forceLegacySchema && apiInfo.AsymmetricShardUnsupported { // can't create a model if legacy is forced but cluster does not support it + return nil, apiInfo + } modelOut := NewTFModel(ctx, clusterResp, modelIn.Timeouts, diags, *apiInfo) if diags.HasError() { return nil, nil diff --git a/internal/service/advancedclustertpf/resource_compatibility_reuse.go b/internal/service/advancedclustertpf/resource_compatibility_reuse.go index e3dd10df5e..2ad6877b2f 100644 --- a/internal/service/advancedclustertpf/resource_compatibility_reuse.go +++ b/internal/service/advancedclustertpf/resource_compatibility_reuse.go @@ -105,23 +105,13 @@ func getAdvancedClusterContainerID(containers []admin.CloudProviderContainer, cl return "" } -func getReplicationSpecIDsFromOldAPI(ctx context.Context, projectID, clusterName string, api admin20240530.ClustersApi) (zoneNameSpecIDs map[string]string, asymmetricShardUnsupported bool, err error) { - var clusterOldAPI *admin20240530.AdvancedClusterDescription - clusterOldAPI, _, err = api.GetCluster(ctx, projectID, clusterName).Execute() - if err != nil { - if apiError, ok := admin20240530.AsError(err); ok { - if apiError.GetErrorCode() == "ASYMMETRIC_SHARD_UNSUPPORTED" { - return nil, true, nil // an error is expected in old API in case of an asymmetric shard. In that case, replication_specs.*.id attribute will not be populated. - } - } - return nil, false, fmt.Errorf("error reading advanced cluster with 2023-02-01 API (%s): %s", clusterName, err) - } - specs := clusterOldAPI.GetReplicationSpecs() - zoneNameSpecIDs = make(map[string]string, len(specs)) +func replicationSpecIDsFromOldAPI(clusterRespOld *admin20240530.AdvancedClusterDescription) map[string]string { + specs := clusterRespOld.GetReplicationSpecs() + zoneNameSpecIDs := make(map[string]string, len(specs)) for _, spec := range specs { zoneNameSpecIDs[spec.GetZoneName()] = spec.GetId() } - return zoneNameSpecIDs, false, nil + return zoneNameSpecIDs } func convertHardwareSpecToOldSDK(hwspec *admin.HardwareSpec20240805) *admin20240530.HardwareSpec { diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index 85130bb473..a0cd777939 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -2,12 +2,14 @@ package advancedclustertpf import ( "context" + "fmt" "reflect" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) @@ -37,13 +39,22 @@ func findNumShardsUpdates(ctx context.Context, state, plan *TFModel, diags *diag return planCounts } -func resolveAPIInfo(ctx context.Context, plan *TFModel, diags *diag.Diagnostics, clusterLatest *admin.ClusterDescription20240805, client *config.MongoDBClient) *ExtraAPIInfo { - rootDiskSize := conversion.NilForUnknown(plan.DiskSizeGB, plan.DiskSizeGB.ValueFloat64Pointer()) - projectID := plan.ProjectID.ValueString() - zoneNameSpecIDs, asymmetricShardUnsupported, err := getReplicationSpecIDsFromOldAPI(ctx, projectID, plan.Name.ValueString(), client.AtlasV220240530.ClustersApi) +func resolveAPIInfo(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, plan *TFModel, clusterLatest *admin.ClusterDescription20240805, forceLegacySchema bool) *ExtraAPIInfo { + var ( + api20240530 = client.AtlasV220240530.ClustersApi + rootDiskSize = conversion.NilForUnknown(plan.DiskSizeGB, plan.DiskSizeGB.ValueFloat64Pointer()) + projectID = plan.ProjectID.ValueString() + clusterName = plan.Name.ValueString() + asymmetricShardUnsupported = false + ) + clusterRespOld, _, err := api20240530.GetCluster(ctx, projectID, clusterName).Execute() if err != nil { - diags.AddError("getReplicationSpecIDsFromOldAPI", err.Error()) - return nil + if admin20240530.IsErrorCode(err, "ASYMMETRIC_SHARD_UNSUPPORTED") { + asymmetricShardUnsupported = true + } else { + diags.AddError("errorRead", fmt.Sprintf("error reading advanced cluster with 2024-05-30 API (%s): %s", clusterName, err)) + return nil + } } if rootDiskSize == nil { rootDiskSize = findRegionRootDiskSize(clusterLatest.ReplicationSpecs) @@ -53,14 +64,20 @@ func resolveAPIInfo(ctx context.Context, plan *TFModel, diags *diag.Diagnostics, diags.AddError("resolveContainerIDs failed", err.Error()) return nil } - return &ExtraAPIInfo{ + info := &ExtraAPIInfo{ ContainerIDs: containerIDs, - UsingLegacySchema: usingLegacySchema(ctx, plan.ReplicationSpecs, diags), - ZoneNameNumShards: numShardsMap(ctx, plan.ReplicationSpecs, diags), RootDiskSize: rootDiskSize, - ZoneNameReplicationSpecIDs: zoneNameSpecIDs, + ZoneNameReplicationSpecIDs: replicationSpecIDsFromOldAPI(clusterRespOld), AsymmetricShardUnsupported: asymmetricShardUnsupported, } + if forceLegacySchema { + info.UsingLegacySchema = true + info.ZoneNameNumShards = numShardsMapFromOldAPI(clusterRespOld) // plan is empty in data source Read when forcing legacy, so we get num_shards from the old API + } else { + info.UsingLegacySchema = usingLegacySchema(ctx, plan.ReplicationSpecs, diags) + info.ZoneNameNumShards = numShardsMap(ctx, plan.ReplicationSpecs, diags) + } + return info } // instead of using `num_shards` explode the replication specs, and set disk_size_gb @@ -182,6 +199,15 @@ func numShardsMap(ctx context.Context, input types.List, diags *diag.Diagnostics return counts } +func numShardsMapFromOldAPI(clusterRespOld *admin20240530.AdvancedClusterDescription) map[string]int64 { + ret := make(map[string]int64) + for i := range clusterRespOld.GetReplicationSpecs() { + spec := &clusterRespOld.GetReplicationSpecs()[i] + ret[spec.GetZoneName()] = int64(spec.GetNumShards()) + } + return ret +} + func isNumShardsGreaterThanOne(counts []int64) bool { for _, count := range counts { if count > 1 { From 759363ae904e232b54e57588932b6573631bb9c2 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Tue, 17 Dec 2024 08:54:48 +0100 Subject: [PATCH 12/40] range int (#2900) --- internal/common/conversion/model_generation.go | 2 +- internal/service/advancedcluster/model_advanced_cluster.go | 6 +++--- .../alertconfiguration/data_source_alert_configuration.go | 2 +- .../service/alertconfiguration/model_alert_configuration.go | 2 +- .../resource_cloud_provider_access_authorization.go | 2 +- .../service/customdbrole/resource_custom_db_role_test.go | 2 +- .../resource_project_ip_access_list_test.go | 2 +- internal/service/resourcepolicy/resource_test.go | 2 +- internal/service/team/update_user.go | 2 +- internal/testutil/unit/http_mocker_round_tripper.go | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/common/conversion/model_generation.go b/internal/common/conversion/model_generation.go index f44c75624b..9f49d6af15 100644 --- a/internal/common/conversion/model_generation.go +++ b/internal/common/conversion/model_generation.go @@ -20,7 +20,7 @@ func CopyModel[T any](src any) (*T, error) { } typeSrc := valSrc.Type() typeDest := valDest.Type() - for i := 0; i < typeDest.NumField(); i++ { + for i := range typeDest.NumField() { fieldDest := typeDest.Field(i) name := fieldDest.Name { diff --git a/internal/service/advancedcluster/model_advanced_cluster.go b/internal/service/advancedcluster/model_advanced_cluster.go index 3e9d9a35eb..6df4762d09 100644 --- a/internal/service/advancedcluster/model_advanced_cluster.go +++ b/internal/service/advancedcluster/model_advanced_cluster.go @@ -417,7 +417,7 @@ func flattenTags(tags *[]admin.ResourceTag) []map[string]string { func CheckRegionConfigsPriorityOrder(regionConfigs []admin.ReplicationSpec20240805) error { for _, spec := range regionConfigs { configs := spec.GetRegionConfigs() - for i := 0; i < len(configs)-1; i++ { + for i := range len(configs) - 1 { if configs[i].GetPriority() < configs[i+1].GetPriority() { return errors.New("priority values in region_configs must be in descending order") } @@ -430,7 +430,7 @@ func CheckRegionConfigsPriorityOrder(regionConfigs []admin.ReplicationSpec202408 func CheckRegionConfigsPriorityOrderOld(regionConfigs []admin20240530.ReplicationSpec) error { for _, spec := range regionConfigs { configs := spec.GetRegionConfigs() - for i := 0; i < len(configs)-1; i++ { + for i := range len(configs) - 1 { if configs[i].GetPriority() < configs[i+1].GetPriority() { return errors.New("priority values in region_configs must be in descending order") } @@ -603,7 +603,7 @@ func flattenAdvancedReplicationSpecsLogic[T ReplicationSpecSDKModel]( tfList := make([]map[string]any, len(apiObjects)) wasAPIObjectUsed := make([]bool, len(apiObjects)) - for i := 0; i < len(tfList); i++ { + for i := range len(tfList) { var tfMapObject map[string]any if len(tfMapObjects) > i { diff --git a/internal/service/alertconfiguration/data_source_alert_configuration.go b/internal/service/alertconfiguration/data_source_alert_configuration.go index 4a9e812c6c..a06ae67a2c 100644 --- a/internal/service/alertconfiguration/data_source_alert_configuration.go +++ b/internal/service/alertconfiguration/data_source_alert_configuration.go @@ -335,7 +335,7 @@ func outputAlertConfigurationResourceHcl(label string, alert *admin.GroupAlertsC } notifications := alert.GetNotifications() - for i := 0; i < len(notifications); i++ { + for i := range len(notifications) { appendBlockWithCtyValues(resource, "notification", []string{}, convertNotificationToCtyValues(¬ifications[i])) } diff --git a/internal/service/alertconfiguration/model_alert_configuration.go b/internal/service/alertconfiguration/model_alert_configuration.go index 311310a0d1..5c8f3930a1 100644 --- a/internal/service/alertconfiguration/model_alert_configuration.go +++ b/internal/service/alertconfiguration/model_alert_configuration.go @@ -311,7 +311,7 @@ func NewTFAlertConfigurationDSModelList(alerts []admin.GroupAlertsConfig, projec results := make([]TFAlertConfigurationDSModel, len(alerts)) - for i := 0; i < len(alerts); i++ { + for i := range len(alerts) { alert := alerts[i] label := fmt.Sprintf("%s_%d", *alert.EventTypeName, i) resultAlertConfigModel := NewTfAlertConfigurationDSModel(&alerts[i], projectID) diff --git a/internal/service/cloudprovideraccess/resource_cloud_provider_access_authorization.go b/internal/service/cloudprovideraccess/resource_cloud_provider_access_authorization.go index 7f06839e49..713e2e579c 100644 --- a/internal/service/cloudprovideraccess/resource_cloud_provider_access_authorization.go +++ b/internal/service/cloudprovideraccess/resource_cloud_provider_access_authorization.go @@ -284,7 +284,7 @@ func authorizeRole(ctx context.Context, client *admin.APIClient, d *schema.Resou var role *admin.CloudProviderAccessRole var err error - for i := 0; i < 3; i++ { + for range 3 { role, _, err = client.CloudProviderAccessApi.AuthorizeCloudProviderAccessRole(ctx, projectID, roleID, req).Execute() if err != nil && strings.Contains(err.Error(), "CANNOT_ASSUME_ROLE") { // aws takes time to update , in case of single path log.Printf("warning issue performing authorize: %s \n", err.Error()) diff --git a/internal/service/customdbrole/resource_custom_db_role_test.go b/internal/service/customdbrole/resource_custom_db_role_test.go index 583ebac62f..019569c539 100644 --- a/internal/service/customdbrole/resource_custom_db_role_test.go +++ b/internal/service/customdbrole/resource_custom_db_role_test.go @@ -382,7 +382,7 @@ func TestAccConfigRSCustomDBRoles_MultipleResources(t *testing.T) { orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") ) - for i := 0; i < 5; i++ { + for i := range 5 { roleName := fmt.Sprintf("test-acc-custom_role-%d", i) projectName := acc.RandomProjectName() t.Run(roleName, func(t *testing.T) { diff --git a/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go b/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go index b75d5f6f1f..24350713d1 100644 --- a/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go +++ b/internal/service/projectipaccesslist/resource_project_ip_access_list_test.go @@ -117,7 +117,7 @@ func TestAccProjectIPAccessList_settingMultiple(t *testing.T) { checks = []resource.TestCheckFunc{} ) - for i := 0; i < ipWhiteListCount; i++ { + for i := range ipWhiteListCount { entry := make(map[string]string) entryName := "" ipAddr := "" diff --git a/internal/service/resourcepolicy/resource_test.go b/internal/service/resourcepolicy/resource_test.go index 112bcf5dde..fad86921aa 100644 --- a/internal/service/resourcepolicy/resource_test.go +++ b/internal/service/resourcepolicy/resource_test.go @@ -163,7 +163,7 @@ func checksResourcePolicy(orgID, name string, policyCount int) resource.TestChec } checks := []resource.TestCheckFunc{checkExists()} checks = acc.AddAttrChecks(dataSourcePluralID, checks, pluralMap) - for i := 0; i < policyCount; i++ { + for i := range policyCount { checks = acc.AddAttrSetChecks(resourceID, checks, fmt.Sprintf("policies.%d.body", i), fmt.Sprintf("policies.%d.id", i)) checks = acc.AddAttrSetChecks(dataSourceID, checks, fmt.Sprintf("policies.%d.body", i), fmt.Sprintf("policies.%d.id", i)) checks = acc.AddAttrSetChecks(dataSourcePluralID, checks, fmt.Sprintf("results.0.policies.%d.body", i), fmt.Sprintf("results.0.policies.%d.id", i)) diff --git a/internal/service/team/update_user.go b/internal/service/team/update_user.go index 9b9716ed4a..941900559c 100644 --- a/internal/service/team/update_user.go +++ b/internal/service/team/update_user.go @@ -77,7 +77,7 @@ func GetChangesForTeamUsers(currentUsers, newUsers []admin.CloudAppUser) (toAdd, func InitUserSet(users []admin.CloudAppUser) map[string]bool { usersSet := make(map[string]bool, len(users)) - for i := 0; i < len(users); i++ { + for i := range len(users) { usersSet[users[i].GetId()] = true } return usersSet diff --git a/internal/testutil/unit/http_mocker_round_tripper.go b/internal/testutil/unit/http_mocker_round_tripper.go index be0d6bfe1c..c33b09671a 100644 --- a/internal/testutil/unit/http_mocker_round_tripper.go +++ b/internal/testutil/unit/http_mocker_round_tripper.go @@ -138,7 +138,7 @@ func (r *MockRoundTripper) CheckStepRequests(_ *terraform.State) error { missingRequestsCount := len(req.Responses) - r.usedResponses[req.id()] if missingRequestsCount > 0 { missingIndexes := []string{} - for i := 0; i < missingRequestsCount; i++ { + for i := range missingRequestsCount { missingResponse := (len(req.Responses) - missingRequestsCount) + i missingIndexes = append(missingIndexes, fmt.Sprintf("%d", req.Responses[missingResponse].ResponseIndex)) } From 433c0ada561f24f175c4aae959b66007d4f8de21 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Tue, 17 Dec 2024 08:19:00 +0000 Subject: [PATCH 13/40] chore: Handles replication specs updates as in SDKv2 and enables most of remaining SDKv2 Acc Tests (#2895) * chore: Refactor fail_index_key_too_long to be compatible with old implementation and use zero values in advanced_configuration * chore: fix formatting * fix: nil pointer error * chore: Refactor fail_index_key_too_long to be compatible with old implementation and use zero values in advanced_configuration * chore: fix formatting * fix: nil pointer error * chore: Fixes converting to TPF by including all attributes in replication_specs * fix: Prevent increasing num_shards from 1 when state doesn't use it * refactor: Normalizing state can lead to replication specs updates when nodeCount=0 in an electable spec, therefore, not safe * refactor: Normalizing state can lead to replication specs updates when nodeCount=0 in an electable spec, therefore, not safe * fix: Update EbsVolumeType conversion to handle nil or empty string cases * test: Support updating data files with updated diff requests * chore: regenerate mock data * refactor: Enable more tests in TPF * refactor: Enhance patch operations to support suffix and prefix ignore/include options * refactor: Add patch options to ignore and include specific state fields * chore: Re-generate diff payloads * refactor:use existing variable when no variable exist in config, probably there will be an import error if `{groupId`} is used as projectId * refactor: Enable TestAccClusterAdvancedCluster_singleShardedMultiCloud test case * test: Enable another test * refactor: Add AllowOutOfOrder option to MockHTTPDataConfig and update MockRoundTripper behavior * test: Enable more tests for TPF * fix lint error * chore: Update failIndexKeyTooLong retrieval to use getter method * test: Skip tests for Advanced Cluster V2 schema due to unimplemented features * refactor: Replace string checks with strconv.ParseBool for environment variable validation * refactor: Simplify variable declarations in newAttrPatchOperations function * Use empty string when legacyID is not set * add workaround for TPF data source is not fully implemented yet * remove err check in ParseBool * fix: num_shards updates detection * fix: handle nil patch in tenant upgrade request * feat: add forceUpdateAttr option to force update of replication specs when num_shards have changed * revert earlier num_shards fix * chore: remove debugging code [ci skip] * fix: update patch options to use ForceUpdateAttr for replicationSpecs * Revert "add workaround for TPF data source is not fully implemented yet" This reverts commit 6c2516c40cbb28713bcd44ca9f6a69aeb4b03166. * remove: todo for `id` * feat: Support isSchemaUpgrade to handle legacy to new schema * test: Skip TestAccClusterAdvancedClusterConfig_asymmetricGeoShardedNewSchemaAddingRemovingShard until full replication_specs support is added --- internal/common/conversion/error_framework.go | 12 ++ internal/common/update/patch_payload.go | 48 ++++++-- internal/common/update/patch_payload_test.go | 52 ++++++--- ...esource_advanced_cluster_migration_test.go | 11 +- .../resource_advanced_cluster_test.go | 105 +++++------------- .../model_ClusterDescription20240805.go | 2 +- .../model_to_ClusterDescription20240805.go | 2 +- .../service/advancedclustertpf/resource.go | 31 +++++- .../resource_compatibility_reuse.go | 26 +++++ .../resource_compatiblity.go | 19 ---- ...cMockableAdvancedCluster_shardedBasic.yaml | 2 +- ...Id}_clusters_{clusterName}_2024-08-05.json | 12 +- ...ncedCluster_symmetricShardedOldSchema.yaml | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 20 ---- ...edOldSchemaDiskSizeGBAtElectableLevel.yaml | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 11 +- internal/testutil/unit/http_mocker.go | 42 +++++-- .../unit/http_mocker_config_capture.go | 13 ++- .../unit/http_mocker_round_tripper.go | 24 +++- .../unit/http_mocker_round_tripper_test.go | 2 + 20 files changed, 247 insertions(+), 191 deletions(-) diff --git a/internal/common/conversion/error_framework.go b/internal/common/conversion/error_framework.go index 5586456cdf..dde00c5cbf 100644 --- a/internal/common/conversion/error_framework.go +++ b/internal/common/conversion/error_framework.go @@ -4,6 +4,8 @@ import ( "encoding/json" "github.com/hashicorp/terraform-plugin-framework/diag" + + legacyDiag "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) type ErrBody interface { @@ -32,3 +34,13 @@ func AddJSONBodyErrorToDiagnostics(msgPrefix string, err error, diags *diag.Diag errorJSON := string(errorBytes) diags.AddError(msgPrefix, errorJSON) } + +func AddLegacyDiags(diags *diag.Diagnostics, legacyDiags legacyDiag.Diagnostics) { + for _, diag := range legacyDiags { + if diag.Severity == legacyDiag.Error { + diags.AddError(diag.Summary, diag.Detail) + } else { + diags.AddWarning(diag.Summary, diag.Detail) + } + } +} diff --git a/internal/common/update/patch_payload.go b/internal/common/update/patch_payload.go index a5ac0cfe40..3b10f1873e 100644 --- a/internal/common/update/patch_payload.go +++ b/internal/common/update/patch_payload.go @@ -12,28 +12,55 @@ import ( ) type attrPatchOperations struct { - data map[string][]jsondiff.Operation - ignoreInState []string + data map[string][]jsondiff.Operation + ignoreInStateSuffix []string + ignoreInStatePrefix []string + includeInStateSuffix []string + forceUpdateAttr []string } func (m *attrPatchOperations) ignoreInStatePath(path string) bool { - for _, ignore := range m.ignoreInState { + for _, include := range m.includeInStateSuffix { + suffix := "/" + include + if strings.HasSuffix(path, suffix) { + return false + } + } + for _, ignore := range m.ignoreInStateSuffix { suffix := "/" + ignore if strings.HasSuffix(path, suffix) { return true } } + for _, ignore := range m.ignoreInStatePrefix { + for _, part := range strings.Split(path, "/") { + if ignore == part { + return true + } + } + } return false } func newAttrPatchOperations(patch jsondiff.Patch, options []PatchOptions) *attrPatchOperations { - ignoreInState := []string{} + var ( + ignoreSuffixInState []string + ignorePrefixInState []string + includeSuffixInState []string + forceUpdateAttr []string + ) for _, option := range options { - ignoreInState = append(ignoreInState, option.IgnoreInState...) + ignoreSuffixInState = append(ignoreSuffixInState, option.IgnoreInStateSuffix...) + ignorePrefixInState = append(ignorePrefixInState, option.IgnoreInStatePrefix...) + includeSuffixInState = append(includeSuffixInState, option.IncludeInStateSuffix...) + forceUpdateAttr = append(forceUpdateAttr, option.ForceUpdateAttr...) } self := &attrPatchOperations{ - data: map[string][]jsondiff.Operation{}, - ignoreInState: ignoreInState, + data: map[string][]jsondiff.Operation{}, + ignoreInStateSuffix: ignoreSuffixInState, + ignoreInStatePrefix: ignorePrefixInState, + includeInStateSuffix: includeSuffixInState, + forceUpdateAttr: forceUpdateAttr, } for _, op := range patch { if op.Path == "" { @@ -81,7 +108,7 @@ func (m *attrPatchOperations) hasChanged(attr string) bool { func (m *attrPatchOperations) ChangedAttributes() []string { attrs := []string{} for attr := range m.data { - if m.hasChanged(attr) { + if m.hasChanged(attr) || slices.Contains(m.forceUpdateAttr, attr) { attrs = append(attrs, attr) } } @@ -136,7 +163,10 @@ func convertJSONDiffToJSONPatch(patch jsondiff.Patch) (jsonpatch.Patch, error) { // Current limitation if the field is set as part of a nested attribute in a map type PatchOptions struct { - IgnoreInState []string + IgnoreInStateSuffix []string + IgnoreInStatePrefix []string + IncludeInStateSuffix []string + ForceUpdateAttr []string } // PatchPayload uses the state and plan to changes to find the patch request, including changes only when: diff --git a/internal/common/update/patch_payload_test.go b/internal/common/update/patch_payload_test.go index fa6b142a8c..8106d7453e 100644 --- a/internal/common/update/patch_payload_test.go +++ b/internal/common/update/patch_payload_test.go @@ -22,17 +22,18 @@ func TestPatchReplicationSpecs(t *testing.T) { replicationSpec2ZoneName = "replicationSpec2_zoneName" rootName = "my-cluster" rootNameUpdated = "my-cluster-updated" - state = admin.ClusterDescription20240805{ - Id: &idGlobal, - Name: &rootName, - ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, + stateReplicationSpecs = []admin.ReplicationSpec20240805{ + { + Id: &idReplicationSpec1, + ZoneId: &replicationSpec1ZoneID, + ZoneName: &replicationSpec1ZoneNameOld, }, } + state = admin.ClusterDescription20240805{ + Id: &idGlobal, + Name: &rootName, + ReplicationSpecs: &stateReplicationSpecs, + } planOptionalUpdated = admin.ClusterDescription20240805{ Name: &rootName, ReplicationSpecs: &[]admin.ReplicationSpec20240805{ @@ -188,6 +189,16 @@ func TestPatchReplicationSpecs(t *testing.T) { plan: &planNoChanges, patchExpected: nil, }, + "Forced changes when forceUpdateAttr set": { + state: &state, + plan: &planNoChanges, + patchExpected: &admin.ClusterDescription20240805{ + ReplicationSpecs: &stateReplicationSpecs, + }, + options: []update.PatchOptions{ + {ForceUpdateAttr: []string{"replicationSpecs"}}, + }, + }, "Empty array should return no changes": { state: &admin.ClusterDescription20240805{ Labels: &[]admin.ComponentLabel{}, @@ -198,12 +209,23 @@ func TestPatchReplicationSpecs(t *testing.T) { patchExpected: nil, }, "diskSizeGb ignored in state": { - state: clusterDescriptionDiskSizeNodeCount(50.0, 3, conversion.Pointer(50.0), 0), - plan: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0), - patchExpected: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0), + state: clusterDescriptionDiskSizeNodeCount(50.0, 3, conversion.Pointer(50.0), 0, conversion.Pointer(3500)), + plan: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0, nil), + patchExpected: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0, conversion.Pointer(3500)), + options: []update.PatchOptions{ + { + IgnoreInStateSuffix: []string{"diskSizeGB"}, + }, + }, + }, + "regionConfigs ignored in state but diskIOPS included": { + state: clusterDescriptionDiskSizeNodeCount(50.0, 3, conversion.Pointer(50.0), 0, conversion.Pointer(3500)), + plan: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0, nil), + patchExpected: clusterDescriptionDiskSizeNodeCount(55.0, 3, nil, 0, conversion.Pointer(3500)), options: []update.PatchOptions{ { - IgnoreInState: []string{"diskSizeGB"}, + IgnoreInStatePrefix: []string{"regionConfigs"}, + IncludeInStateSuffix: []string{"diskIOPS"}, }, }, }, @@ -280,7 +302,7 @@ func TestIsEmpty(t *testing.T) { assert.False(t, update.IsZeroValues(&admin.ClusterDescription20240805{Name: conversion.Pointer("my-cluster")})) } -func clusterDescriptionDiskSizeNodeCount(diskSizeGBElectable float64, nodeCountElectable int, diskSizeGBReadOnly *float64, nodeCountReadOnly int) *admin.ClusterDescription20240805 { +func clusterDescriptionDiskSizeNodeCount(diskSizeGBElectable float64, nodeCountElectable int, diskSizeGBReadOnly *float64, nodeCountReadOnly int, diskIopsState *int) *admin.ClusterDescription20240805 { return &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { @@ -289,10 +311,12 @@ func clusterDescriptionDiskSizeNodeCount(diskSizeGBElectable float64, nodeCountE ElectableSpecs: &admin.HardwareSpec20240805{ NodeCount: &nodeCountElectable, DiskSizeGB: &diskSizeGBElectable, + DiskIOPS: diskIopsState, }, ReadOnlySpecs: &admin.DedicatedHardwareSpec20240805{ NodeCount: &nodeCountReadOnly, DiskSizeGB: diskSizeGBReadOnly, + DiskIOPS: diskIopsState, }, }, }, diff --git a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go index 5d34349677..1afd90eee2 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go @@ -27,25 +27,18 @@ func TestMigAdvancedCluster_replicaSetMultiCloud(t *testing.T) { } func TestMigAdvancedCluster_singleShardedMultiCloud(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) // AttributeName("advanced_configuration"): invalid JSON, expected "{", got "[" testCase := singleShardedMultiCloudTestCase(t, false) mig.CreateAndRunTest(t, &testCase) } func TestMigAdvancedCluster_symmetricGeoShardedOldSchema(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) // AttributeName("advanced_configuration"): invalid JSON, expected "{", got "[" testCase := symmetricGeoShardedOldSchemaTestCase(t, false) mig.CreateAndRunTest(t, &testCase) } func TestMigAdvancedCluster_asymmetricShardedNewSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error, note that TestAccClusterAdvancedClusterConfig_asymmetricShardedNewSchema is passing though: - // resource_advanced_cluster_migration_test.go:39: Step 1/2 error: Check failed: Check 2/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.disk_iops' not found - // Check 5/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.instance_size' not found - // Check 6/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.1.region_configs.0.electable_specs.instance_size' not found - // Check 7/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.1.region_configs.0.electable_specs.disk_size_gb' not found - // Check 8/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.analytics_specs.disk_size_gb' not found - // Check 9/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.1.region_configs.0.analytics_specs.disk_size_gb' not found - // Check 10/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.disk_size_gb' not found - // Check 11/15 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.1.region_configs.0.electable_specs.disk_iops' not found acc.SkipIfAdvancedClusterV2Schema(t) mig.SkipIfVersionBelow(t, "1.23.0") // version where sharded cluster tier auto-scaling was introduced testCase := asymmetricShardedNewSchemaTestCase(t, false) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 5b61541d39..5b38fbc935 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -20,7 +20,6 @@ import ( "github.com/stretchr/testify/mock" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" ) @@ -181,11 +180,6 @@ func TestAccClusterAdvancedCluster_singleShardedMultiCloud(t *testing.T) { func singleShardedMultiCloudTestCase(t *testing.T, isAcc bool) resource.TestCase { t.Helper() - // TODO: Already prepared for TPF but getting this error: - // resource_advanced_cluster_test.go:119: Step 1/3 error: Check failed: Check 9/12 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.0.disk_iops' expected to be set - // Check 10/12 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.analytics_specs.0.disk_iops' expected to be set - // Check 11/12 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.1.electable_specs.0.disk_iops' expected to be set - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -274,9 +268,7 @@ func TestAccClusterAdvancedCluster_pausedToUnpaused(t *testing.T) { } func TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // unexpected new value: .advanced_configuration.fail_index_key_too_long: was cty.False, but now null - acc.SkipIfAdvancedClusterV2Schema(t) + acc.SkipIfAdvancedClusterV2Schema(t) // TODO: default_max_time_ms not implemented in TPF yet var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -317,7 +309,7 @@ func TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion(t *testing.T } func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) { - acc.SkipIfAdvancedClusterV2Schema(t) + acc.SkipIfAdvancedClusterV2Schema(t) // TODO: default_max_time_ms not implemented in TPF yet var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -374,9 +366,6 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) { } func TestAccClusterAdvancedCluster_defaultWrite(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // Check failed: Check 8/14 error: mongodbatlas_advanced_cluster.test: Attribute 'advanced_configuration.fail_index_key_too_long' not found - acc.SkipIfAdvancedClusterV2Schema(t) var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -422,9 +411,6 @@ func TestAccClusterAdvancedCluster_defaultWrite(t *testing.T) { } func TestAccClusterAdvancedClusterConfig_replicationSpecsAutoScaling(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "INVALID_ENUM_VALUE") Detail: An invalid enumeration value was specified. Reason: Bad Request. Params: [], - acc.SkipIfAdvancedClusterV2Schema(t) var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -468,9 +454,6 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAutoScaling(t *testing. } func TestAccClusterAdvancedClusterConfig_replicationSpecsAnalyticsAutoScaling(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "INVALID_ENUM_VALUE") Detail: An invalid enumeration value was specified. Reason: Bad Request. Params: [], - acc.SkipIfAdvancedClusterV2Schema(t) var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -513,9 +496,6 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAnalyticsAutoScaling(t } func TestAccClusterAdvancedClusterConfig_singleShardedTransitionToOldSchemaExpectsError(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "ASYMMETRIC_REGION_TOPOLOGY_IN_ZONE"). Detail: All shards in the same zone must have the same region topology. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -596,9 +576,6 @@ func TestAccClusterAdvancedCluster_withLabels(t *testing.T) { } func TestAccClusterAdvancedClusterConfig_selfManagedSharding(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "ASYMMETRIC_REGION_TOPOLOGY_IN_ZONE"). Detail: All shards in the same zone must have the same region topology. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -648,12 +625,6 @@ func TestAccClusterAdvancedClusterConfig_selfManagedShardingIncorrectType(t *tes } func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // resource_advanced_cluster_test.go:545: Step 1/2 error: Check failed: Check 3/13 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.num_shards' expected "2", got "1" - // Check 9/13 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.electable_specs.0.disk_iops' expected to be set - // Check 10/13 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.0.analytics_specs.0.disk_iops' expected to be set - // Check 11/13 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.region_configs.1.electable_specs.0.disk_iops' expected to be set - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -683,9 +654,6 @@ func TestAccClusterAdvancedClusterConfig_symmetricGeoShardedOldSchema(t *testing func symmetricGeoShardedOldSchemaTestCase(t *testing.T, isAcc bool) resource.TestCase { t.Helper() - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "INVALID_ENUM_VALUE") Detail: An invalid enumeration value was specified. Reason: Bad Request. Params: [], - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -714,9 +682,6 @@ func symmetricGeoShardedOldSchemaTestCase(t *testing.T, isAcc bool) resource.Tes } func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // Check failed: Check 2/5 error: mongodbatlas_advanced_cluster.test: Attribute 'replication_specs.0.num_shards' expected \"2\", got \"1\" - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() @@ -741,9 +706,6 @@ func TestAccClusterAdvancedClusterConfig_symmetricShardedOldSchemaDiskSizeGBAtEl } func TestAccClusterAdvancedClusterConfig_symmetricShardedNewSchemaToAsymmetricAddingRemovingShard(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // PATCH: HTTP 400 Bad Request (Error code: \"AUTO_SCALINGS_MUST_BE_IN_EVERY_REGION_CONFIG\") Detail: If any regionConfigs specify an autoScaling object, all regionConfigs must also specify an autoScaling object. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() @@ -800,15 +762,12 @@ func asymmetricShardedNewSchemaTestCase(t *testing.T, isAcc bool) resource.TestC } func TestAccClusterAdvancedClusterConfig_asymmetricGeoShardedNewSchemaAddingRemovingShard(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "ASYMMETRIC_REGION_TOPOLOGY_IN_ZONE"). Detail: All shards in the same zone must have the same region topology. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() clusterName = acc.RandomClusterName() ) - + acc.SkipIfAdvancedClusterV2Schema(t) // TODO: add support for matching state replication_specs with updated/removed replication_specs in config resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, @@ -831,9 +790,6 @@ func TestAccClusterAdvancedClusterConfig_asymmetricGeoShardedNewSchemaAddingRemo } func TestAccClusterAdvancedClusterConfig_shardedTransitionFromOldToNewSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // PATCH: HTTP 400 Bad Request (Error code: "AUTO_SCALINGS_MUST_BE_IN_EVERY_REGION_CONFIG") Detail: If any regionConfigs specify an autoScaling object, all regionConfigs must also specify an autoScaling object. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() @@ -860,9 +816,6 @@ func TestAccClusterAdvancedClusterConfig_shardedTransitionFromOldToNewSchema(t * } func TestAccClusterAdvancedClusterConfig_geoShardedTransitionFromOldToNewSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // POST: HTTP 400 Bad Request (Error code: "ASYMMETRIC_REGION_TOPOLOGY_IN_ZONE"). Detail: All shards in the same zone must have the same region topology. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() @@ -948,14 +901,6 @@ func TestAccAdvancedCluster_replicaSetScalingStrategyAndRedactClientLogDataOldSc // TestAccClusterAdvancedCluster_priorityOldSchema will be able to be simplied or deleted in CLOUDP-275825 func TestAccClusterAdvancedCluster_priorityOldSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // .replication_specs[0].region_configs[0].electable_specs.node_count: was cty.NumberIntVal(1), but now cty.NumberIntVal(2) - // .replication_specs[0].region_configs[0].priority: was cty.NumberIntVal(6), but now cty.NumberIntVal(7). - // .replication_specs[0].region_configs[0].region_name: was cty.StringVal("US_WEST_2"), but now cty.StringVal("US_EAST_1"). - // .replication_specs[0].region_configs[1].electable_specs.node_count: was cty.NumberIntVal(2), but now cty.NumberIntVal(1). - // .replication_specs[0].region_configs[1].priority: was cty.NumberIntVal(7), but now cty.NumberIntVal(6). - // .replication_specs[0].region_configs[1].region_name: was cty.StringVal("US_EAST_1"), but now cty.StringVal("US_WEST_2"). - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -979,15 +924,17 @@ func TestAccClusterAdvancedCluster_priorityOldSchema(t *testing.T) { Config: configPriority(t, true, orgID, projectName, clusterName, true, true), ExpectError: regexp.MustCompile("priority values in region_configs must be in descending order"), }, + // Extra step added to allow deletion, otherwise we get `Error running post-test destroy` since validation of TF fails + { + Config: configPriority(t, true, orgID, projectName, clusterName, true, false), + Check: acc.TestCheckResourceAttrSchemaV2(true, resourceName, "replication_specs.0.region_configs.#", "2"), + }, }, }) } // TestAccClusterAdvancedCluster_priorityNewSchema will be able to be simplied or deleted in CLOUDP-275825 func TestAccClusterAdvancedCluster_priorityNewSchema(t *testing.T) { - // TODO: Already prepared for TPF but getting this error: - // Error: errorUpdateLegacy. PATCH: HTTP 400 Bad Request (Error code: "AUTO_SCALINGS_MUST_BE_IN_EVERY_REGION_CONFIG") Detail: If any regionConfigs specify an autoScaling object, all regionConfigs must also specify an autoScaling object. - acc.SkipIfAdvancedClusterV2Schema(t) var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // No ProjectIDExecution to avoid cross-region limits because multi-region @@ -1011,6 +958,11 @@ func TestAccClusterAdvancedCluster_priorityNewSchema(t *testing.T) { Config: configPriority(t, true, orgID, projectName, clusterName, false, true), ExpectError: regexp.MustCompile("priority values in region_configs must be in descending order"), }, + // Extra step added to allow deletion, otherwise we get `Error running post-test destroy` since validation of TF fails + { + Config: configPriority(t, true, orgID, projectName, clusterName, false, false), + Check: acc.TestCheckResourceAttrSchemaV2(true, resourceName, "replication_specs.0.region_configs.#", "2"), + }, }, }) } @@ -1038,7 +990,7 @@ func TestAccClusterAdvancedCluster_biConnectorConfig(t *testing.T) { } func TestAccClusterAdvancedCluster_pinnedFCVWithVersionUpgradeAndDowngrade(t *testing.T) { - acc.SkipIfAdvancedClusterV2Schema(t) + acc.SkipIfAdvancedClusterV2Schema(t) // TODO: pinned_fcv not implemented in TPF yet var ( orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") projectName = acc.RandomProjectName() // Using single project to assert plural data source @@ -2139,24 +2091,19 @@ func checkShardedNewSchema(isAcc bool, diskSizeGB int, firstInstanceSize, lastIn []string{"results.#", "results.0.replication_specs.#", "results.0.replication_specs.0.region_configs.#", "results.0.name", "results.0.termination_protection_enabled", "results.0.global_cluster_self_managed_sharding"}...) pluralChecks = acc.AddAttrChecksPrefixSchemaV2(isAcc, dataSourcePluralName, pluralChecks, clusterChecks, "results.0") - - if !config.AdvancedClusterV2Schema() { // TODDO: id is not filled yet in - // expected id attribute only if cluster is symmetric - if isAsymmetricCluster { - pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{}, map[string]string{ - "replication_specs.0.id": "", - "replication_specs.1.id": "", - })) - pluralChecks = acc.AddAttrChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, map[string]string{ - "results.0.replication_specs.0.id": "", - "results.0.replication_specs.1.id": "", - }) - } else { - pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{"replication_specs.0.id", "replication_specs.1.id"}, map[string]string{})) - pluralChecks = acc.AddAttrSetChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, "results.0.replication_specs.0.id", "results.0.replication_specs.1.id") - } + if isAsymmetricCluster { + pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{}, map[string]string{ + "replication_specs.0.id": "", + "replication_specs.1.id": "", + })) + pluralChecks = acc.AddAttrChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, map[string]string{ + "results.0.replication_specs.0.id": "", + "results.0.replication_specs.1.id": "", + }) + } else { + pluralChecks = append(pluralChecks, checkAggr(isAcc, []string{"replication_specs.0.id", "replication_specs.1.id"}, map[string]string{})) + pluralChecks = acc.AddAttrSetChecksSchemaV2(isAcc, dataSourcePluralName, pluralChecks, "results.0.replication_specs.0.id", "results.0.replication_specs.1.id") } - return checkAggr(isAcc, []string{"replication_specs.0.external_id", "replication_specs.0.zone_id", "replication_specs.1.external_id", "replication_specs.1.zone_id"}, clusterChecks, diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index f77a7dfbc5..26a6faa65b 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -145,7 +145,7 @@ func convertReplicationSpecs(ctx context.Context, input *[]admin.ReplicationSpec } legacyID := apiInfo.ZoneNameReplicationSpecIDs[zoneName] tfModels[i] = TFReplicationSpecsModel{ - Id: conversion.StringNullIfEmpty(legacyID), + Id: types.StringValue(legacyID), ExternalId: types.StringValue(conversion.SafeValue(item.Id)), NumShards: types.Int64Value(1), ContainerId: conversion.ToTFMapOfString(ctx, diags, &apiInfo.ContainerIDs), diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index 95a08ee52a..7c37051c6b 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -201,7 +201,7 @@ func newDedicatedHardwareSpec20240805(ctx context.Context, input types.Object, d return &admin.DedicatedHardwareSpec20240805{ DiskIOPS: conversion.NilForUnknown(item.DiskIops, conversion.Int64PtrToIntPtr(item.DiskIops.ValueInt64Pointer())), DiskSizeGB: conversion.NilForUnknown(item.DiskSizeGb, item.DiskSizeGb.ValueFloat64Pointer()), - EbsVolumeType: conversion.NilForUnknown(item.EbsVolumeType, item.EbsVolumeType.ValueStringPointer()), + EbsVolumeType: conversion.NilForUnknownOrEmptyString(item.EbsVolumeType), InstanceSize: conversion.NilForUnknownOrEmptyString(item.InstanceSize), NodeCount: conversion.NilForUnknown(item.NodeCount, conversion.Int64PtrToIntPtr(item.NodeCount.ValueInt64Pointer())), } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 1ed3e8d9bf..5168408298 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -102,13 +102,28 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou if diags.HasError() { return } - stateReq := normalizeFromTFModel(ctx, &state, diags, false) - planReq := normalizeFromTFModel(ctx, &plan, diags, false) + stateUsingLegacy := usingLegacySchema(ctx, state.ReplicationSpecs, diags) + planUsingLegacy := usingLegacySchema(ctx, plan.ReplicationSpecs, diags) + if planUsingLegacy && !stateUsingLegacy { + diags.AddError("error operation not permitted, nums_shards from 1 -> > 1", fmt.Sprintf("cannot increase num_shards to > 1 under the current configuration. New shards can be defined by adding new replication spec objects; %s", DeprecationOldSchemaAction)) + return + } + isSchemaUpgrade := stateUsingLegacy && !planUsingLegacy + stateReq := normalizeFromTFModel(ctx, &state, diags, isSchemaUpgrade) + planReq := normalizeFromTFModel(ctx, &plan, diags, isSchemaUpgrade) if diags.HasError() { return } - normalizePatchState(stateReq) - patchReq, err := update.PatchPayload(stateReq, planReq) + patchOptions := update.PatchOptions{ + IgnoreInStatePrefix: []string{"regionConfigs"}, + IncludeInStateSuffix: []string{"diskIOPS"}, + } + if isSchemaUpgrade || findNumShardsUpdates(ctx, &state, &plan, diags) != nil { + // isSchemaUpgrade will have no changes by default after flattening; therefore, force update the replicationSpecs + // `num_shards` updates is only in the legacy ClusterDescription; therefore, force update the replicationSpecs + patchOptions.ForceUpdateAttr = append(patchOptions.ForceUpdateAttr, "replicationSpecs") + } + patchReq, err := update.PatchPayload(stateReq, planReq, patchOptions) if err != nil { diags.AddError("errorPatchPayload", err.Error()) return @@ -119,6 +134,14 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou if upgradeRequest != nil { clusterResp = r.applyTenantUpgrade(ctx, &plan, upgradeRequest, diags) } else { + if isSchemaUpgrade { + specs, localDiags := populateIDValuesUsingNewAPI(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), r.Client.AtlasV2.ClustersApi, patchReq.ReplicationSpecs) + conversion.AddLegacyDiags(diags, localDiags) + if diags.HasError() { + return + } + patchReq.ReplicationSpecs = specs + } clusterResp = r.applyClusterChanges(ctx, diags, &state, &plan, patchReq) } if diags.HasError() { diff --git a/internal/service/advancedclustertpf/resource_compatibility_reuse.go b/internal/service/advancedclustertpf/resource_compatibility_reuse.go index 2ad6877b2f..41cc60c862 100644 --- a/internal/service/advancedclustertpf/resource_compatibility_reuse.go +++ b/internal/service/advancedclustertpf/resource_compatibility_reuse.go @@ -6,8 +6,10 @@ import ( "strconv" "strings" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" "github.com/spf13/cast" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" @@ -168,3 +170,27 @@ func convertDedicatedHardwareSpecToOldSDK(spec *admin.DedicatedHardwareSpec20240 InstanceSize: spec.InstanceSize, } } + +// copied from advancedcluster/resource_update_logic.go +func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName string, connV2ClusterAPI admin.ClustersApi, replicationSpecs *[]admin.ReplicationSpec20240805) (*[]admin.ReplicationSpec20240805, diag.Diagnostics) { + if replicationSpecs == nil || len(*replicationSpecs) == 0 { + return replicationSpecs, nil + } + cluster, _, err := connV2ClusterAPI.GetCluster(ctx, projectID, clusterName).Execute() + if err != nil { + return nil, diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + } + + zoneToReplicationSpecsIDs := groupIDsByZone(cluster.GetReplicationSpecs()) + result := advancedcluster.AddIDsToReplicationSpecs(*replicationSpecs, zoneToReplicationSpecsIDs) + return &result, nil +} + +// copied from advancedcluster/resource_update_logic.go +func groupIDsByZone(specs []admin.ReplicationSpec20240805) map[string][]string { + result := make(map[string][]string) + for _, spec := range specs { + result[spec.GetZoneName()] = append(result[spec.GetZoneName()], spec.GetId()) + } + return result +} diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index a0cd777939..1f7a5bd37a 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -119,25 +119,6 @@ func normalizeDiskSize(model *TFModel, latestModel *admin.ClusterDescription2024 return rootDiskSize } -// Set "Computed" Specs to nil to avoid unnecessary diffs -func normalizePatchState(cluster *admin.ClusterDescription20240805) { - for i, specCopy := range cluster.GetReplicationSpecs() { - for j := range specCopy.GetRegionConfigs() { - spec := cluster.GetReplicationSpecs()[i] - regionConfigs := *spec.RegionConfigs - actualConfig := ®ionConfigs[j] - analyticsSpecs := actualConfig.AnalyticsSpecs - if analyticsSpecs != nil && analyticsSpecs.NodeCount != nil && *analyticsSpecs.NodeCount == 0 { - actualConfig.AnalyticsSpecs = nil - } - readonly := actualConfig.ReadOnlySpecs - if readonly != nil && readonly.NodeCount != nil && *readonly.NodeCount == 0 { - actualConfig.ReadOnlySpecs = nil - } - } - } -} - func explodeNumShards(req *admin.ClusterDescription20240805, counts []int64) { specs := req.GetReplicationSpecs() newSpecs := []admin.ReplicationSpec20240805{} diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml index 5c64075080..73e4eacd06 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml @@ -167,7 +167,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2024-08-05' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"diskSizeGB\": 40,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 30 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json index b4bf9590df..f9b21a52d7 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json @@ -11,17 +11,13 @@ "nodeCount": 1 }, "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, + "compute": {}, "diskGB": { "enabled": true } }, "electableSpecs": { "diskIOPS": 2000, - "diskSizeGB": 40, "ebsVolumeType": "PROVISIONED", "instanceSize": "M30", "nodeCount": 3 @@ -45,17 +41,13 @@ "nodeCount": 1 }, "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, + "compute": {}, "diskGB": { "enabled": true } }, "electableSpecs": { "diskIOPS": 1000, - "diskSizeGB": 40, "ebsVolumeType": "PROVISIONED", "instanceSize": "M30", "nodeCount": 3 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml index 589d709dde..2d4553d523 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml @@ -157,7 +157,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2023-02-01' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 67 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index 259fa0594d..02fb47bc39 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -7,22 +7,11 @@ { "analyticsSpecs": { "diskIOPS": 3000, - "ebsVolumeType": "STANDARD", "instanceSize": "M20", "nodeCount": 1 }, - "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, - "diskGB": { - "enabled": false - } - }, "electableSpecs": { "diskIOPS": 3000, - "ebsVolumeType": "STANDARD", "instanceSize": "M10", "nodeCount": 3 }, @@ -31,15 +20,6 @@ "regionName": "EU_WEST_1" }, { - "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, - "diskGB": { - "enabled": false - } - }, "electableSpecs": { "diskIOPS": 3500, "instanceSize": "M10", diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml index 23f1c5a4de..61534ce08e 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml @@ -149,7 +149,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2023-02-01' - text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": false,\n \"scaleDownEnabled\": false\n },\n \"diskGB\": {\n \"enabled\": false\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 61 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index c748fd2f07..7fba993da8 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -7,21 +7,12 @@ "regionConfigs": [ { "analyticsSpecs": { + "diskIOPS": 3000, "instanceSize": "M10", "nodeCount": 0 }, - "autoScaling": { - "compute": { - "enabled": false, - "scaleDownEnabled": false - }, - "diskGB": { - "enabled": false - } - }, "electableSpecs": { "diskIOPS": 3000, - "ebsVolumeType": "STANDARD", "instanceSize": "M10", "nodeCount": 3 }, diff --git a/internal/testutil/unit/http_mocker.go b/internal/testutil/unit/http_mocker.go index 77090ac102..ac969d4e5f 100644 --- a/internal/testutil/unit/http_mocker.go +++ b/internal/testutil/unit/http_mocker.go @@ -4,8 +4,7 @@ import ( "net/http" "os" "path" - "slices" - "strings" + "strconv" "sync" "testing" @@ -17,9 +16,10 @@ import ( ) const ( - EnvNameHTTPMockerCapture = "HTTP_MOCKER_CAPTURE" - EnvNameHTTPMockerReplay = "HTTP_MOCKER_REPLAY" - configFileExtension = ".yaml" + EnvNameHTTPMockerCapture = "HTTP_MOCKER_CAPTURE" + EnvNameHTTPMockerReplay = "HTTP_MOCKER_REPLAY" + EnvNameHTTPMockerDataUpdate = "HTTP_MOCKER_DATA_UPDATE" + configFileExtension = ".yaml" ) type MockHTTPDataConfig struct { @@ -28,14 +28,27 @@ type MockHTTPDataConfig struct { IsDiffMustSubstrings []string QueryVars []string AllowMissingRequests bool + AllowOutOfOrder bool +} + +func (c MockHTTPDataConfig) WithAllowOutOfOrder() MockHTTPDataConfig { //nolint: gocritic // Want each test run to have its own config (hugeParam: c is heavy (112 bytes); consider passing it by pointer) + c.AllowOutOfOrder = true + return c } func IsCapture() bool { - return slices.Contains([]string{"yes", "1", "true"}, strings.ToLower(os.Getenv(EnvNameHTTPMockerCapture))) + val, _ := strconv.ParseBool(os.Getenv(EnvNameHTTPMockerCapture)) + return val } func IsReplay() bool { - return slices.Contains([]string{"yes", "1", "true"}, strings.ToLower(os.Getenv(EnvNameHTTPMockerReplay))) + val, _ := strconv.ParseBool(os.Getenv(EnvNameHTTPMockerReplay)) + return val +} + +func IsDataUpdate() bool { + val, _ := strconv.ParseBool(os.Getenv(EnvNameHTTPMockerDataUpdate)) + return val } func CaptureOrMockTestCaseAndRun(t *testing.T, config MockHTTPDataConfig, testCase *resource.TestCase) { //nolint: gocritic // Want each test run to have its own config (hugeParam: config is heavy (112 bytes); consider passing it by pointer) @@ -126,7 +139,8 @@ func ReadMockData(t *testing.T, tfConfigs []string) *MockHTTPData { newVariables := data.Variables for key, value := range oldVariables { if _, ok := newVariables[key]; !ok { - t.Logf("Variable %s=%s not found from TF Config, probably discovered in request path", key, value) + t.Logf("Variable %s not found from TF Config, will use variable from the mock data with value %s", key, value) + data.Variables[key] = value } } for key, value := range newVariables { @@ -137,6 +151,18 @@ func ReadMockData(t *testing.T, tfConfigs []string) *MockHTTPData { return data } +func UpdateMockDataDiffRequest(t *testing.T, stepIndex, diffRequestIndex int, newText string) { + t.Helper() + httpDataPath := MockConfigFilePath(t) + data, err := ParseTestDataConfigYAML(httpDataPath) + require.NoError(t, err) + data.Steps[stepIndex].DiffRequests[diffRequestIndex].Text = newText + configYaml, err := ConfigYaml(data) + require.NoError(t, err) + err = WriteConfigYaml(httpDataPath, configYaml) + require.NoError(t, err) +} + func enableCaptureForTestCase(t *testing.T, config *MockHTTPDataConfig, testCase *resource.TestCase) error { t.Helper() stepCount := len(testCase.Steps) diff --git a/internal/testutil/unit/http_mocker_config_capture.go b/internal/testutil/unit/http_mocker_config_capture.go index 3a35ae5da4..dd8f292490 100644 --- a/internal/testutil/unit/http_mocker_config_capture.go +++ b/internal/testutil/unit/http_mocker_config_capture.go @@ -117,10 +117,15 @@ func (c *CaptureMockConfigClientModifier) NormalizeCapturedData() { } func (c *CaptureMockConfigClientModifier) ConfigYaml() (string, error) { + capturedData := c.capturedData + return ConfigYaml(capturedData) +} + +func ConfigYaml(capturedData *MockHTTPData) (string, error) { initialYaml := strings.Builder{} e := yaml.NewEncoder(&initialYaml) e.SetIndent(1) - err := e.Encode(c.capturedData) + err := e.Encode(capturedData) return initialYaml.String(), err } @@ -129,6 +134,10 @@ func (c *CaptureMockConfigClientModifier) WriteCapturedData(filePath string) err if err != nil { return err } + return WriteConfigYaml(filePath, configYaml) +} + +func WriteConfigYaml(filePath, configYaml string) error { dirPath := path.Dir(filePath) if !fileExist(dirPath) { err := os.Mkdir(dirPath, 0o755) @@ -137,7 +146,7 @@ func (c *CaptureMockConfigClientModifier) WriteCapturedData(filePath string) err } } // will override content if file exists - err = os.WriteFile(filePath, []byte(configYaml), 0o600) + err := os.WriteFile(filePath, []byte(configYaml), 0o600) if err != nil { return err } diff --git a/internal/testutil/unit/http_mocker_round_tripper.go b/internal/testutil/unit/http_mocker_round_tripper.go index c33b09671a..3249dec255 100644 --- a/internal/testutil/unit/http_mocker_round_tripper.go +++ b/internal/testutil/unit/http_mocker_round_tripper.go @@ -24,6 +24,7 @@ func NewMockRoundTripper(t *testing.T, config *MockHTTPDataConfig, data *MockHTT tracker := newMockRoundTripper(t, data) if config != nil { tracker.allowMissingRequests = config.AllowMissingRequests + tracker.allowOutOfOrder = config.AllowOutOfOrder } for _, method := range []string{"GET", "POST", "PUT", "DELETE", "PATCH"} { myTransport.RegisterRegexpResponder(method, regexp.MustCompile(".*"), tracker.receiveRequest(method)) @@ -64,7 +65,9 @@ type MockRoundTripper struct { currentStepIndex int diffResponseIndex int allowMissingRequests bool + allowOutOfOrder bool logRequests bool + reReadCounter int } func (r *MockRoundTripper) IncreaseStepNumberAndInit() { @@ -73,6 +76,14 @@ func (r *MockRoundTripper) IncreaseStepNumberAndInit() { require.NoError(r.t, err) } +func (r *MockRoundTripper) canReturnResponse(responseIndex int) bool { + isAfter := responseIndex > r.diffResponseIndex + if r.allowOutOfOrder && isAfter { + r.t.Logf("allowwingOutOfOrder: response_index=%d is after nextDiffResponse=%d", responseIndex, r.diffResponseIndex) + } + return r.allowOutOfOrder || !isAfter +} + func (r *MockRoundTripper) allowReUse(req *RequestInfo) bool { isGet := req.Method == "GET" customReReadOk := req.Method == "POST" && strings.HasSuffix(req.Path, ":validate") @@ -95,6 +106,7 @@ func (r *MockRoundTripper) manualFilenameIfExist(requestID string, index int) st func (r *MockRoundTripper) initStep() error { r.usedResponses = map[string]int{} r.foundsDiffs = map[int]string{} + r.reReadCounter = 0 step := r.currentStep() if step == nil { return nil @@ -166,6 +178,10 @@ func (r *MockRoundTripper) CheckStepRequests(_ *terraform.State) error { r.t.Logf("checking diff %s", filename) payloadWithVars := useVars(r.data.Variables, payload) r.g.Assert(r.t, filename, []byte(payloadWithVars)) + if IsDataUpdate() { + r.t.Logf("updating diff %s", filename) + UpdateMockDataDiffRequest(r.t, r.currentStepIndex, index, payloadWithVars) + } } return nil } @@ -230,10 +246,14 @@ func (r *MockRoundTripper) matchRequest(method, version, payload string, reqURL } } response := request.Responses[nextIndex] - // cannot return a response that is sent after a diff response, unless it is a diff - if response.ResponseIndex > nextDiffResponse && !isDiff { + // cannot return a response that is sent after a diff response, unless it is a diff or we ignore order with allowOutOfOrder + if !isDiff && !r.canReturnResponse(response.ResponseIndex) { prevIndex := nextIndex - 1 if prevIndex >= 0 && r.allowReUse(&request) { + r.reReadCounter++ + if r.reReadCounter > 20 { + return "", 0, fmt.Errorf("stuck in a loop trying to re-read the same request: %s %s %s", method, version, reqURL.Path) + } response = request.Responses[prevIndex] r.t.Logf("re-reading %s request with response_index=%d as diff hasn't been returned yet (%d)", request.Method, response.ResponseIndex, nextDiffResponse) return replaceVars(response.Text, r.data.Variables), response.Status, nil diff --git a/internal/testutil/unit/http_mocker_round_tripper_test.go b/internal/testutil/unit/http_mocker_round_tripper_test.go index cf2aae8b3c..81b2f47240 100644 --- a/internal/testutil/unit/http_mocker_round_tripper_test.go +++ b/internal/testutil/unit/http_mocker_round_tripper_test.go @@ -36,6 +36,7 @@ func TestMockRoundTripper(t *testing.T) { orgID := "123" resourcePolicyID := "456" data := unit.ReadMockData(t, []string{"", "", ""}) + data.Variables = map[string]string{} mockTransport, tracker := unit.NewMockRoundTripper(t, &unit.MockHTTPDataConfig{AllowMissingRequests: true}, data) client := &http.Client{ Transport: mockTransport, @@ -107,6 +108,7 @@ func parseMapStringAny(t *testing.T, resp *http.Response) map[string]any { func TestMockRoundTripperAllowReRead(t *testing.T) { orgID := "123" data := unit.ReadMockData(t, []string{""}) + data.Variables = map[string]string{} mockTransport, tracker := unit.NewMockRoundTripper(t, &unit.MockHTTPDataConfig{AllowMissingRequests: true}, data) client := &http.Client{ Transport: mockTransport, From b1ad17cad83d937249fdecf37700bf49b14f39df Mon Sep 17 00:00:00 2001 From: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:48:01 -0500 Subject: [PATCH 14/40] build(deps): bump go.mongodb.org/atlas-sdk (#2902) Co-authored-by: wtrocki <981838+wtrocki@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 30946abf26..0ece398645 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,9 @@ require ( github.com/hashicorp/go-changelog v0.0.0-20240318095659-4d68c58a6e7f github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-version v1.7.0 + github.com/hashicorp/hc-install v0.9.0 github.com/hashicorp/hcl/v2 v2.23.0 + github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 @@ -22,7 +24,7 @@ require ( github.com/huandu/xstrings v1.5.0 github.com/jarcoal/httpmock v1.3.1 github.com/mongodb-forks/digest v1.1.0 - github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f + github.com/mongodb/atlas-sdk-go v1.0.1-0.20241216083848-a48e58d34867 github.com/pb33f/libopenapi v0.18.7 github.com/sebdah/goldie/v2 v2.5.5 github.com/spf13/cast v1.6.0 @@ -88,10 +90,8 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/hashicorp/hc-install v0.9.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-exec v0.21.0 // indirect github.com/hashicorp/terraform-json v0.23.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect diff --git a/go.sum b/go.sum index 44f106e1f4..b7fa2d6074 100644 --- a/go.sum +++ b/go.sum @@ -655,8 +655,8 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKksrOoc= github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg= -github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f h1:hgZvdTynTl1ep9xWH+1K697K1wsjp6jgqYgMoz3ynxc= -github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f/go.mod h1:WzU2E+/RcJGnhjdnBzXpbGBqq/XbDhFDEaru0UNmbxc= +github.com/mongodb/atlas-sdk-go v1.0.1-0.20241216083848-a48e58d34867 h1:155Szon4Y00373X0kTWMMWM4ku6Tv5Ss0SWeF7RJKs8= +github.com/mongodb/atlas-sdk-go v1.0.1-0.20241216083848-a48e58d34867/go.mod h1:WzU2E+/RcJGnhjdnBzXpbGBqq/XbDhFDEaru0UNmbxc= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= From 60fcbad2de41bcc2c99c5bf2dc04675b03de7d88 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:18:35 +0100 Subject: [PATCH 15/40] read env var only once (#2899) --- internal/config/advanced_cluster_v2_schema.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/config/advanced_cluster_v2_schema.go b/internal/config/advanced_cluster_v2_schema.go index 76e65bfb26..1ad089f0db 100644 --- a/internal/config/advanced_cluster_v2_schema.go +++ b/internal/config/advanced_cluster_v2_schema.go @@ -8,7 +8,9 @@ import ( const AdvancedClusterV2SchemaEnvVar = "MONGODB_ATLAS_ADVANCED_CLUSTER_V2_SCHEMA" const allowAdvancedClusterV2Schema = false // Don't allow in master branch yet, not in const block to allow automatic change +// Environment variable is read only once to avoid possible changes during runtime +var advancedClusterV2Schema, _ = strconv.ParseBool(os.Getenv(AdvancedClusterV2SchemaEnvVar)) + func AdvancedClusterV2Schema() bool { - env, _ := strconv.ParseBool(os.Getenv(AdvancedClusterV2SchemaEnvVar)) - return allowAdvancedClusterV2Schema && env + return allowAdvancedClusterV2Schema && advancedClusterV2Schema } From 15693607f8d0d505c643675cca2db4d535aba877 Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Tue, 17 Dec 2024 17:59:17 +0100 Subject: [PATCH 16/40] doc: Defines migration guide for 1.23.0 release (#2898) * define migration guide for 1.23.0 release * remove redudant new from changelog entries * use full url * docs review --- .changelog/2825.txt | 12 ++++++------ docs/guides/1.23.0-upgrade-guide.md | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 docs/guides/1.23.0-upgrade-guide.md diff --git a/.changelog/2825.txt b/.changelog/2825.txt index 42e2f3cdcd..b34e96a9e7 100644 --- a/.changelog/2825.txt +++ b/.changelog/2825.txt @@ -1,11 +1,11 @@ -```release-note:note -resource/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute +```release-note:enhancement +resource/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.default_max_time_ms` attribute ``` -```release-note:note -data-source/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute +```release-note:enhancement +data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.default_max_time_ms` attribute ``` -```release-note:note -data-source/mongodbatlas_advanced_clusters: Adds new `advanced_configuration.0.default_max_time_ms` attribute +```release-note:enhancement +data-source/mongodbatlas_advanced_clusters: Adds `advanced_configuration.0.default_max_time_ms` attribute ``` diff --git a/docs/guides/1.23.0-upgrade-guide.md b/docs/guides/1.23.0-upgrade-guide.md new file mode 100644 index 0000000000..5e07b6d290 --- /dev/null +++ b/docs/guides/1.23.0-upgrade-guide.md @@ -0,0 +1,24 @@ +--- +page_title: "Upgrade Guide 1.23.0" +--- + +# MongoDB Atlas Provider 1.23.0: Upgrade and Information Guide + +The Terraform MongoDB Atlas Provider version 1.23.0 has a number of new and exciting features. + +## New Resources, Data Sources, and Features + +- You can now leverage auto-scaling to scale the instance size of each individual shard independently for sharded and geo-sharded clusters defined with `mongodbatlas_advanced_cluster`. To learn more, see the [Advanced Cluster New Sharding Configurations - Use Auto-Scaling Per Shard](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema#use-auto-scaling-per-shard). + +- You can now pin a cluster's FCV before upgrading in Atlas, which enables you to revert MongoDB to the previous version after upgrading without experiencing version compatibility issues. This is supported in `mongodbatlas_advanced_cluster` and `mongodbatlas_cluster` using `pinned_fcv`. To learn more, see either [mongodbatlas_advanced_cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/advanced_cluster) or [mongodbatlas_cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster) resource documentation. + +- You can now configure the default time limit in milliseconds for individual read operations to complete in `mongodbatlas_advanced_cluster` using `advanced_configuration.0.default_max_time_ms`. To learn more, see [mongodbatlas_advanced_cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/advanced_cluster) resource documentation. + + +## Helpful Links + +* [Report bugs](https://github.com/mongodb/terraform-provider-mongodbatlas/issues) + +* [Request Features](https://feedback.mongodb.com/forums/924145-atlas?category_id=370723) + +* [Contact Support](https://docs.atlas.mongodb.com/support/) covered by MongoDB Atlas support plans, Developer and above. From 60d781766ea6c9fb020d9037a4f37274746b51e4 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Tue, 17 Dec 2024 17:01:03 +0000 Subject: [PATCH 17/40] chore: Updates CHANGELOG.md for #2898 --- CHANGELOG.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c61b2e70..6bdb292e46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,14 @@ ## (Unreleased) -NOTES: - -* data-source/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) -* data-source/mongodbatlas_advanced_clusters: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) -* resource/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) - ENHANCEMENTS: +* data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) * data-source/mongodbatlas_advanced_cluster: Adds `pinned_fcv` attribute ([#2789](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2789)) +* data-source/mongodbatlas_advanced_clusters: Adds `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) * data-source/mongodbatlas_advanced_clusters: Adds `pinned_fcv` attribute ([#2789](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2789)) * data-source/mongodbatlas_cluster: Adds `pinned_fcv` attribute ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) * data-source/mongodbatlas_clusters: Adds `pinned_fcv` attribute ([#2817](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2817)) +* resource/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) * resource/mongodbatlas_advanced_cluster: Adds `pinned_fcv` attribute ([#2789](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2789)) * resource/mongodbatlas_advanced_cluster: Adjusts create operation to support cluster tier auto scaling per shard. ([#2836](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2836)) * resource/mongodbatlas_advanced_cluster: Adjusts update operation to support cluster tier auto scaling per shard. ([#2814](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2814)) From f67ce7041156b37ca5d613dfa827375053590f76 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Tue, 17 Dec 2024 17:08:40 +0000 Subject: [PATCH 18/40] chore: Updates examples link in index.md for v1.23.0 release --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 156b21dfd9..286e590f72 100644 --- a/docs/index.md +++ b/docs/index.md @@ -221,7 +221,7 @@ We ship binaries but do not prioritize fixes for the following operating system ## Examples from MongoDB and the Community -We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.22.0/examples) +We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.23.0/examples) in our GitHub repo that will help both beginner and more advanced users. Have a good example you've created and want to share? From 9944e932588de7b78810ac1dc1fc29a6c0a02eb5 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Tue, 17 Dec 2024 17:09:22 +0000 Subject: [PATCH 19/40] chore: Updates CHANGELOG.md header for v1.23.0 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bdb292e46..7f4dc69dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (Unreleased) +## 1.23.0 (December 17, 2024) + ENHANCEMENTS: * data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825)) From dcc8d359d859cc996f45c7763309ed1ca59765ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 06:14:47 +0100 Subject: [PATCH 20/40] chore: Bump github.com/hashicorp/terraform-plugin-framework-validators (#2907) Bumps [github.com/hashicorp/terraform-plugin-framework-validators](https://github.com/hashicorp/terraform-plugin-framework-validators) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-framework-validators/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-framework-validators/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-framework-validators/compare/v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-framework-validators dependency-type: direct:production update-type: version-update:semver-minor ... 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 0ece398645..a4fb5792b2 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-plugin-framework v1.13.0 github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 - github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 + github.com/hashicorp/terraform-plugin-framework-validators v0.16.0 github.com/hashicorp/terraform-plugin-go v0.25.0 github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-mux v0.17.0 diff --git a/go.sum b/go.sum index b7fa2d6074..65738e004c 100644 --- a/go.sum +++ b/go.sum @@ -532,8 +532,8 @@ github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E= github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY= -github.com/hashicorp/terraform-plugin-framework-validators v0.15.0 h1:RXMmu7JgpFjnI1a5QjMCBb11usrW2OtAG+iOTIj5c9Y= -github.com/hashicorp/terraform-plugin-framework-validators v0.15.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY= +github.com/hashicorp/terraform-plugin-framework-validators v0.16.0 h1:O9QqGoYDzQT7lwTXUsZEtgabeWW96zUBh47Smn2lkFA= +github.com/hashicorp/terraform-plugin-framework-validators v0.16.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY= github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks= github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= From 9cdf77c00d8a00bcf5319df0875da2d1c3b507e9 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:18:09 +0100 Subject: [PATCH 21/40] refactor CopyModel to return only de model and panic if there is any structural issue (#2905) --- internal/common/conversion/model_generation.go | 13 +++++++------ .../common/conversion/model_generation_test.go | 18 ++++++++---------- .../service/advancedclustertpf/data_source.go | 6 +----- .../advancedclustertpf/plural_data_source.go | 6 +----- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/internal/common/conversion/model_generation.go b/internal/common/conversion/model_generation.go index 9f49d6af15..072c95eca6 100644 --- a/internal/common/conversion/model_generation.go +++ b/internal/common/conversion/model_generation.go @@ -6,17 +6,18 @@ import ( ) // CopyModel creates a new struct with the same values as the source struct. Fields in destination struct that are not in source are left with zero value. -func CopyModel[T any](src any) (*T, error) { +// It panics if there are some structural problems so it should only happen during development. +func CopyModel[T any](src any) *T { dest := new(T) valSrc := reflect.ValueOf(src) valDest := reflect.ValueOf(dest) if valSrc.Kind() != reflect.Ptr || valDest.Kind() != reflect.Ptr { - return nil, fmt.Errorf("params must be pointers") + panic("params must be pointers") } valSrc = valSrc.Elem() valDest = valDest.Elem() if valSrc.Kind() != reflect.Struct || valDest.Kind() != reflect.Struct { - return nil, fmt.Errorf("params must be pointers to structs") + panic("params must be pointers to structs") } typeSrc := valSrc.Type() typeDest := valDest.Type() @@ -29,13 +30,13 @@ func CopyModel[T any](src any) (*T, error) { continue } if fieldDest.Type != fieldSrc.Type { - return nil, fmt.Errorf("field has different type: %s", name) + panic(fmt.Sprintf("field has different type: %s", name)) } } if !valDest.Field(i).CanSet() { - return nil, fmt.Errorf("field can't be set, probably unexported: %s", name) + panic(fmt.Sprintf("field can't be set, probably unexported: %s", name)) } valDest.Field(i).Set(valSrc.FieldByName(name)) } - return dest, nil + return dest } diff --git a/internal/common/conversion/model_generation_test.go b/internal/common/conversion/model_generation_test.go index ea18d83d4e..0c175726af 100644 --- a/internal/common/conversion/model_generation_test.go +++ b/internal/common/conversion/model_generation_test.go @@ -5,7 +5,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestCopyModel(t *testing.T) { @@ -18,7 +17,7 @@ func TestCopyModel(t *testing.T) { testCases := map[string]struct { input any expected any - expectedErrorStr string + expectedPanicStr string }{ "basic": { input: &struct { @@ -65,7 +64,7 @@ func TestCopyModel(t *testing.T) { }{ AttrStr: true, }, - expectedErrorStr: "field has different type: AttrStr", + expectedPanicStr: "field has different type: AttrStr", }, "unexported": { input: &struct { @@ -73,19 +72,18 @@ func TestCopyModel(t *testing.T) { }{ attrUnexported: "val", }, - expectedErrorStr: "field can't be set, probably unexported: attrUnexported", + expectedPanicStr: "field can't be set, probably unexported: attrUnexported", }, } for name, tc := range testCases { t.Run(name, func(t *testing.T) { - dest, err := conversion.CopyModel[destType](tc.input) - if err == nil { - assert.Equal(t, tc.expected, dest) - assert.Equal(t, "", tc.expectedErrorStr) + if tc.expectedPanicStr == "" { + assert.Equal(t, tc.expected, conversion.CopyModel[destType](tc.input)) } else { - require.ErrorContains(t, err, tc.expectedErrorStr) - assert.Nil(t, dest) assert.Nil(t, tc.expected) + assert.PanicsWithValue(t, tc.expectedPanicStr, func() { + conversion.CopyModel[destType](tc.input) + }) } }) } diff --git a/internal/service/advancedclustertpf/data_source.go b/internal/service/advancedclustertpf/data_source.go index d3afe998ab..a8435633c4 100644 --- a/internal/service/advancedclustertpf/data_source.go +++ b/internal/service/advancedclustertpf/data_source.go @@ -72,11 +72,7 @@ func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS * if diags.HasError() { return nil } - modelOutDS, err := conversion.CopyModel[TFModelDS](modelOut) - if err != nil { - diags.AddError(errorRead, fmt.Sprintf("error setting model: %s", err.Error())) - return nil - } + modelOutDS := conversion.CopyModel[TFModelDS](modelOut) modelOutDS.UseReplicationSpecPerShard = modelDS.UseReplicationSpecPerShard // attrs not in resource model return modelOutDS } diff --git a/internal/service/advancedclustertpf/plural_data_source.go b/internal/service/advancedclustertpf/plural_data_source.go index f9c83bbcbe..95d8dbb8a2 100644 --- a/internal/service/advancedclustertpf/plural_data_source.go +++ b/internal/service/advancedclustertpf/plural_data_source.go @@ -84,11 +84,7 @@ func (d *pluralDS) readClusters(ctx context.Context, diags *diag.Diagnostics, pl if diags.HasError() { return nil } - modelOutDS, err := conversion.CopyModel[TFModelDS](modelOut) - if err != nil { - diags.AddError(errorList, fmt.Sprintf("error setting model: %s", err.Error())) - return nil - } + modelOutDS := conversion.CopyModel[TFModelDS](modelOut) modelOutDS.UseReplicationSpecPerShard = pluralModel.UseReplicationSpecPerShard // attrs not in resource model outs.Results = append(outs.Results, modelOutDS) } From 06140c966f142b31d22f8b81c232368075998100 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:20:55 +0100 Subject: [PATCH 22/40] ForceLegacySchemaFailed (#2908) --- internal/service/advancedclustertpf/data_source.go | 2 +- .../model_ClusterDescription20240805.go | 2 +- .../advancedclustertpf/plural_data_source.go | 2 +- internal/service/advancedclustertpf/resource.go | 10 +++++----- .../advancedclustertpf/resource_compatiblity.go | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/advancedclustertpf/data_source.go b/internal/service/advancedclustertpf/data_source.go index a8435633c4..a005dd0a12 100644 --- a/internal/service/advancedclustertpf/data_source.go +++ b/internal/service/advancedclustertpf/data_source.go @@ -64,7 +64,7 @@ func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS * if diags.HasError() { return nil } - if extraInfo.AsymmetricShardUnsupported && !useReplicationSpecPerShard { + if extraInfo.ForceLegacySchemaFailed { diags.AddError("errorRead", "Please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details.") return nil } diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index 26a6faa65b..c039f5c1bc 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -25,7 +25,7 @@ type ExtraAPIInfo struct { RootDiskSize *float64 ContainerIDs map[string]string UsingLegacySchema bool - AsymmetricShardUnsupported bool + ForceLegacySchemaFailed bool } func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, timeout timeouts.Value, diags *diag.Diagnostics, apiInfo ExtraAPIInfo) *TFModel { diff --git a/internal/service/advancedclustertpf/plural_data_source.go b/internal/service/advancedclustertpf/plural_data_source.go index 95d8dbb8a2..f1e4928903 100644 --- a/internal/service/advancedclustertpf/plural_data_source.go +++ b/internal/service/advancedclustertpf/plural_data_source.go @@ -77,7 +77,7 @@ func (d *pluralDS) readClusters(ctx context.Context, diags *diag.Diagnostics, pl if diags.HasError() { return nil } - if extraInfo.AsymmetricShardUnsupported && !useReplicationSpecPerShard { + if extraInfo.ForceLegacySchemaFailed { continue } updateModelAdvancedConfig(ctx, diags, d.Client, modelOut, nil, nil) diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 5168408298..9142317f62 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -453,19 +453,19 @@ func (r *rs) applyTenantUpgrade(ctx context.Context, plan *TFModel, upgradeReque } func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, clusterResp *admin.ClusterDescription20240805, modelIn *TFModel, forceLegacySchema bool) (*TFModel, *ExtraAPIInfo) { - apiInfo := resolveAPIInfo(ctx, diags, client, modelIn, clusterResp, forceLegacySchema) + extraInfo := resolveAPIInfo(ctx, diags, client, modelIn, clusterResp, forceLegacySchema) if diags.HasError() { return nil, nil } - if forceLegacySchema && apiInfo.AsymmetricShardUnsupported { // can't create a model if legacy is forced but cluster does not support it - return nil, apiInfo + if extraInfo.ForceLegacySchemaFailed { // can't create a model if legacy is forced but cluster does not support it + return nil, extraInfo } - modelOut := NewTFModel(ctx, clusterResp, modelIn.Timeouts, diags, *apiInfo) + modelOut := NewTFModel(ctx, clusterResp, modelIn.Timeouts, diags, *extraInfo) if diags.HasError() { return nil, nil } overrideAttributesWithPrevStateValue(modelIn, modelOut) - return modelOut, apiInfo + return modelOut, extraInfo } func updateModelAdvancedConfig(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, model *TFModel, legacyAdvConfig *admin20240530.ClusterDescriptionProcessArgs, advConfig *admin.ClusterDescriptionProcessArgs20240805) { diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index 1f7a5bd37a..ff8a877d55 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -41,16 +41,16 @@ func findNumShardsUpdates(ctx context.Context, state, plan *TFModel, diags *diag func resolveAPIInfo(ctx context.Context, diags *diag.Diagnostics, client *config.MongoDBClient, plan *TFModel, clusterLatest *admin.ClusterDescription20240805, forceLegacySchema bool) *ExtraAPIInfo { var ( - api20240530 = client.AtlasV220240530.ClustersApi - rootDiskSize = conversion.NilForUnknown(plan.DiskSizeGB, plan.DiskSizeGB.ValueFloat64Pointer()) - projectID = plan.ProjectID.ValueString() - clusterName = plan.Name.ValueString() - asymmetricShardUnsupported = false + api20240530 = client.AtlasV220240530.ClustersApi + rootDiskSize = conversion.NilForUnknown(plan.DiskSizeGB, plan.DiskSizeGB.ValueFloat64Pointer()) + projectID = plan.ProjectID.ValueString() + clusterName = plan.Name.ValueString() + forceLegacySchemaFailed = false ) clusterRespOld, _, err := api20240530.GetCluster(ctx, projectID, clusterName).Execute() if err != nil { if admin20240530.IsErrorCode(err, "ASYMMETRIC_SHARD_UNSUPPORTED") { - asymmetricShardUnsupported = true + forceLegacySchemaFailed = forceLegacySchema } else { diags.AddError("errorRead", fmt.Sprintf("error reading advanced cluster with 2024-05-30 API (%s): %s", clusterName, err)) return nil @@ -68,7 +68,7 @@ func resolveAPIInfo(ctx context.Context, diags *diag.Diagnostics, client *config ContainerIDs: containerIDs, RootDiskSize: rootDiskSize, ZoneNameReplicationSpecIDs: replicationSpecIDsFromOldAPI(clusterRespOld), - AsymmetricShardUnsupported: asymmetricShardUnsupported, + ForceLegacySchemaFailed: forceLegacySchemaFailed, } if forceLegacySchema { info.UsingLegacySchema = true From 586dfc5589cbfc1ab4dbcebd282a48685abfa1b0 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:32:57 +0100 Subject: [PATCH 23/40] chore: Converts resource blocks to resource attributes in data source schema auto-generation (#2904) * convert blocks to attributes * plural test with blocks * refactor * remove unneeded checks * apply feedback --- .../common/conversion/schema_generation.go | 60 ++-- .../conversion/schema_generation_test.go | 276 +++++++++++++++--- 2 files changed, 264 insertions(+), 72 deletions(-) diff --git a/internal/common/conversion/schema_generation.go b/internal/common/conversion/schema_generation.go index b9ece6fe51..cc3a73ff5f 100644 --- a/internal/common/conversion/schema_generation.go +++ b/internal/common/conversion/schema_generation.go @@ -1,6 +1,7 @@ package conversion import ( + "maps" "reflect" "slices" @@ -22,20 +23,17 @@ type PluralDataSourceSchemaRequest struct { } func DataSourceSchemaFromResource(rs schema.Schema, req *DataSourceSchemaRequest) dsschema.Schema { - blocks := convertBlocks(rs.Blocks, req.RequiredFields) attrs := convertAttrs(rs.Attributes, req.RequiredFields) + maps.Copy(attrs, convertBlocksToAttrs(rs.Blocks, req.RequiredFields)) overrideFields(attrs, req.OverridenFields) - ds := dsschema.Schema{Attributes: attrs, Blocks: blocks} + ds := dsschema.Schema{Attributes: attrs} UpdateSchemaDescription(&ds) return ds } func PluralDataSourceSchemaFromResource(rs schema.Schema, req *PluralDataSourceSchemaRequest) dsschema.Schema { - blocks := convertBlocks(rs.Blocks, nil) - if len(blocks) > 0 { - panic("blocks not supported yet in auto-generated plural data source schema as they can't go in ListNestedAttribute") - } attrs := convertAttrs(rs.Attributes, nil) + maps.Copy(attrs, convertBlocksToAttrs(rs.Blocks, nil)) overrideFields(attrs, req.OverridenFields) rootAttrs := convertAttrs(rs.Attributes, req.RequiredFields) for name := range rootAttrs { @@ -76,12 +74,14 @@ var convertMappings = map[string]reflect.Type{ "Int64Attribute": reflect.TypeOf(dsschema.Int64Attribute{}), "Float64Attribute": reflect.TypeOf(dsschema.Float64Attribute{}), "MapAttribute": reflect.TypeOf(dsschema.MapAttribute{}), + "ListAttribute": reflect.TypeOf(dsschema.ListAttribute{}), + "SetAttribute": reflect.TypeOf(dsschema.SetAttribute{}), "SingleNestedAttribute": reflect.TypeOf(dsschema.SingleNestedAttribute{}), "ListNestedAttribute": reflect.TypeOf(dsschema.ListNestedAttribute{}), "SetNestedAttribute": reflect.TypeOf(dsschema.SetNestedAttribute{}), - "ListAttribute": reflect.TypeOf(dsschema.ListAttribute{}), - "SetNestedBlock": reflect.TypeOf(dsschema.SetNestedBlock{}), - "SetAttribute": reflect.TypeOf(dsschema.SetAttribute{}), + "SingleNestedBlock": reflect.TypeOf(dsschema.SingleNestedAttribute{}), + "ListNestedBlock": reflect.TypeOf(dsschema.ListNestedAttribute{}), + "SetNestedBlock": reflect.TypeOf(dsschema.SetNestedAttribute{}), } var convertNestedMappings = map[string]reflect.Type{ @@ -91,9 +91,6 @@ var convertNestedMappings = map[string]reflect.Type{ func convertAttrs(rsAttrs map[string]schema.Attribute, requiredFields []string) map[string]dsschema.Attribute { const ignoreField = "timeouts" - if rsAttrs == nil { - return nil - } dsAttrs := make(map[string]dsschema.Attribute, len(rsAttrs)) for name, attr := range rsAttrs { if name == ignoreField { @@ -104,15 +101,12 @@ func convertAttrs(rsAttrs map[string]schema.Attribute, requiredFields []string) return dsAttrs } -func convertBlocks(rsBlocks map[string]schema.Block, requiredFields []string) map[string]dsschema.Block { - if rsBlocks == nil { - return nil - } - dsBlocks := make(map[string]dsschema.Block, len(rsBlocks)) +func convertBlocksToAttrs(rsBlocks map[string]schema.Block, requiredFields []string) map[string]dsschema.Attribute { + dsAttrs := make(map[string]dsschema.Attribute, len(rsBlocks)) for name, block := range rsBlocks { - dsBlocks[name] = convertElement(name, block, requiredFields).(dsschema.Block) + dsAttrs[name] = convertElement(name, block, requiredFields).(dsschema.Attribute) } - return dsBlocks + return dsAttrs } func convertElement(name string, element any, requiredFields []string) any { @@ -131,8 +125,8 @@ func convertElement(name string, element any, requiredFields []string) any { vDest := reflect.New(tDest).Elem() vDest.FieldByName("MarkdownDescription").Set(vSrc.FieldByName("MarkdownDescription")) vDest.FieldByName("DeprecationMessage").Set(vSrc.FieldByName("DeprecationMessage")) - if fSensitive := vDest.FieldByName("Sensitive"); fSensitive.CanSet() { - fSensitive.Set(vSrc.FieldByName("Sensitive")) + if fSensitive, sSensitive := vDest.FieldByName("Sensitive"), vSrc.FieldByName("Sensitive"); fSensitive.CanSet() && sSensitive.IsValid() { + fSensitive.Set(sSensitive) } if fComputed := vDest.FieldByName("Computed"); fComputed.CanSet() { fComputed.SetBool(computed) @@ -143,23 +137,35 @@ func convertElement(name string, element any, requiredFields []string) any { if fElementType := vDest.FieldByName("ElementType"); fElementType.CanSet() { fElementType.Set(vSrc.FieldByName("ElementType")) } - if fAttributes := vDest.FieldByName("Attributes"); fAttributes.CanSet() { - attrsSrc := vSrc.FieldByName("Attributes").Interface().(map[string]schema.Attribute) - fAttributes.Set(reflect.ValueOf(convertAttrs(attrsSrc, nil))) - } + fillNestedAttrs(vDest, vSrc) + if fNested := vDest.FieldByName("NestedObject"); fNested.CanSet() { tNested := convertNestedMappings[fNested.Type().Name()] if tNested == nil { panic("nested type not support yet, add it to convertNestedMappings: " + fNested.Type().Name()) } - attrsSrc := vSrc.FieldByName("NestedObject").FieldByName("Attributes").Interface().(map[string]schema.Attribute) vNested := reflect.New(tNested).Elem() - vNested.FieldByName("Attributes").Set(reflect.ValueOf(convertAttrs(attrsSrc, nil))) + fillNestedAttrs(vNested, vSrc.FieldByName("NestedObject")) fNested.Set(vNested) } return vDest.Interface() } +func fillNestedAttrs(vDest, vSrc reflect.Value) { + fAttributes := vDest.FieldByName("Attributes") + if !fAttributes.CanSet() { + return + } + attrsSrc := vSrc.FieldByName("Attributes").Interface().(map[string]schema.Attribute) + attrSrcDS := convertAttrs(attrsSrc, nil) + if fBlocks := vSrc.FieldByName("Blocks"); fBlocks.IsValid() { + blocksSrc := fBlocks.Interface().(map[string]schema.Block) + blockSrcDS := convertBlocksToAttrs(blocksSrc, nil) + maps.Copy(attrSrcDS, blockSrcDS) + } + fAttributes.Set(reflect.ValueOf(attrSrcDS)) +} + func overrideFields(attrs, overridenFields map[string]dsschema.Attribute) { for name, attr := range overridenFields { if attr == nil { diff --git a/internal/common/conversion/schema_generation_test.go b/internal/common/conversion/schema_generation_test.go index 5fd9c043e2..6d08c018c0 100644 --- a/internal/common/conversion/schema_generation_test.go +++ b/internal/common/conversion/schema_generation_test.go @@ -66,19 +66,19 @@ func TestDataSourceSchemaFromResource(t *testing.T) { ElementType: types.StringType, MarkdownDescription: "desc setAttr", }, - "nestSingle": schema.SingleNestedAttribute{ + "singleNestedAttribute": schema.SingleNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestSingle", + MarkdownDescription: "desc singleNestedAttribute", Attributes: map[string]schema.Attribute{ - "nestedSingleAttr": schema.StringAttribute{ + "singleNestedAttributeAttr": schema.StringAttribute{ Computed: true, - MarkdownDescription: "desc nestedSingleAttr", + MarkdownDescription: "desc singleNestedAttributeAttr", }, }, }, - "nestList": schema.ListNestedAttribute{ + "listNestedAttribute": schema.ListNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestList", + MarkdownDescription: "desc listNestedAttribute", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "nestedAttr": schema.StringAttribute{ @@ -92,9 +92,9 @@ func TestDataSourceSchemaFromResource(t *testing.T) { }, }, }, - "nestSet": schema.SetNestedAttribute{ + "setNestedAttribute": schema.SetNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestSet", + MarkdownDescription: "desc setNestedAttribute", NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "nestedAttr": schema.StringAttribute{ @@ -110,18 +110,6 @@ func TestDataSourceSchemaFromResource(t *testing.T) { Delete: true, }), }, - Blocks: map[string]schema.Block{ - "nestBlock": schema.SetNestedBlock{ - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "nestBlockAttr": schema.StringAttribute{ - Computed: true, - MarkdownDescription: "desc nestBlockAttr", - }, - }, - }, - }, - }, } expected := dsschema.Schema{ @@ -180,22 +168,22 @@ func TestDataSourceSchemaFromResource(t *testing.T) { MarkdownDescription: "desc setAttr", Description: "desc setAttr", }, - "nestSingle": dsschema.SingleNestedAttribute{ + "singleNestedAttribute": dsschema.SingleNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestSingle", - Description: "desc nestSingle", + MarkdownDescription: "desc singleNestedAttribute", + Description: "desc singleNestedAttribute", Attributes: map[string]dsschema.Attribute{ - "nestedSingleAttr": dsschema.StringAttribute{ + "singleNestedAttributeAttr": dsschema.StringAttribute{ Computed: true, - MarkdownDescription: "desc nestedSingleAttr", - Description: "desc nestedSingleAttr", + MarkdownDescription: "desc singleNestedAttributeAttr", + Description: "desc singleNestedAttributeAttr", }, }, }, - "nestList": dsschema.ListNestedAttribute{ + "listNestedAttribute": dsschema.ListNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestList", - Description: "desc nestList", + MarkdownDescription: "desc listNestedAttribute", + Description: "desc listNestedAttribute", NestedObject: dsschema.NestedAttributeObject{ Attributes: map[string]dsschema.Attribute{ "nestedAttr": dsschema.StringAttribute{ @@ -211,10 +199,10 @@ func TestDataSourceSchemaFromResource(t *testing.T) { }, }, }, - "nestSet": dsschema.SetNestedAttribute{ + "setNestedAttribute": dsschema.SetNestedAttribute{ Computed: true, - MarkdownDescription: "desc nestSet", - Description: "desc nestSet", + MarkdownDescription: "desc setNestedAttribute", + Description: "desc setNestedAttribute", NestedObject: dsschema.NestedAttributeObject{ Attributes: map[string]dsschema.Attribute{ "nestedAttr": dsschema.StringAttribute{ @@ -234,19 +222,6 @@ func TestDataSourceSchemaFromResource(t *testing.T) { }, }, }, - Blocks: map[string]dsschema.Block{ - "nestBlock": dsschema.SetNestedBlock{ - NestedObject: dsschema.NestedBlockObject{ - Attributes: map[string]dsschema.Attribute{ - "nestBlockAttr": dsschema.StringAttribute{ - Computed: true, - MarkdownDescription: "desc nestBlockAttr", - Description: "desc nestBlockAttr", - }, - }, - }, - }, - }, } ds := conversion.DataSourceSchemaFromResource(s, &conversion.DataSourceSchemaRequest{ @@ -265,6 +240,191 @@ func TestDataSourceSchemaFromResource(t *testing.T) { assert.Equal(t, expected, ds) } +func TestDataSourceSchemaFromResource_blocksToAttrs(t *testing.T) { + s := schema.Schema{ + Attributes: map[string]schema.Attribute{ + "requiredAttrString": schema.StringAttribute{ + Required: true, + MarkdownDescription: "desc requiredAttrString", + }, + "attrString": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc attrString", + }, + }, + Blocks: map[string]schema.Block{ + "setNestedBlock": schema.SetNestedBlock{ + MarkdownDescription: "desc setNestedBlock", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "setNestedBlockAttr": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc setNestedBlockAttr", + }, + }, + Blocks: map[string]schema.Block{ + "bb 1": schema.SingleNestedBlock{ + MarkdownDescription: "desc bb 1", + Attributes: map[string]schema.Attribute{ + "bb attr 1": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc bb attr 1", + }, + }, + }, + }, + }, + }, + "listNestedBlock": schema.ListNestedBlock{ + MarkdownDescription: "desc listNestedBlock", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "listNestedBlockAttr": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc listNestedBlockAttr", + }, + }, + Blocks: map[string]schema.Block{ + "bb 2": schema.ListNestedBlock{ + MarkdownDescription: "desc bb 2", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "bb attr 2": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc bb attr 2", + }, + }, + }, + }, + }, + }, + }, + "singleNestedBlock": schema.SingleNestedBlock{ + MarkdownDescription: "desc singleNestedBlock", + Attributes: map[string]schema.Attribute{ + "nestattr": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc nestattr", + }, + }, + Blocks: map[string]schema.Block{ + "bb 3": schema.ListNestedBlock{ + MarkdownDescription: "desc bb 3", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "bb attr 3": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc bb attr 3", + }, + }, + }, + }, + }, + }, + }, + } + + expected := dsschema.Schema{ + Attributes: map[string]dsschema.Attribute{ + "requiredAttrString": dsschema.StringAttribute{ + Required: true, + MarkdownDescription: "desc requiredAttrString", + Description: "desc requiredAttrString", + }, + "attrString": dsschema.StringAttribute{ + Computed: true, + MarkdownDescription: "desc attrString", + Description: "desc attrString", + }, + "setNestedBlock": dsschema.SetNestedAttribute{ + Computed: true, + Description: "desc setNestedBlock", + MarkdownDescription: "desc setNestedBlock", + NestedObject: dsschema.NestedAttributeObject{ + Attributes: map[string]dsschema.Attribute{ + "setNestedBlockAttr": dsschema.StringAttribute{ + Computed: true, + Description: "desc setNestedBlockAttr", + MarkdownDescription: "desc setNestedBlockAttr", + }, + "bb 1": dsschema.SingleNestedAttribute{ + Computed: true, + Description: "desc bb 1", + MarkdownDescription: "desc bb 1", + Attributes: map[string]dsschema.Attribute{ + "bb attr 1": dsschema.StringAttribute{ + Computed: true, + Description: "desc bb attr 1", + MarkdownDescription: "desc bb attr 1", + }, + }, + }, + }, + }, + }, + "listNestedBlock": dsschema.ListNestedAttribute{ + Computed: true, + Description: "desc listNestedBlock", + MarkdownDescription: "desc listNestedBlock", + NestedObject: dsschema.NestedAttributeObject{ + Attributes: map[string]dsschema.Attribute{ + "listNestedBlockAttr": dsschema.StringAttribute{ + Computed: true, + Description: "desc listNestedBlockAttr", + MarkdownDescription: "desc listNestedBlockAttr", + }, + "bb 2": dsschema.ListNestedAttribute{ + Computed: true, + Description: "desc bb 2", + MarkdownDescription: "desc bb 2", + NestedObject: dsschema.NestedAttributeObject{ + Attributes: map[string]dsschema.Attribute{ + "bb attr 2": dsschema.StringAttribute{ + Computed: true, + Description: "desc bb attr 2", + MarkdownDescription: "desc bb attr 2", + }, + }, + }, + }, + }, + }, + }, + "singleNestedBlock": dsschema.SingleNestedAttribute{ + Computed: true, + Description: "desc singleNestedBlock", + MarkdownDescription: "desc singleNestedBlock", + Attributes: map[string]dsschema.Attribute{ + "nestattr": dsschema.StringAttribute{ + Computed: true, + Description: "desc nestattr", + MarkdownDescription: "desc nestattr", + }, + "bb 3": dsschema.ListNestedAttribute{ + Computed: true, + Description: "desc bb 3", + MarkdownDescription: "desc bb 3", + NestedObject: dsschema.NestedAttributeObject{ + Attributes: map[string]dsschema.Attribute{ + "bb attr 3": dsschema.StringAttribute{ + Computed: true, + Description: "desc bb attr 3", + MarkdownDescription: "desc bb attr 3", + }, + }, + }, + }, + }, + }, + }, + } + + ds := conversion.DataSourceSchemaFromResource(s, &conversion.DataSourceSchemaRequest{ + RequiredFields: []string{"requiredAttrString"}, + }) + assert.Equal(t, expected, ds) +} + func TestPluralDataSourceSchemaFromResource(t *testing.T) { s := schema.Schema{ Attributes: map[string]schema.Attribute{ @@ -286,6 +446,18 @@ func TestPluralDataSourceSchemaFromResource(t *testing.T) { MarkdownDescription: "desc overridenString", }, }, + Blocks: map[string]schema.Block{ + "nested": schema.ListNestedBlock{ + MarkdownDescription: "desc nested", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "nested attr": schema.StringAttribute{ + MarkdownDescription: "desc nested attr", + }, + }, + }, + }, + }, } expected := dsschema.Schema{ @@ -327,6 +499,20 @@ func TestPluralDataSourceSchemaFromResource(t *testing.T) { stringvalidator.ConflictsWith(path.MatchRoot("otherAttr")), }, }, + "nested": dsschema.ListNestedAttribute{ + Computed: true, + Description: "desc nested", + MarkdownDescription: "desc nested", + NestedObject: dsschema.NestedAttributeObject{ + Attributes: map[string]dsschema.Attribute{ + "nested attr": dsschema.StringAttribute{ + Computed: true, + Description: "desc nested attr", + MarkdownDescription: "desc nested attr", + }, + }, + }, + }, }, }, Description: "List of documents that MongoDB Cloud returns for this request.", From c7d23b460a4b1be8b619270c40146b3c78eb00be Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:00:25 +0100 Subject: [PATCH 24/40] chore: Uses blocks for Tags and Labels in TPF (#2901) * move labels and tags from attrs to blocks * don't convert labels and tags * allow null value in Labels and Tags * fix TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate --- .../model_to_ClusterDescription20240805.go | 4 +- .../resource_test_cases_test.go | 8 +-- internal/service/advancedclustertpf/schema.go | 69 +++++++++---------- .../acc/advanced_cluster_schema_v2.go | 2 - .../acc/advanced_cluster_schema_v2_test.go | 37 +++++----- 5 files changed, 58 insertions(+), 62 deletions(-) diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index 7c37051c6b..a0bf99fc5a 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -61,7 +61,7 @@ func newBiConnector(ctx context.Context, input types.Object, diags *diag.Diagnos } } func newComponentLabel(ctx context.Context, input types.Set, diags *diag.Diagnostics) *[]admin.ComponentLabel { - if input.IsUnknown() || input.IsNull() { + if input.IsUnknown() { return nil } elements := make([]TFLabelsModel, len(input.Elements())) @@ -110,7 +110,7 @@ func resolveZoneNameOrUseDefault(item *TFReplicationSpecsModel) string { } func newResourceTag(ctx context.Context, input types.Set, diags *diag.Diagnostics) *[]admin.ResourceTag { - if input.IsUnknown() || input.IsNull() { + if input.IsUnknown() { return nil } elements := make([]TFTagsModel, len(input.Elements())) diff --git a/internal/service/advancedclustertpf/resource_test_cases_test.go b/internal/service/advancedclustertpf/resource_test_cases_test.go index 7881976157..335c2793c8 100644 --- a/internal/service/advancedclustertpf/resource_test_cases_test.go +++ b/internal/service/advancedclustertpf/resource_test_cases_test.go @@ -337,14 +337,14 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { enabled = true } # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty - labels = [{ + labels { key = "env" value = "test" - }] - tags = [{ + } + tags { key = "env" value = "test" - }] + } mongo_db_major_version = "8.0" pit_enabled = true redact_client_log_data = true diff --git a/internal/service/advancedclustertpf/schema.go b/internal/service/advancedclustertpf/schema.go index cc487771bc..f262de0155 100644 --- a/internal/service/advancedclustertpf/schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -12,7 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/setdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" @@ -155,24 +154,6 @@ func resourceSchema(ctx context.Context) schema.Schema { Computed: true, MarkdownDescription: "Unique 24-hexadecimal digit string that identifies the cluster.", }, - "labels": schema.SetNestedAttribute{ - Computed: true, - Optional: true, - Default: setdefault.StaticValue(types.SetValueMust(LabelsObjType, nil)), - MarkdownDescription: "Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels.\n\nCluster labels are deprecated and will be removed in a future release. We strongly recommend that you use [resource tags](https://dochub.mongodb.org/core/add-cluster-tag-atlas) instead.", - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "key": schema.StringAttribute{ - Required: true, - MarkdownDescription: "Key applied to tag and categorize this component.", - }, - "value": schema.StringAttribute{ - Required: true, - MarkdownDescription: "Value set to the Key applied to tag and categorize this component.", - }, - }, - }, - }, "mongo_db_major_version": schema.StringAttribute{ Computed: true, Optional: true, @@ -291,24 +272,6 @@ func resourceSchema(ctx context.Context) schema.Schema { Computed: true, MarkdownDescription: "Human-readable label that indicates the current operating condition of this cluster.", }, - "tags": schema.SetNestedAttribute{ - Computed: true, - Optional: true, - Default: setdefault.StaticValue(types.SetValueMust(TagsObjType, nil)), - MarkdownDescription: "List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster.", - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "key": schema.StringAttribute{ - Required: true, - MarkdownDescription: "Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.", - }, - "value": schema.StringAttribute{ - Required: true, - MarkdownDescription: "Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.", - }, - }, - }, - }, "termination_protection_enabled": schema.BoolAttribute{ Computed: true, Optional: true, @@ -350,6 +313,38 @@ func resourceSchema(ctx context.Context) schema.Schema { Delete: true, }), }, + Blocks: map[string]schema.Block{ + "labels": schema.SetNestedBlock{ + MarkdownDescription: "Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels.\n\nCluster labels are deprecated and will be removed in a future release. We strongly recommend that you use [resource tags](https://dochub.mongodb.org/core/add-cluster-tag-atlas) instead.", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Key applied to tag and categorize this component.", + }, + "value": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Value set to the Key applied to tag and categorize this component.", + }, + }, + }, + }, + "tags": schema.SetNestedBlock{ + MarkdownDescription: "List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster.", + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.", + }, + "value": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.", + }, + }, + }, + }, + }, } } diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index c8965db6a9..3a49779ca5 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -97,8 +97,6 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri continue } writeBody := resource.Body() - convertAttrs(t, "labels", writeBody, true, hcl.GetAttrVal) - convertAttrs(t, "tags", writeBody, true, hcl.GetAttrVal) convertAttrs(t, "replication_specs", writeBody, true, getReplicationSpecs) convertAttrs(t, "advanced_configuration", writeBody, false, hcl.GetAttrVal) convertAttrs(t, "bi_connector_config", writeBody, false, hcl.GetAttrVal) diff --git a/internal/testutil/acc/advanced_cluster_schema_v2_test.go b/internal/testutil/acc/advanced_cluster_schema_v2_test.go index 348566fb10..e5faab26f6 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2_test.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2_test.go @@ -152,30 +152,33 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { cluster_type = "SHARDED" - - - - - - - labels = [{ + tags { + key = "Key Tag 2" + value = "Value Tag 2" + } + + labels { key = "Key Label 1" value = "Value Label 1" - }, { + } + + tags { + key = "Key Tag 1" + value = "Value Tag 1" + } + + labels { key = "Key Label 2" value = "Value Label 2" - }, { + } + + labels { key = "Key Label 3" value = "Value Label 3" - }] - tags = [{ - key = "Key Tag 2" - value = "Value Tag 2" - }, { - key = "Key Tag 1" - value = "Value Tag 1" - }] + } + + replication_specs = [{ region_configs = [{ analytics_specs = { From 233999e49a9d41623f3af0c3a257cdb7a1d96404 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:35:14 +0100 Subject: [PATCH 25/40] chore: Moves `bi_connector_config` and `advanced_configuration` in TPF to blocks (#2909) * remove advanced_configuration and bi_connector_config from conversion * use blocks * change model from object to list * use list in conversions * fix error: produced an unexpected new value: .advanced_configuration: block count changed from 0 to 1. * Revert "fix error: produced an unexpected new value: .advanced_configuration: block count changed from 0 to 1." This reverts commit e950e931224a67cb7ce3b95add1078cda8b1704c. * restrictResourceModel * restrictResourceModel * simplify restrictResourceModel * newAdminFromSingleList * enable test again * SingleListTFToSDK * feedback for overrideAttributesWithPlanValue --- .../common/conversion/admin_generation.go | 21 ++ .../model_ClusterDescription20240805.go | 8 +- ...l_ClusterDescriptionProcessArgs20240805.go | 4 +- .../model_to_ClusterDescription20240805.go | 23 +- ...o_ClusterDescriptionProcessArgs20240805.go | 38 ++-- ..._to_ClusterDescriptionProcessArgsLegacy.go | 24 +- .../service/advancedclustertpf/resource.go | 4 +- .../resource_compatiblity.go | 9 +- .../resource_test_cases_test.go | 9 +- internal/service/advancedclustertpf/schema.go | 205 +++++++++--------- ...ncedCluster_replicasetAdvConfigUpdate.yaml | 4 +- ...Id}_clusters_{clusterName}_2024-10-23.json | 3 +- ..._{clusterName}_processArgs_2024-08-05.json | 1 + .../acc/advanced_cluster_schema_v2.go | 4 - .../acc/advanced_cluster_schema_v2_test.go | 50 ++--- 15 files changed, 208 insertions(+), 199 deletions(-) create mode 100644 internal/common/conversion/admin_generation.go diff --git a/internal/common/conversion/admin_generation.go b/internal/common/conversion/admin_generation.go new file mode 100644 index 0000000000..4f8583494c --- /dev/null +++ b/internal/common/conversion/admin_generation.go @@ -0,0 +1,21 @@ +package conversion + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +func SingleListTFToSDK[TFModel, SDKRequest any](ctx context.Context, diags *diag.Diagnostics, input *types.List, fnTransform func(tf TFModel) SDKRequest) SDKRequest { + var resp SDKRequest + if input == nil || input.IsUnknown() || input.IsNull() || len(input.Elements()) == 0 { + return resp + } + elements := make([]TFModel, len(input.Elements())) + diags.Append(input.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return resp + } + return fnTransform(elements[0]) +} diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index c039f5c1bc..3acce4ce55 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -70,17 +70,17 @@ func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, ti } } -func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.Object { +func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.List { if input == nil { - return types.ObjectNull(BiConnectorConfigObjType.AttrTypes) + return types.ListNull(BiConnectorConfigObjType) } tfModel := TFBiConnectorModel{ Enabled: types.BoolValue(conversion.SafeValue(input.Enabled)), ReadPreference: types.StringValue(conversion.SafeValue(input.ReadPreference)), } - objType, diagsLocal := types.ObjectValueFrom(ctx, BiConnectorConfigObjType.AttrTypes, tfModel) + listType, diagsLocal := types.ListValueFrom(ctx, BiConnectorConfigObjType, []TFBiConnectorModel{tfModel}) diags.Append(diagsLocal...) - return objType + return listType } func NewConnectionStringsObjType(ctx context.Context, input *admin.ClusterConnectionStrings, diags *diag.Diagnostics) types.Object { diff --git a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go index ff14a68650..15d097c664 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go @@ -46,7 +46,7 @@ func AddAdvancedConfig(ctx context.Context, tfModel *TFModel, input *admin.Clust TransactionLifetimeLimitSeconds: types.Int64Value(conversion.SafeValue(input.TransactionLifetimeLimitSeconds)), } } - objType, diagsLocal := types.ObjectValueFrom(ctx, AdvancedConfigurationObjType.AttrTypes, advancedConfig) + listType, diagsLocal := types.ListValueFrom(ctx, AdvancedConfigurationObjType, []TFAdvancedConfigurationModel{advancedConfig}) diags.Append(diagsLocal...) - tfModel.AdvancedConfiguration = objType + tfModel.AdvancedConfiguration = listType } diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index a0bf99fc5a..80d1420e98 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -45,21 +45,16 @@ func NewAtlasReq(ctx context.Context, input *TFModel, diags *diag.Diagnostics) * VersionReleaseSystem: conversion.NilForUnknown(input.VersionReleaseSystem, input.VersionReleaseSystem.ValueStringPointer()), } } -func newBiConnector(ctx context.Context, input types.Object, diags *diag.Diagnostics) *admin.BiConnector { - var resp *admin.BiConnector - if input.IsUnknown() || input.IsNull() { - return resp - } - item := &TFBiConnectorModel{} - if localDiags := input.As(ctx, item, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { - diags.Append(localDiags...) - return resp - } - return &admin.BiConnector{ - Enabled: conversion.NilForUnknown(item.Enabled, item.Enabled.ValueBoolPointer()), - ReadPreference: conversion.NilForUnknown(item.ReadPreference, item.ReadPreference.ValueStringPointer()), - } + +func newBiConnector(ctx context.Context, input types.List, diags *diag.Diagnostics) *admin.BiConnector { + return conversion.SingleListTFToSDK(ctx, diags, &input, func(tf TFBiConnectorModel) *admin.BiConnector { + return &admin.BiConnector{ + Enabled: conversion.NilForUnknown(tf.Enabled, tf.Enabled.ValueBoolPointer()), + ReadPreference: conversion.NilForUnknown(tf.ReadPreference, tf.ReadPreference.ValueStringPointer()), + } + }) } + func newComponentLabel(ctx context.Context, input types.Set, diags *diag.Diagnostics) *[]admin.ComponentLabel { if input.IsUnknown() { return nil diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go index f23ff302f8..79dc88c1a5 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go @@ -5,31 +5,23 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) -func NewAtlasReqAdvancedConfiguration(ctx context.Context, objInput *types.Object, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805 { - var resp *admin.ClusterDescriptionProcessArgs20240805 - if objInput == nil || objInput.IsUnknown() || objInput.IsNull() { - return resp - } - input := &TFAdvancedConfigurationModel{} - if localDiags := objInput.As(ctx, input, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { - diags.Append(localDiags...) - return resp - } - return &admin.ClusterDescriptionProcessArgs20240805{ - ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.NilForUnknown(input.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds, conversion.Int64PtrToIntPtr(input.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds.ValueInt64Pointer())), - DefaultWriteConcern: conversion.NilForUnknown(input.DefaultWriteConcern, input.DefaultWriteConcern.ValueStringPointer()), - JavascriptEnabled: conversion.NilForUnknown(input.JavascriptEnabled, input.JavascriptEnabled.ValueBoolPointer()), - MinimumEnabledTlsProtocol: conversion.NilForUnknown(input.MinimumEnabledTlsProtocol, input.MinimumEnabledTlsProtocol.ValueStringPointer()), - NoTableScan: conversion.NilForUnknown(input.NoTableScan, input.NoTableScan.ValueBoolPointer()), - OplogMinRetentionHours: conversion.NilForUnknown(input.OplogMinRetentionHours, input.OplogMinRetentionHours.ValueFloat64Pointer()), - OplogSizeMB: conversion.NilForUnknown(input.OplogSizeMb, conversion.Int64PtrToIntPtr(input.OplogSizeMb.ValueInt64Pointer())), - SampleRefreshIntervalBIConnector: conversion.NilForUnknown(input.SampleRefreshIntervalBiconnector, conversion.Int64PtrToIntPtr(input.SampleRefreshIntervalBiconnector.ValueInt64Pointer())), - SampleSizeBIConnector: conversion.NilForUnknown(input.SampleSizeBiconnector, conversion.Int64PtrToIntPtr(input.SampleSizeBiconnector.ValueInt64Pointer())), - TransactionLifetimeLimitSeconds: conversion.NilForUnknown(input.TransactionLifetimeLimitSeconds, input.TransactionLifetimeLimitSeconds.ValueInt64Pointer()), - } +func NewAtlasReqAdvancedConfiguration(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805 { + return conversion.SingleListTFToSDK(ctx, diags, input, func(tf TFAdvancedConfigurationModel) *admin.ClusterDescriptionProcessArgs20240805 { + return &admin.ClusterDescriptionProcessArgs20240805{ + ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.NilForUnknown(tf.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds, conversion.Int64PtrToIntPtr(tf.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds.ValueInt64Pointer())), + DefaultWriteConcern: conversion.NilForUnknown(tf.DefaultWriteConcern, tf.DefaultWriteConcern.ValueStringPointer()), + JavascriptEnabled: conversion.NilForUnknown(tf.JavascriptEnabled, tf.JavascriptEnabled.ValueBoolPointer()), + MinimumEnabledTlsProtocol: conversion.NilForUnknown(tf.MinimumEnabledTlsProtocol, tf.MinimumEnabledTlsProtocol.ValueStringPointer()), + NoTableScan: conversion.NilForUnknown(tf.NoTableScan, tf.NoTableScan.ValueBoolPointer()), + OplogMinRetentionHours: conversion.NilForUnknown(tf.OplogMinRetentionHours, tf.OplogMinRetentionHours.ValueFloat64Pointer()), + OplogSizeMB: conversion.NilForUnknown(tf.OplogSizeMb, conversion.Int64PtrToIntPtr(tf.OplogSizeMb.ValueInt64Pointer())), + SampleRefreshIntervalBIConnector: conversion.NilForUnknown(tf.SampleRefreshIntervalBiconnector, conversion.Int64PtrToIntPtr(tf.SampleRefreshIntervalBiconnector.ValueInt64Pointer())), + SampleSizeBIConnector: conversion.NilForUnknown(tf.SampleSizeBiconnector, conversion.Int64PtrToIntPtr(tf.SampleSizeBiconnector.ValueInt64Pointer())), + TransactionLifetimeLimitSeconds: conversion.NilForUnknown(tf.TransactionLifetimeLimitSeconds, tf.TransactionLifetimeLimitSeconds.ValueInt64Pointer()), + } + }) } diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go index cd8f3f60c8..7d168dabd2 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go @@ -5,24 +5,16 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" ) -func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, objInput *types.Object, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs { - var resp *admin20240530.ClusterDescriptionProcessArgs - if objInput == nil || objInput.IsUnknown() || objInput.IsNull() { - return resp - } - input := &TFAdvancedConfigurationModel{} - if localDiags := objInput.As(ctx, input, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { - diags.Append(localDiags...) - return resp - } - // Choosing to only handle legacy fields in the old API - return &admin20240530.ClusterDescriptionProcessArgs{ - DefaultReadConcern: conversion.NilForUnknown(input.DefaultReadConcern, input.DefaultReadConcern.ValueStringPointer()), - FailIndexKeyTooLong: conversion.NilForUnknown(input.FailIndexKeyTooLong, input.FailIndexKeyTooLong.ValueBoolPointer()), - } +func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs { + return conversion.SingleListTFToSDK(ctx, diags, input, func(tf TFAdvancedConfigurationModel) *admin20240530.ClusterDescriptionProcessArgs { + // Choosing to only handle legacy fields in the old API + return &admin20240530.ClusterDescriptionProcessArgs{ + DefaultReadConcern: conversion.NilForUnknown(tf.DefaultReadConcern, tf.DefaultReadConcern.ValueStringPointer()), + FailIndexKeyTooLong: conversion.NilForUnknown(tf.FailIndexKeyTooLong, tf.FailIndexKeyTooLong.ValueBoolPointer()), + } + }) } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 9142317f62..5ecc041813 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -77,6 +77,7 @@ func (r *rs) Create(ctx context.Context, req resource.CreateRequest, resp *resou } model := r.createCluster(ctx, &plan, diags) if model != nil { + overrideAttributesWithPlanValue(model, &plan) diags.Append(resp.State.Set(ctx, model)...) } } @@ -90,6 +91,7 @@ func (r *rs) Read(ctx context.Context, req resource.ReadRequest, resp *resource. } model := r.readCluster(ctx, diags, &state, &resp.State) if model != nil { + overrideAttributesWithPlanValue(model, &state) diags.Append(resp.State.Set(ctx, model)...) } } @@ -167,6 +169,7 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou } else { modelOut.AdvancedConfiguration = state.AdvancedConfiguration } + overrideAttributesWithPlanValue(modelOut, &plan) diags.Append(resp.State.Set(ctx, modelOut)...) } @@ -464,7 +467,6 @@ func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client * if diags.HasError() { return nil, nil } - overrideAttributesWithPrevStateValue(modelIn, modelOut) return modelOut, extraInfo } diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index ff8a877d55..4f3a2d4841 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -13,7 +13,7 @@ import ( "go.mongodb.org/atlas-sdk/v20241113003/admin" ) -func overrideAttributesWithPrevStateValue(modelIn, modelOut *TFModel) { +func overrideAttributesWithPlanValue(modelOut, modelIn *TFModel) { beforeVersion := conversion.NilForUnknown(modelIn.MongoDBMajorVersion, modelIn.MongoDBMajorVersion.ValueStringPointer()) if beforeVersion != nil && !modelIn.MongoDBMajorVersion.Equal(modelOut.MongoDBMajorVersion) { modelOut.MongoDBMajorVersion = types.StringPointerValue(beforeVersion) @@ -22,6 +22,13 @@ func overrideAttributesWithPrevStateValue(modelIn, modelOut *TFModel) { if retainBackups != nil && !modelIn.RetainBackupsEnabled.Equal(modelOut.RetainBackupsEnabled) { modelOut.RetainBackupsEnabled = types.BoolPointerValue(retainBackups) } + // Blocks can't be included if not in the config + if modelIn.AdvancedConfiguration.IsNull() { + modelOut.AdvancedConfiguration = types.ListNull(AdvancedConfigurationObjType) + } + if modelIn.BiConnectorConfig.IsNull() { + modelOut.BiConnectorConfig = types.ListNull(BiConnectorConfigObjType) + } } func findNumShardsUpdates(ctx context.Context, state, plan *TFModel, diags *diag.Diagnostics) map[string]int64 { diff --git a/internal/service/advancedclustertpf/resource_test_cases_test.go b/internal/service/advancedclustertpf/resource_test_cases_test.go index 335c2793c8..056c352fc2 100644 --- a/internal/service/advancedclustertpf/resource_test_cases_test.go +++ b/internal/service/advancedclustertpf/resource_test_cases_test.go @@ -333,7 +333,7 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { clusterName = acc.RandomClusterName() fullUpdate = ` backup_enabled = true - bi_connector_config = { + bi_connector_config { enabled = true } # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty @@ -354,7 +354,7 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { # termination_protection_enabled = true # must be reset to false to enable delete version_release_system = "CONTINUOUS" - advanced_configuration = { + advanced_configuration { change_stream_options_pre_and_post_images_expire_after_seconds = 100 default_read_concern = "available" default_write_concern = "majority" @@ -385,10 +385,11 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { Config: configBasic(projectID, clusterName, fullUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "mongo_db_major_version", "8.0"), - resource.TestCheckResourceAttr(resourceName, "advanced_configuration.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), ), }, - acc.TestStepImportCluster(resourceName), + // These ignored fields are blocks so can't be included if not in the config + acc.TestStepImportCluster(resourceName, "advanced_configuration", "bi_connector_config"), }, } } diff --git a/internal/service/advancedclustertpf/schema.go b/internal/service/advancedclustertpf/schema.go index f262de0155..ad685e5517 100644 --- a/internal/service/advancedclustertpf/schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -6,6 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" dsschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" @@ -33,23 +34,6 @@ func resourceSchema(ctx context.Context) schema.Schema { Optional: true, MarkdownDescription: "Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses [Cloud Backups](https://docs.atlas.mongodb.com/backup/cloud-backup/overview/) for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups.", }, - "bi_connector_config": schema.SingleNestedAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster.", - Attributes: map[string]schema.Attribute{ - "enabled": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster.", - }, - "read_preference": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes.", - }, - }, - }, "cluster_type": schema.StringAttribute{ Required: true, MarkdownDescription: "Configuration of nodes that comprise the cluster.", @@ -292,7 +276,6 @@ func resourceSchema(ctx context.Context) schema.Schema { Optional: true, MarkdownDescription: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier.", }, - "advanced_configuration": AdvancedConfigurationSchema(ctx), "pinned_fcv": schema.SingleNestedAttribute{ Optional: true, MarkdownDescription: "Pins the Feature Compatibility Version (FCV) to the current MongoDB version with a provided expiration date. To unpin the FCV the `pinned_fcv` attribute must be removed. This operation can take several minutes as the request processes through the MongoDB data plane. Once FCV is unpinned it will not be possible to downgrade the `mongo_db_major_version`. It is advised that updates to `pinned_fcv` are done isolated from other cluster changes. If a plan contains multiple changes, the FCV change will be applied first. If FCV is unpinned past the expiration date the `pinned_fcv` attribute must be removed. The following [knowledge hub article](https://kb.corp.mongodb.com/article/000021785/) and [FCV documentation](https://www.mongodb.com/docs/atlas/tutorial/major-version-change/#manage-feature-compatibility--fcv--during-upgrades) can be referenced for more details.", @@ -314,6 +297,105 @@ func resourceSchema(ctx context.Context) schema.Schema { }), }, Blocks: map[string]schema.Block{ + "advanced_configuration": schema.ListNestedBlock{ + MarkdownDescription: "advanced_configuration", // TODO: add description + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "change_stream_options_pre_and_post_images_expire_after_seconds": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "The minimum pre- and post-image retention time in seconds.", + Default: int64default.StaticInt64(-1), // in case the user removes the value, we should set it to -1, a special value used by the backend to use its default behavior + PlanModifiers: []planmodifier.Int64{ + PlanMustUseMongoDBVersion(7.0, EqualOrHigher), + }, + }, + "default_write_concern": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Default level of acknowledgment requested from MongoDB for write operations when none is specified by the driver.", + }, + "javascript_enabled": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript. When using 8.0+, we recommend disabling server-side JavaScript and using operators of aggregation pipeline as more performant alternative.", + }, + "minimum_enabled_tls_protocol": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version.", + }, + "no_table_scan": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results.", + }, + "oplog_min_retention_hours": schema.Float64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates.", + }, + "oplog_size_mb": schema.Int64Attribute{ + Computed: true, + Optional: true, + Validators: []validator.Int64{ + int64validator.AtLeast(0), + }, + MarkdownDescription: "Storage limit of cluster's oplog expressed in megabytes. A value of null indicates that the cluster uses the default oplog size that MongoDB Cloud calculates.", + }, + "sample_refresh_interval_bi_connector": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Interval in seconds at which the mongosqld process re-samples data to create its relational schema.", + }, + "sample_size_bi_connector": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Number of documents per database to sample when gathering schema information.", + }, + "transaction_lifetime_limit_seconds": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process.", + }, + "default_read_concern": schema.StringAttribute{ + DeprecationMessage: DeprecationMsgOldSchema, + Computed: true, + Optional: true, + MarkdownDescription: "default_read_concern", // TODO: add description + }, + "fail_index_key_too_long": schema.BoolAttribute{ + DeprecationMessage: DeprecationMsgOldSchema, + Computed: true, + Optional: true, + MarkdownDescription: "fail_index_key_too_long", // TODO: add description + }, + }, + }, + }, + "bi_connector_config": schema.ListNestedBlock{ + MarkdownDescription: "Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster.", + Validators: []validator.List{ + listvalidator.SizeAtMost(1), + }, + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "enabled": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster.", + }, + "read_preference": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes.", + }, + }, + }, + }, "labels": schema.SetNestedBlock{ MarkdownDescription: "Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels.\n\nCluster labels are deprecated and will be removed in a future release. We strongly recommend that you use [resource tags](https://dochub.mongodb.org/core/add-cluster-tag-atlas) instead.", NestedObject: schema.NestedBlockObject{ @@ -452,85 +534,6 @@ func SpecsSchema(markdownDescription string) schema.SingleNestedAttribute { } } -func AdvancedConfigurationSchema(ctx context.Context) schema.SingleNestedAttribute { - return schema.SingleNestedAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "advanced_configuration", // TODO: add description - Attributes: map[string]schema.Attribute{ - "change_stream_options_pre_and_post_images_expire_after_seconds": schema.Int64Attribute{ - Optional: true, - Computed: true, - MarkdownDescription: "The minimum pre- and post-image retention time in seconds.", - Default: int64default.StaticInt64(-1), // in case the user removes the value, we should set it to -1, a special value used by the backend to use its default behavior - PlanModifiers: []planmodifier.Int64{ - PlanMustUseMongoDBVersion(7.0, EqualOrHigher), - }, - }, - "default_write_concern": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Default level of acknowledgment requested from MongoDB for write operations when none is specified by the driver.", - }, - "javascript_enabled": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript. When using 8.0+, we recommend disabling server-side JavaScript and using operators of aggregation pipeline as more performant alternative.", - }, - "minimum_enabled_tls_protocol": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version.", - }, - "no_table_scan": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results.", - }, - "oplog_min_retention_hours": schema.Float64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates.", - }, - "oplog_size_mb": schema.Int64Attribute{ - Optional: true, - Computed: true, - Validators: []validator.Int64{ - int64validator.AtLeast(0), - }, - MarkdownDescription: "Storage limit of cluster's oplog expressed in megabytes. A value of null indicates that the cluster uses the default oplog size that MongoDB Cloud calculates.", - }, - "sample_refresh_interval_bi_connector": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Interval in seconds at which the mongosqld process re-samples data to create its relational schema.", - }, - "sample_size_bi_connector": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Number of documents per database to sample when gathering schema information.", - }, - "transaction_lifetime_limit_seconds": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process.", - }, - "default_read_concern": schema.StringAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, - Computed: true, - Optional: true, - MarkdownDescription: "default_read_concern", // TODO: add description - }, - "fail_index_key_too_long": schema.BoolAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, - Computed: true, - Optional: true, - MarkdownDescription: "fail_index_key_too_long", // TODO: add description - }, - }, - } -} - type TFModel struct { DiskSizeGB types.Float64 `tfsdk:"disk_size_gb"` Labels types.Set `tfsdk:"labels"` @@ -549,12 +552,12 @@ type TFModel struct { MongoDBVersion types.String `tfsdk:"mongo_db_version"` Name types.String `tfsdk:"name"` VersionReleaseSystem types.String `tfsdk:"version_release_system"` - BiConnectorConfig types.Object `tfsdk:"bi_connector_config"` + BiConnectorConfig types.List `tfsdk:"bi_connector_config"` ConfigServerType types.String `tfsdk:"config_server_type"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` ClusterType types.String `tfsdk:"cluster_type"` RootCertType types.String `tfsdk:"root_cert_type"` - AdvancedConfiguration types.Object `tfsdk:"advanced_configuration"` + AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` PinnedFCV types.Object `tfsdk:"pinned_fcv"` TerminationProtectionEnabled types.Bool `tfsdk:"termination_protection_enabled"` Paused types.Bool `tfsdk:"paused"` @@ -573,8 +576,8 @@ type TFModelDS struct { Tags types.Set `tfsdk:"tags"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` Name types.String `tfsdk:"name"` - AdvancedConfiguration types.Object `tfsdk:"advanced_configuration"` - BiConnectorConfig types.Object `tfsdk:"bi_connector_config"` + AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` + BiConnectorConfig types.List `tfsdk:"bi_connector_config"` RootCertType types.String `tfsdk:"root_cert_type"` ClusterType types.String `tfsdk:"cluster_type"` MongoDBMajorVersion types.String `tfsdk:"mongo_db_major_version"` diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml index f8b157a51d..48a70895fd 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml @@ -161,7 +161,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2024-10-23' - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" responses: - response_index: 34 status: 200 @@ -169,7 +169,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs method: PATCH version: '2024-08-05' - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" responses: - response_index: 41 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json index f3b9f55a0a..c80592bd94 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json @@ -1,8 +1,7 @@ { "backupEnabled": true, "biConnector": { - "enabled": true, - "readPreference": "secondary" + "enabled": true }, "labels": [ { diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json index 602856e979..fa21da6b1a 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json @@ -1,6 +1,7 @@ { "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": 100, "defaultWriteConcern": "majority", + "javascriptEnabled": true, "minimumEnabledTlsProtocol": "TLS1_0", "noTableScan": true, "sampleRefreshIntervalBIConnector": 310, diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index 3a49779ca5..e458456eb9 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -69,8 +69,6 @@ var tpfSingleNestedAttrs = []string{ "electable_specs", "read_only_specs", "auto_scaling", // includes analytics_auto_scaling - "advanced_configuration", - "bi_connector_config", "pinned_fcv", } @@ -98,8 +96,6 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri } writeBody := resource.Body() convertAttrs(t, "replication_specs", writeBody, true, getReplicationSpecs) - convertAttrs(t, "advanced_configuration", writeBody, false, hcl.GetAttrVal) - convertAttrs(t, "bi_connector_config", writeBody, false, hcl.GetAttrVal) } content := parse.Bytes() return string(content) diff --git a/internal/testutil/acc/advanced_cluster_schema_v2_test.go b/internal/testutil/acc/advanced_cluster_schema_v2_test.go index e5faab26f6..8bdf6d0a60 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2_test.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2_test.go @@ -14,18 +14,18 @@ func TestConvertToSchemaV2AttrsMapAndAttrsSet(t *testing.T) { t.Skip("Skipping test as not in AdvancedClusterV2Schema") } attrsMap := map[string]string{ - "attr": "val1", - "electable_specs.0": "val2", - "prefixbi_connector_config.0": "val3", - "advanced_configuration.0postfix": "val4", - "electable_specs.0advanced_configuration.0bi_connector_config.0": "val5", + "attr": "val1", + "electable_specs.0": "val2", + "prefixauto_scaling.0": "val3", + "electable_specs.0postfix": "val4", + "electable_specs.0auto_scaling.0auto_scaling.0": "val5", } expectedMap := map[string]string{ - "attr": "val1", - "electable_specs": "val2", - "prefixbi_connector_config": "val3", - "advanced_configurationpostfix": "val4", - "electable_specsadvanced_configurationbi_connector_config": "val5", + "attr": "val1", + "electable_specs": "val2", + "prefixauto_scaling": "val3", + "electable_specspostfix": "val4", + "electable_specsauto_scalingauto_scaling": "val5", } actualMap := acc.ConvertToSchemaV2AttrsMap(true, attrsMap) assert.Equal(t, expectedMap, actualMap) @@ -178,7 +178,22 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { value = "Value Label 3" } + advanced_configuration { + fail_index_key_too_long = false + javascript_enabled = true + minimum_enabled_tls_protocol = "TLS1_1" + no_table_scan = false + oplog_size_mb = 1000 + sample_size_bi_connector = 110 + sample_refresh_interval_bi_connector = 310 + transaction_lifetime_limit_seconds = 300 + change_stream_options_pre_and_post_images_expire_after_seconds = 100 + } + bi_connector_config { + enabled = true + read_preference = "secondary" + } replication_specs = [{ region_configs = [{ analytics_specs = { @@ -221,21 +236,6 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { region_name = "EU_WEST_1" }] }] - advanced_configuration = { - change_stream_options_pre_and_post_images_expire_after_seconds = 100 - fail_index_key_too_long = false - javascript_enabled = true - minimum_enabled_tls_protocol = "TLS1_1" - no_table_scan = false - oplog_size_mb = 1000 - sample_refresh_interval_bi_connector = 310 - sample_size_bi_connector = 110 - transaction_lifetime_limit_seconds = 300 - } - bi_connector_config = { - enabled = true - read_preference = "secondary" - } } ` ) From 4ccfae649fddcde0bca84ac8ae0f6c83dac07251 Mon Sep 17 00:00:00 2001 From: maastha <122359335+maastha@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:55:50 +0000 Subject: [PATCH 26/40] feat: Adds support for Customer Cipher Configuration for Data Plane Connections (#2872) --- .changelog/2872.txt | 28 ++ docs/data-sources/advanced_cluster.md | 2 + docs/data-sources/advanced_clusters.md | 2 + docs/data-sources/cluster.md | 2 + docs/data-sources/clusters.md | 2 + docs/resources/advanced_cluster.md | 2 + docs/resources/cluster.md | 2 + .../data_source_advanced_cluster.go | 4 +- .../advancedcluster/model_advanced_cluster.go | 33 +++ .../resource_advanced_cluster.go | 3 +- ...esource_advanced_cluster_migration_test.go | 7 +- .../resource_advanced_cluster_test.go | 61 ++++- internal/service/advancedclustertpf/README.md | 1 + .../service/cluster/data_source_cluster.go | 15 +- .../service/cluster/data_source_clusters.go | 24 +- internal/service/cluster/model_cluster.go | 53 ++-- internal/service/cluster/resource_cluster.go | 40 ++- .../resource_cluster_migration_test.go | 7 +- .../service/cluster/resource_cluster_test.go | 245 ++++++++++++------ 19 files changed, 396 insertions(+), 137 deletions(-) create mode 100644 .changelog/2872.txt diff --git a/.changelog/2872.txt b/.changelog/2872.txt new file mode 100644 index 0000000000..03a0bb670c --- /dev/null +++ b/.changelog/2872.txt @@ -0,0 +1,28 @@ +```release-note:enhancement +resource/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_advanced_clusters: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + +```release-note:enhancement +resource/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute +``` + + + + + diff --git a/docs/data-sources/advanced_cluster.md b/docs/data-sources/advanced_cluster.md index bfce0ff9c2..2b0112229b 100644 --- a/docs/data-sources/advanced_cluster.md +++ b/docs/data-sources/advanced_cluster.md @@ -205,6 +205,8 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `transaction_lifetime_limit_seconds` - Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds. * `default_max_time_ms` - Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off). +* `tls_cipher_config_mode` - The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. +* `custom_openssl_cipher_config_tls12` - The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### pinned_fcv diff --git a/docs/data-sources/advanced_clusters.md b/docs/data-sources/advanced_clusters.md index 2759de71a8..1e8e043d7f 100644 --- a/docs/data-sources/advanced_clusters.md +++ b/docs/data-sources/advanced_clusters.md @@ -208,6 +208,8 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `default_max_time_ms` - Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above. * `transaction_lifetime_limit_seconds` - (Optional) Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off). +* `tls_cipher_config_mode` - The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. +* `custom_openssl_cipher_config_tls12` - The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### pinned_fcv diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md index 0541f0df68..c5a40a4ce2 100644 --- a/docs/data-sources/cluster.md +++ b/docs/data-sources/cluster.md @@ -233,6 +233,8 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `sample_refresh_interval_bi_connector` - Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled. * `transaction_lifetime_limit_seconds` - Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off). +* `tls_cipher_config_mode` - The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. +* `custom_openssl_cipher_config_tls12` - The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### Pinned FCV diff --git a/docs/data-sources/clusters.md b/docs/data-sources/clusters.md index 73d2485726..dec627cfb2 100644 --- a/docs/data-sources/clusters.md +++ b/docs/data-sources/clusters.md @@ -220,6 +220,8 @@ Contains a key-value pair that tags that the cluster was created by a Terraform * `sample_size_bi_connector` - Number of documents per database to sample when gathering schema information. Defaults to 100. Available only for Atlas deployments in which BI Connector for Atlas is enabled. * `sample_refresh_interval_bi_connector` - Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off). +* `tls_cipher_config_mode` - The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. +* `custom_openssl_cipher_config_tls12` - The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### Pinned FCV diff --git a/docs/resources/advanced_cluster.md b/docs/resources/advanced_cluster.md index 03cbee9022..03a065ba21 100644 --- a/docs/resources/advanced_cluster.md +++ b/docs/resources/advanced_cluster.md @@ -464,6 +464,8 @@ Include **desired options** within advanced_configuration: * `transaction_lifetime_limit_seconds` - (Optional) Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This option corresponds to the `changeStreamOptions.preAndPostImages.expireAfterSeconds` cluster parameter. Defaults to `-1`(off). This setting controls the retention policy of change stream pre- and post-images. Pre- and post-images are the versions of a document before and after document modification, respectively. `expireAfterSeconds` controls how long MongoDB retains pre- and post-images. When set to -1 (off), MongoDB uses the default retention policy: pre- and post-images are retained until the corresponding change stream events are removed from the oplog. To set the minimum pre- and post-image retention time, specify an integer value greater than zero. Setting this too low could increase the risk of interrupting Realm sync or triggers processing. This parameter is only supported for MongoDB version 6.0 and above. * `default_max_time_ms` - (Optional) Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above. +* `tls_cipher_config_mode` - (Optional) The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. To unset, this should be set back to `DEFAULT`. +* `custom_openssl_cipher_config_tls12` - (Optional) The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### Tags diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 801792475d..e2ec8f8104 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -486,6 +486,8 @@ Include **desired options** within advanced_configuration: * `sample_refresh_interval_bi_connector` - (Optional) Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled. * `transaction_lifetime_limit_seconds` - (Optional) Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds. * `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This option corresponds to the `changeStreamOptions.preAndPostImages.expireAfterSeconds` cluster parameter. Defaults to `-1`(off). This setting controls the retention policy of change stream pre- and post-images. Pre- and post-images are the versions of a document before and after document modification, respectively.`expireAfterSeconds` controls how long MongoDB retains pre- and post-images. When set to -1 (off), MongoDB uses the default retention policy: pre- and post-images are retained until the corresponding change stream events are removed from the oplog. To set the minimum pre- and post-image retention time, specify an integer value greater than zero. Setting this too low could increase the risk of interrupting Realm sync or triggers processing. This parameter is only supported for MongoDB version 6.0 and above. +* `tls_cipher_config_mode` - (Optional) The TLS cipher suite configuration mode. Valid values include `CUSTOM` or `DEFAULT`. The `DEFAULT` mode uses the default cipher suites. The `CUSTOM` mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. To unset, this should be set back to `DEFAULT`. +* `custom_openssl_cipher_config_tls12` - (Optional) The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tls_cipher_config_mode` is set to `CUSTOM`. ### Tags diff --git a/internal/service/advancedcluster/data_source_advanced_cluster.go b/internal/service/advancedcluster/data_source_advanced_cluster.go index 5299c62603..ece283b448 100644 --- a/internal/service/advancedcluster/data_source_advanced_cluster.go +++ b/internal/service/advancedcluster/data_source_advanced_cluster.go @@ -332,11 +332,11 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag. processArgs20240530, _, err := connV220240530.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(ErrorAdvancedConfRead, clusterName, err)) + return diag.FromErr(fmt.Errorf(ErrorAdvancedConfRead, V20240530, clusterName, err)) } processArgs, _, err := connV2.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(ErrorAdvancedConfRead, clusterName, err)) + return diag.FromErr(fmt.Errorf(ErrorAdvancedConfRead, "", clusterName, err)) } if err := d.Set("advanced_configuration", flattenProcessArgs(processArgs20240530, processArgs)); err != nil { diff --git a/internal/service/advancedcluster/model_advanced_cluster.go b/internal/service/advancedcluster/model_advanced_cluster.go index 6df4762d09..716f723e7d 100644 --- a/internal/service/advancedcluster/model_advanced_cluster.go +++ b/internal/service/advancedcluster/model_advanced_cluster.go @@ -126,6 +126,17 @@ func SchemaAdvancedConfigDS() *schema.Schema { Type: schema.TypeInt, Computed: true, }, + "tls_cipher_config_mode": { + Type: schema.TypeString, + Computed: true, + }, + "custom_openssl_cipher_config_tls12": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, }, }, } @@ -275,6 +286,18 @@ func SchemaAdvancedConfig() *schema.Schema { Type: schema.TypeInt, Optional: true, }, + "custom_openssl_cipher_config_tls12": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "tls_cipher_config_mode": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, }, }, } @@ -538,6 +561,8 @@ func flattenProcessArgs(p20240530 *admin20240530.ClusterDescriptionProcessArgs, if v := p.DefaultMaxTimeMS; v != nil { flattenedProcessArgs[0]["default_max_time_ms"] = p.GetDefaultMaxTimeMS() } + flattenedProcessArgs[0]["tls_cipher_config_mode"] = p.GetTlsCipherConfigMode() + flattenedProcessArgs[0]["custom_openssl_cipher_config_tls12"] = p.GetCustomOpensslCipherConfigTls12() } return flattenedProcessArgs @@ -912,6 +937,14 @@ func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVer } } + if _, ok := d.GetOkExists("advanced_configuration.0.tls_cipher_config_mode"); ok { + res.TlsCipherConfigMode = conversion.StringPtr(cast.ToString(p["tls_cipher_config_mode"])) + } + + if _, ok := d.GetOkExists("advanced_configuration.0.custom_openssl_cipher_config_tls12"); ok { + tmp := conversion.ExpandStringListFromSetSchema(d.Get("advanced_configuration.0.custom_openssl_cipher_config_tls12").(*schema.Set)) + res.CustomOpensslCipherConfigTls12 = &tmp + } return res20240530, res } diff --git a/internal/service/advancedcluster/resource_advanced_cluster.go b/internal/service/advancedcluster/resource_advanced_cluster.go index d8f2012472..94acd87062 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster.go +++ b/internal/service/advancedcluster/resource_advanced_cluster.go @@ -36,13 +36,14 @@ const ( errorConfigUpdate = "error updating advanced cluster configuration options (%s): %s" errorConfigRead = "error reading advanced cluster configuration options (%s): %s" ErrorClusterSetting = "error setting `%s` for MongoDB Cluster (%s): %s" - ErrorAdvancedConfRead = "error reading Advanced Configuration Option form MongoDB Cluster (%s): %s" + ErrorAdvancedConfRead = "error reading Advanced Configuration Option %s for MongoDB Cluster (%s): %s" ErrorClusterAdvancedSetting = "error setting `%s` for MongoDB ClusterAdvanced (%s): %s" ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" ErrorOperationNotPermitted = "error operation not permitted" ErrorDefaultMaxTimeMinVersion = "default_max_time_ms can not be set for mongo_db_major_version lower than 8.0" ignoreLabel = "Infrastructure Tool" DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details at https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown" + V20240530 = "(v20240530)" ) var DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go index 1afd90eee2..353ac866c0 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go @@ -150,7 +150,7 @@ func TestMigAdvancedCluster_geoShardedMigrationFromOldToNewSchema(t *testing.T) func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { acc.SkipIfAdvancedClusterV2Schema(t) // This test is specific to the legacy schema - mig.SkipIfVersionBelow(t, "1.22.1") // version where default_max_time_ms was introduced + mig.SkipIfVersionBelow(t, "1.24.0") // version where tls_cipher_config_mode was introduced var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -182,6 +182,8 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { sample_size_bi_connector = 110 sample_refresh_interval_bi_connector = 310 default_max_time_ms = 65 + tls_cipher_config_mode = "CUSTOM" + custom_openssl_cipher_config_tls12 = ["TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"] } bi_connector_config { @@ -206,6 +208,7 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.minimum_enabled_tls_protocol", "TLS1_1"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.no_table_scan", "false"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.oplog_min_retention_hours", "4"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "DEFAULT"), resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.enabled", "true"), ), }, @@ -222,6 +225,8 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.default_max_time_ms", "65"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "CUSTOM"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "2"), resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.enabled", "false"), resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.read_preference", "secondary"), ), diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 5b38fbc935..50bd102879 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -7,6 +7,7 @@ import ( "os" "regexp" "strconv" + "strings" "testing" "time" @@ -289,6 +290,11 @@ func TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion(t *testing.T ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.IntPtr(-1), // this will not be set in the TF configuration DefaultMaxTimeMS: conversion.IntPtr(65), } + + processArgsCipherConfig = &admin.ClusterDescriptionProcessArgs20240805{ + TlsCipherConfigMode: conversion.StringPtr("CUSTOM"), + CustomOpensslCipherConfigTls12: &[]string{"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"}, + } ) resource.ParallelTest(t, resource.TestCase{ @@ -301,8 +307,8 @@ func TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion(t *testing.T ExpectError: regexp.MustCompile(advancedcluster.ErrorDefaultMaxTimeMinVersion), }, { - Config: configAdvanced(t, true, projectID, clusterName, "6.0", processArgs20240530, &admin.ClusterDescriptionProcessArgs20240805{}), - Check: checkAdvanced(true, clusterName, "TLS1_1", &admin.ClusterDescriptionProcessArgs20240805{}), + Config: configAdvanced(t, true, projectID, clusterName, "6.0", processArgs20240530, processArgsCipherConfig), + Check: checkAdvanced(true, clusterName, "TLS1_1", processArgsCipherConfig), }, }, }) @@ -328,6 +334,7 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) { } processArgs = &admin.ClusterDescriptionProcessArgs20240805{ ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.IntPtr(-1), // this will not be set in the TF configuration + TlsCipherConfigMode: conversion.StringPtr("DEFAULT"), } processArgs20240530Updated = &admin20240530.ClusterDescriptionProcessArgs{ @@ -345,6 +352,13 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) { processArgsUpdated = &admin.ClusterDescriptionProcessArgs20240805{ DefaultMaxTimeMS: conversion.IntPtr(65), ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.IntPtr(100), + TlsCipherConfigMode: conversion.StringPtr("CUSTOM"), + CustomOpensslCipherConfigTls12: &[]string{"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"}, + } + processArgsUpdatedCipherConfig = &admin.ClusterDescriptionProcessArgs20240805{ + DefaultMaxTimeMS: conversion.IntPtr(65), + ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.IntPtr(100), + TlsCipherConfigMode: conversion.StringPtr("DEFAULT"), // To unset TlsCipherConfigMode, user needs to set this to DEFAULT } ) @@ -361,11 +375,16 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) { Config: configAdvanced(t, true, projectID, clusterNameUpdated, "", processArgs20240530Updated, processArgsUpdated), Check: checkAdvanced(true, clusterNameUpdated, "TLS1_2", processArgsUpdated), }, + { + Config: configAdvanced(t, true, projectID, clusterNameUpdated, "", processArgs20240530Updated, processArgsUpdatedCipherConfig), + Check: checkAdvanced(true, clusterNameUpdated, "TLS1_2", processArgsUpdatedCipherConfig), + }, }, }) } func TestAccClusterAdvancedCluster_defaultWrite(t *testing.T) { + acc.SkipIfAdvancedClusterV2Schema(t) // TODO: tls_cipher_config_mode not implemented in TPF yet var ( projectID = acc.ProjectIDExecution(t) clusterName = acc.RandomClusterName() @@ -1566,20 +1585,32 @@ func checkSingleProviderPaused(isAcc bool, name string, paused bool) resource.Te func configAdvanced(t *testing.T, isAcc bool, projectID, clusterName, mongoDBMajorVersion string, p20240530 *admin20240530.ClusterDescriptionProcessArgs, p *admin.ClusterDescriptionProcessArgs20240805) string { t.Helper() - changeStreamOptionsString := "" - defaultMaxTimeString := "" - mongoDBMajorVersionString := "" + changeStreamOptionsStr := "" + defaultMaxTimeStr := "" + tlsCipherConfigModeStr := "" + customOpensslCipherConfigTLS12Str := "" + mongoDBMajorVersionStr := "" if p != nil { if p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds != nil && p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds != conversion.IntPtr(-1) { - changeStreamOptionsString = fmt.Sprintf(`change_stream_options_pre_and_post_images_expire_after_seconds = %[1]d`, *p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds) + changeStreamOptionsStr = fmt.Sprintf(`change_stream_options_pre_and_post_images_expire_after_seconds = %[1]d`, *p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds) } if p.DefaultMaxTimeMS != nil { - defaultMaxTimeString = fmt.Sprintf(`default_max_time_ms = %[1]d`, *p.DefaultMaxTimeMS) + defaultMaxTimeStr = fmt.Sprintf(`default_max_time_ms = %[1]d`, *p.DefaultMaxTimeMS) + } + if p.TlsCipherConfigMode != nil { + tlsCipherConfigModeStr = fmt.Sprintf(`tls_cipher_config_mode = %[1]q`, *p.TlsCipherConfigMode) + if p.CustomOpensslCipherConfigTls12 != nil && len(*p.CustomOpensslCipherConfigTls12) > 0 { + //nolint:gocritic // reason: simplifying string array construction + customOpensslCipherConfigTLS12Str = fmt.Sprintf( + `custom_openssl_cipher_config_tls12 = ["%s"]`, + strings.Join(*p.CustomOpensslCipherConfigTls12, `", "`), + ) + } } } if mongoDBMajorVersion != "" { - mongoDBMajorVersionString = fmt.Sprintf(`mongo_db_major_version = %[1]q`, mongoDBMajorVersion) + mongoDBMajorVersionStr = fmt.Sprintf(`mongo_db_major_version = %[1]q`, mongoDBMajorVersion) } return acc.ConvertAdvancedClusterToSchemaV2(t, isAcc, fmt.Sprintf(` @@ -1616,6 +1647,8 @@ func configAdvanced(t *testing.T, isAcc bool, projectID, clusterName, mongoDBMaj transaction_lifetime_limit_seconds = %[10]d %[11]s %[12]s + %[14]s + %[15]s } } @@ -1630,7 +1663,7 @@ func configAdvanced(t *testing.T, isAcc bool, projectID, clusterName, mongoDBMaj `, projectID, clusterName, p20240530.GetFailIndexKeyTooLong(), p20240530.GetJavascriptEnabled(), p20240530.GetMinimumEnabledTlsProtocol(), p20240530.GetNoTableScan(), p20240530.GetOplogSizeMB(), p20240530.GetSampleSizeBIConnector(), p20240530.GetSampleRefreshIntervalBIConnector(), p20240530.GetTransactionLifetimeLimitSeconds(), - changeStreamOptionsString, defaultMaxTimeString, mongoDBMajorVersionString)) + changeStreamOptionsStr, defaultMaxTimeStr, mongoDBMajorVersionStr, tlsCipherConfigModeStr, customOpensslCipherConfigTLS12Str)) } func checkAdvanced(isAcc bool, name, tls string, processArgs *admin.ClusterDescriptionProcessArgs20240805) resource.TestCheckFunc { @@ -1654,6 +1687,13 @@ func checkAdvanced(isAcc bool, name, tls string, processArgs *admin.ClusterDescr advancedConfig["advanced_configuration.0.default_max_time_ms"] = strconv.Itoa(*processArgs.DefaultMaxTimeMS) } + if processArgs.TlsCipherConfigMode != nil && processArgs.CustomOpensslCipherConfigTls12 != nil { + advancedConfig["advanced_configuration.0.tls_cipher_config_mode"] = "CUSTOM" + advancedConfig["advanced_configuration.0.custom_openssl_cipher_config_tls12.#"] = strconv.Itoa(len(*processArgs.CustomOpensslCipherConfigTls12)) + } else { + advancedConfig["advanced_configuration.0.tls_cipher_config_mode"] = "DEFAULT" + } + pluralChecks := []resource.TestCheckFunc{ acc.TestCheckResourceAttrSetSchemaV2(isAcc, dataSourcePluralName, "results.#"), acc.TestCheckResourceAttrSetSchemaV2(isAcc, dataSourcePluralName, "results.0.replication_specs.#"), @@ -1733,7 +1773,8 @@ func checkAdvancedDefaultWrite(isAcc bool, name, writeConcern, tls string) resou "advanced_configuration.0.no_table_scan": "false", "advanced_configuration.0.oplog_size_mb": "1000", "advanced_configuration.0.sample_refresh_interval_bi_connector": "310", - "advanced_configuration.0.sample_size_bi_connector": "110"}, + "advanced_configuration.0.sample_size_bi_connector": "110", + "advanced_configuration.0.tls_cipher_config_mode": "DEFAULT"}, pluralChecks...) } diff --git a/internal/service/advancedclustertpf/README.md b/internal/service/advancedclustertpf/README.md index c94fe622b0..5e825c0252 100644 --- a/internal/service/advancedclustertpf/README.md +++ b/internal/service/advancedclustertpf/README.md @@ -9,4 +9,5 @@ This package contains the WIP for `mongodbatlas_advanced_cluster` in TPF. Curren - [PR #2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825) Add new `advanced_configuration.0.default_max_time_ms` attribute to mongodbatlas_advanced_cluster resource and data sources. - feat: Ensures asymmetric auto-scaling is not defined in the cluster when using the old sharding configuration in mongodbatlas_advanced_cluster (https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2836) - `pinned_fcv` attribute was a recently added attribute in `advanced_cluster`. It has been defined in the new tpf schema but we need to make sure that the implementation is also present. +- [PR #2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872) Adds support for Customer Cipher Configuration for Data Plane Connections. diff --git a/internal/service/cluster/data_source_cluster.go b/internal/service/cluster/data_source_cluster.go index 6f92f4101d..505b671791 100644 --- a/internal/service/cluster/data_source_cluster.go +++ b/internal/service/cluster/data_source_cluster.go @@ -5,11 +5,13 @@ import ( "fmt" "net/http" + matlas "go.mongodb.org/atlas/mongodbatlas" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" - matlas "go.mongodb.org/atlas/mongodbatlas" ) func DataSource() *schema.Resource { @@ -342,6 +344,7 @@ func DataSource() *schema.Resource { func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { conn := meta.(*config.MongoDBClient).Atlas connV2 := meta.(*config.MongoDBClient).AtlasV2 + connV220240530 := meta.(*config.MongoDBClient).AtlasV220240530 projectID := d.Get("project_id").(string) clusterName := d.Get("name").(string) @@ -484,12 +487,16 @@ func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag. /* Get the advaced configuration options and set up to the terraform state */ - processArgs, _, err := conn.Clusters.GetProcessArgs(ctx, projectID, clusterName) + processArgs20240530, _, err := connV220240530.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, advancedcluster.V20240530, clusterName, err)) + } + processArgs, _, err := connV2.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, clusterName, err)) + return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, "", clusterName, err)) } - if err := d.Set("advanced_configuration", flattenProcessArgs(processArgs)); err != nil { + if err := d.Set("advanced_configuration", flattenProcessArgs(processArgs20240530, processArgs)); err != nil { return diag.FromErr(fmt.Errorf(advancedcluster.ErrorClusterSetting, "advanced_configuration", clusterName, err)) } diff --git a/internal/service/cluster/data_source_clusters.go b/internal/service/cluster/data_source_clusters.go index 32b376c92c..2b82d425cf 100644 --- a/internal/service/cluster/data_source_clusters.go +++ b/internal/service/cluster/data_source_clusters.go @@ -6,13 +6,16 @@ import ( "log" "net/http" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" + "go.mongodb.org/atlas-sdk/v20241113003/admin" + matlas "go.mongodb.org/atlas/mongodbatlas" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" - "go.mongodb.org/atlas-sdk/v20241113003/admin" - matlas "go.mongodb.org/atlas/mongodbatlas" ) func PluralDataSource() *schema.Resource { @@ -349,6 +352,7 @@ func PluralDataSource() *schema.Resource { func dataSourcePluralRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { conn := meta.(*config.MongoDBClient).Atlas connV2 := meta.(*config.MongoDBClient).AtlasV2 + connV220240530 := meta.(*config.MongoDBClient).AtlasV220240530 projectID := d.Get("project_id").(string) d.SetId(id.UniqueId()) @@ -368,14 +372,14 @@ func dataSourcePluralRead(ctx context.Context, d *schema.ResourceData, meta any) return diag.FromErr(fmt.Errorf("error reading new cluster list for project(%s): %s", projectID, err)) } - if err := d.Set("results", flattenClusters(ctx, d, conn, clusters, latestClusterModels)); err != nil { + if err := d.Set("results", flattenClusters(ctx, d, conn, connV2, connV220240530, clusters, latestClusterModels)); err != nil { return diag.FromErr(fmt.Errorf(advancedcluster.ErrorClusterSetting, "results", d.Id(), err)) } return nil } -func flattenClusters(ctx context.Context, d *schema.ResourceData, conn *matlas.Client, clusters []matlas.Cluster, latestClusterModels map[string]*admin.ClusterDescription20240805) []map[string]any { +func flattenClusters(ctx context.Context, d *schema.ResourceData, conn *matlas.Client, connV2 *admin.APIClient, connV220240530 *admin20240530.APIClient, clusters []matlas.Cluster, latestClusterModels map[string]*admin.ClusterDescription20240805) []map[string]any { results := make([]map[string]any, 0) for i := range clusters { @@ -384,8 +388,14 @@ func flattenClusters(ctx context.Context, d *schema.ResourceData, conn *matlas.C log.Printf("[WARN] Error setting `snapshot_backup_policy` for the cluster(%s): %s", clusters[i].ID, err) } - processArgs, _, err := conn.Clusters.GetProcessArgs(ctx, clusters[i].GroupID, clusters[i].Name) - log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", clusters[i].ID, err) + processArgs20240530, _, err := connV220240530.ClustersApi.GetClusterAdvancedConfiguration(ctx, clusters[i].GroupID, clusters[i].Name).Execute() + if err != nil { + log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", clusters[i].ID, err) + } + processArgs, _, err := connV2.ClustersApi.GetClusterAdvancedConfiguration(ctx, clusters[i].GroupID, clusters[i].Name).Execute() + if err != nil { + log.Printf("[WARN] Error setting `advanced_configuration` for the cluster(%s): %s", clusters[i].ID, err) + } var containerID string if clusters[i].ProviderSettings != nil && clusters[i].ProviderSettings.ProviderName != "TENANT" { @@ -398,7 +408,7 @@ func flattenClusters(ctx context.Context, d *schema.ResourceData, conn *matlas.C containerID = getContainerID(containers, &clusters[i]) } result := map[string]any{ - "advanced_configuration": flattenProcessArgs(processArgs), + "advanced_configuration": flattenProcessArgs(processArgs20240530, processArgs), "auto_scaling_compute_enabled": clusters[i].AutoScaling.Compute.Enabled, "auto_scaling_compute_scale_down_enabled": clusters[i].AutoScaling.Compute.ScaleDownEnabled, "auto_scaling_disk_gb_enabled": clusters[i].AutoScaling.DiskGBEnabled, diff --git a/internal/service/cluster/model_cluster.go b/internal/service/cluster/model_cluster.go index 4de94ac8ab..381ad8492c 100644 --- a/internal/service/cluster/model_cluster.go +++ b/internal/service/cluster/model_cluster.go @@ -8,6 +8,8 @@ import ( "reflect" "strings" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" + "go.mongodb.org/atlas-sdk/v20241113003/admin" matlas "go.mongodb.org/atlas/mongodbatlas" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -71,27 +73,32 @@ func flattenPolicyItems(items []matlas.PolicyItem) []map[string]any { return policyItems } -func flattenProcessArgs(p *matlas.ProcessArgs) []map[string]any { +func flattenProcessArgs(p20240530 *admin20240530.ClusterDescriptionProcessArgs, p *admin.ClusterDescriptionProcessArgs20240805) []map[string]any { flattenedProcessArgs := []map[string]any{ { - "default_read_concern": p.DefaultReadConcern, + // default_read_concern and fail_index_key_too_long have been deprecated, hence using the older SDK + "default_read_concern": p20240530.DefaultReadConcern, + "fail_index_key_too_long": cast.ToBool(p20240530.FailIndexKeyTooLong), "default_write_concern": p.DefaultWriteConcern, - "fail_index_key_too_long": cast.ToBool(p.FailIndexKeyTooLong), "javascript_enabled": cast.ToBool(p.JavascriptEnabled), - "minimum_enabled_tls_protocol": p.MinimumEnabledTLSProtocol, + "minimum_enabled_tls_protocol": p.MinimumEnabledTlsProtocol, "no_table_scan": cast.ToBool(p.NoTableScan), "oplog_size_mb": p.OplogSizeMB, "oplog_min_retention_hours": p.OplogMinRetentionHours, "sample_size_bi_connector": p.SampleSizeBIConnector, "sample_refresh_interval_bi_connector": p.SampleRefreshIntervalBIConnector, "transaction_lifetime_limit_seconds": p.TransactionLifetimeLimitSeconds, + "tls_cipher_config_mode": p.TlsCipherConfigMode, + "custom_openssl_cipher_config_tls12": p.GetCustomOpensslCipherConfigTls12(), }, } + if p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds != nil { flattenedProcessArgs[0]["change_stream_options_pre_and_post_images_expire_after_seconds"] = p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds } else { flattenedProcessArgs[0]["change_stream_options_pre_and_post_images_expire_after_seconds"] = -1 // default in schema, otherwise user gets drift detection } + return flattenedProcessArgs } @@ -221,19 +228,20 @@ func expandTagSliceFromSetSchema(d *schema.ResourceData) []*matlas.Tag { return res } -func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVersion *string) *matlas.ProcessArgs { - res := &matlas.ProcessArgs{} +func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVersion *string) (admin20240530.ClusterDescriptionProcessArgs, admin.ClusterDescriptionProcessArgs20240805) { + res20240530 := admin20240530.ClusterDescriptionProcessArgs{} + res := admin.ClusterDescriptionProcessArgs20240805{} + // default_read_concern and fail_index_key_too_long have been deprecated, hence using the older SDK if _, ok := d.GetOkExists("advanced_configuration.0.default_read_concern"); ok { - res.DefaultReadConcern = cast.ToString(p["default_read_concern"]) + res20240530.DefaultReadConcern = conversion.StringPtr(cast.ToString(p["default_read_concern"])) } - - if _, ok := d.GetOkExists("advanced_configuration.0.default_write_concern"); ok { - res.DefaultWriteConcern = cast.ToString(p["default_write_concern"]) + if _, ok := d.GetOkExists("advanced_configuration.0.fail_index_key_too_long"); ok { + res20240530.FailIndexKeyTooLong = conversion.Pointer(cast.ToBool(p["fail_index_key_too_long"])) } - if _, ok := d.GetOkExists("advanced_configuration.0.fail_index_key_too_long"); ok { - res.FailIndexKeyTooLong = conversion.Pointer(cast.ToBool(p["fail_index_key_too_long"])) + if _, ok := d.GetOkExists("advanced_configuration.0.default_write_concern"); ok { + res.DefaultWriteConcern = conversion.StringPtr(cast.ToString(p["default_write_concern"])) } if _, ok := d.GetOkExists("advanced_configuration.0.javascript_enabled"); ok { @@ -241,7 +249,7 @@ func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVer } if _, ok := d.GetOkExists("advanced_configuration.0.minimum_enabled_tls_protocol"); ok { - res.MinimumEnabledTLSProtocol = cast.ToString(p["minimum_enabled_tls_protocol"]) + res.MinimumEnabledTlsProtocol = conversion.StringPtr(cast.ToString(p["minimum_enabled_tls_protocol"])) } if _, ok := d.GetOkExists("advanced_configuration.0.no_table_scan"); ok { @@ -249,16 +257,16 @@ func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVer } if _, ok := d.GetOkExists("advanced_configuration.0.sample_size_bi_connector"); ok { - res.SampleSizeBIConnector = conversion.Pointer(cast.ToInt64(p["sample_size_bi_connector"])) + res.SampleSizeBIConnector = conversion.Pointer(cast.ToInt(p["sample_size_bi_connector"])) } if _, ok := d.GetOkExists("advanced_configuration.0.sample_refresh_interval_bi_connector"); ok { - res.SampleRefreshIntervalBIConnector = conversion.Pointer(cast.ToInt64(p["sample_refresh_interval_bi_connector"])) + res.SampleRefreshIntervalBIConnector = conversion.Pointer(cast.ToInt(p["sample_refresh_interval_bi_connector"])) } if _, ok := d.GetOkExists("advanced_configuration.0.oplog_size_mb"); ok { if sizeMB := cast.ToInt64(p["oplog_size_mb"]); sizeMB != 0 { - res.OplogSizeMB = conversion.Pointer(cast.ToInt64(p["oplog_size_mb"])) + res.OplogSizeMB = conversion.Pointer(cast.ToInt(p["oplog_size_mb"])) } else { log.Printf(advancedcluster.ErrorClusterSetting, `oplog_size_mb`, "", cast.ToString(sizeMB)) } @@ -281,10 +289,19 @@ func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVer } if _, ok := d.GetOkExists("advanced_configuration.0.change_stream_options_pre_and_post_images_expire_after_seconds"); ok && advancedcluster.IsChangeStreamOptionsMinRequiredMajorVersion(mongodbMajorVersion) { - res.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds = conversion.Pointer(cast.ToInt64(p["change_stream_options_pre_and_post_images_expire_after_seconds"])) + res.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds = conversion.Pointer(cast.ToInt(p["change_stream_options_pre_and_post_images_expire_after_seconds"])) } - return res + if _, ok := d.GetOkExists("advanced_configuration.0.tls_cipher_config_mode"); ok { + res.TlsCipherConfigMode = conversion.StringPtr(cast.ToString(p["tls_cipher_config_mode"])) + } + + if _, ok := d.GetOkExists("advanced_configuration.0.custom_openssl_cipher_config_tls12"); ok { + tmp := conversion.ExpandStringListFromSetSchema(d.Get("advanced_configuration.0.custom_openssl_cipher_config_tls12").(*schema.Set)) + res.CustomOpensslCipherConfigTls12 = &tmp + } + + return res20240530, res } func expandLabelSliceFromSetSchema(d *schema.ResourceData) []matlas.Label { diff --git a/internal/service/cluster/resource_cluster.go b/internal/service/cluster/resource_cluster.go index d6b527b20a..5384b6d95f 100644 --- a/internal/service/cluster/resource_cluster.go +++ b/internal/service/cluster/resource_cluster.go @@ -11,6 +11,7 @@ import ( "regexp" "time" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" "go.mongodb.org/atlas-sdk/v20241113003/admin" matlas "go.mongodb.org/atlas/mongodbatlas" @@ -31,7 +32,7 @@ const ( errorClusterRead = "error reading MongoDB Cluster (%s): %s" errorClusterDelete = "error deleting MongoDB Cluster (%s): %s" errorClusterUpdate = "error updating MongoDB Cluster (%s): %s" - errorAdvancedConfUpdate = "error updating Advanced Configuration Option form MongoDB Cluster (%s): %s" + errorAdvancedConfUpdate = "error updating Advanced Configuration Option %s for MongoDB Cluster (%s): %s" ErrorSnapshotBackupPolicyRead = "error getting a Cloud Provider Snapshot Backup Policy for the cluster(%s): %s" ) @@ -391,6 +392,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. var ( conn = meta.(*config.MongoDBClient).Atlas connV2 = meta.(*config.MongoDBClient).AtlasV2 + connV220240530 = meta.(*config.MongoDBClient).AtlasV220240530 connV220240805 = meta.(*config.MongoDBClient).AtlasV220240805 projectID = d.Get("project_id").(string) clusterName = d.Get("name").(string) @@ -572,12 +574,16 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. */ ac, ok := d.GetOk("advanced_configuration") if aclist, ok1 := ac.([]any); ok1 && len(aclist) > 0 { - advancedConfReq := expandProcessArgs(d, aclist[0].(map[string]any), &clusterRequest.MongoDBMajorVersion) + params20240530, params := expandProcessArgs(d, aclist[0].(map[string]any), &clusterRequest.MongoDBMajorVersion) if ok { - _, _, err := conn.Clusters.UpdateProcessArgs(ctx, projectID, cluster.Name, advancedConfReq) + _, _, err = connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.Name, ¶ms20240530).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, cluster.Name, err)) + return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, advancedcluster.V20240530, cluster.Name, err)) + } + _, _, err = connV2.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.Name, ¶ms).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, "", cluster.Name, err)) } } } @@ -622,6 +628,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag. func resourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics { conn := meta.(*config.MongoDBClient).Atlas connV2 := meta.(*config.MongoDBClient).AtlasV2 + connV220240530 := meta.(*config.MongoDBClient).AtlasV220240530 ids := conversion.DecodeStateID(d.Id()) projectID := ids["project_id"] clusterName := ids["cluster_name"] @@ -779,12 +786,16 @@ func resourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Di /* Get the advaced configuration options and set up to the terraform state */ - processArgs, _, err := conn.Clusters.GetProcessArgs(ctx, projectID, clusterName) + processArgs20240530, _, err := connV220240530.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, advancedcluster.V20240530, clusterName, err)) + } + processArgs, _, err := connV2.ClustersApi.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, clusterName, err)) + return diag.FromErr(fmt.Errorf(advancedcluster.ErrorAdvancedConfRead, "", clusterName, err)) } - if err := d.Set("advanced_configuration", flattenProcessArgs(processArgs)); err != nil { + if err := d.Set("advanced_configuration", flattenProcessArgs(processArgs20240530, processArgs)); err != nil { return diag.FromErr(fmt.Errorf(advancedcluster.ErrorClusterSetting, "advanced_configuration", clusterName, err)) } @@ -824,6 +835,7 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. conn = meta.(*config.MongoDBClient).Atlas connV2 = meta.(*config.MongoDBClient).AtlasV2 connV220240805 = meta.(*config.MongoDBClient).AtlasV220240805 + connV220240530 = meta.(*config.MongoDBClient).AtlasV220240530 ids = conversion.DecodeStateID(d.Id()) projectID = ids["project_id"] clusterName = ids["cluster_name"] @@ -982,11 +994,17 @@ func resourceUpdate(ctx context.Context, d *schema.ResourceData, meta any) diag. ac := d.Get("advanced_configuration") if aclist, ok1 := ac.([]any); ok1 && len(aclist) > 0 { - advancedConfReq := expandProcessArgs(d, aclist[0].(map[string]any), &mongoDBMajorVersion) - if !reflect.DeepEqual(advancedConfReq, matlas.ProcessArgs{}) { - _, _, err := conn.Clusters.UpdateProcessArgs(ctx, projectID, clusterName, advancedConfReq) + params20240530, params := expandProcessArgs(d, aclist[0].(map[string]any), &mongoDBMajorVersion) + if !reflect.DeepEqual(params20240530, admin20240530.ClusterDescriptionProcessArgs{}) { + _, _, err := connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, ¶ms20240530).Execute() + if err != nil { + return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, advancedcluster.V20240530, clusterName, err)) + } + } + if !reflect.DeepEqual(params, admin.ClusterDescriptionProcessArgs20240805{}) { + _, _, err = connV2.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, ¶ms).Execute() if err != nil { - return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, clusterName, err)) + return diag.FromErr(fmt.Errorf(errorAdvancedConfUpdate, "", clusterName, err)) } } } diff --git a/internal/service/cluster/resource_cluster_migration_test.go b/internal/service/cluster/resource_cluster_migration_test.go index 94e0108858..34b5d06070 100644 --- a/internal/service/cluster/resource_cluster_migration_test.go +++ b/internal/service/cluster/resource_cluster_migration_test.go @@ -11,6 +11,11 @@ func TestMigCluster_basicAWS_simple(t *testing.T) { } func TestMigCluster_partial_advancedConf(t *testing.T) { - mig.SkipIfVersionBelow(t, "1.19.0") // version where change_stream_options_pre_and_post_images_expire_after_seconds was introduced + mig.SkipIfVersionBelow(t, "1.24.0") // version where tls_cipher_config_mode was introduced mig.CreateAndRunTest(t, partialAdvancedConfTestCase(t)) } + +func TestMigDefaultWriteReadAdvancedConf_advancedConf(t *testing.T) { + mig.SkipIfVersionBelow(t, "1.24.0") // version where tls_cipher_config_mode was introduced + mig.CreateAndRunTest(t, basicDefaultWriteReadAdvancedConfTestCase(t)) +} diff --git a/internal/service/cluster/resource_cluster_test.go b/internal/service/cluster/resource_cluster_test.go index 4aade4c540..78c51fe6c0 100644 --- a/internal/service/cluster/resource_cluster_test.go +++ b/internal/service/cluster/resource_cluster_test.go @@ -4,14 +4,19 @@ import ( "fmt" "os" "regexp" + "strings" "testing" "time" + admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" + "go.mongodb.org/atlas-sdk/v20241113003/admin" + matlas "go.mongodb.org/atlas/mongodbatlas" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" clustersvc "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/cluster" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" - matlas "go.mongodb.org/atlas/mongodbatlas" ) const ( @@ -97,16 +102,21 @@ func partialAdvancedConfTestCase(tb testing.TB) *resource.TestCase { CheckDestroy: acc.CheckDestroyCluster, Steps: []resource.TestStep{ { - Config: configAdvancedConf(projectID, clusterName, "false", &matlas.ProcessArgs{ - FailIndexKeyTooLong: conversion.Pointer(false), - JavascriptEnabled: conversion.Pointer(true), - MinimumEnabledTLSProtocol: "TLS1_1", - NoTableScan: conversion.Pointer(false), - OplogSizeMB: conversion.Pointer[int64](1000), - SampleRefreshIntervalBIConnector: conversion.Pointer[int64](310), - SampleSizeBIConnector: conversion.Pointer[int64](110), - TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), - }), + Config: configAdvancedConf(projectID, clusterName, "false", &admin20240530.ClusterDescriptionProcessArgs{ + FailIndexKeyTooLong: conversion.Pointer(false), + DefaultReadConcern: conversion.StringPtr("available"), + }, + &admin.ClusterDescriptionProcessArgs20240805{ + JavascriptEnabled: conversion.Pointer(true), + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_1"), + NoTableScan: conversion.Pointer(false), + OplogSizeMB: conversion.Pointer(1000), + SampleRefreshIntervalBIConnector: conversion.Pointer(310), + SampleSizeBIConnector: conversion.Pointer(110), + TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), + TlsCipherConfigMode: conversion.StringPtr("CUSTOM"), + CustomOpensslCipherConfigTls12: &[]string{"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"}, + }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.fail_index_key_too_long", "false"), @@ -117,6 +127,9 @@ func partialAdvancedConfTestCase(tb testing.TB) *resource.TestCase { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.transaction_lifetime_limit_seconds", "300"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "CUSTOM"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "2"), + resource.TestCheckResourceAttr(dataSourceName, "name", clusterName), resource.TestCheckResourceAttr(dataSourceName, "disk_size_gb", "10"), resource.TestCheckResourceAttrSet(dataSourceName, "mongo_uri"), @@ -126,11 +139,15 @@ func partialAdvancedConfTestCase(tb testing.TB) *resource.TestCase { resource.TestCheckResourceAttr(dataSourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(dataSourceName, "advanced_configuration.0.no_table_scan", "false"), resource.TestCheckResourceAttr(dataSourceName, "advanced_configuration.0.oplog_size_mb", "1000"), + resource.TestCheckResourceAttr(dataSourceName, "advanced_configuration.0.tls_cipher_config_mode", "CUSTOM"), + resource.TestCheckResourceAttr(dataSourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "2"), ), }, { - Config: configAdvancedConfPartial(projectID, clusterName, "false", &matlas.ProcessArgs{ - MinimumEnabledTLSProtocol: "TLS1_2", + Config: configAdvancedConfPartial(projectID, clusterName, "false", &admin.ClusterDescriptionProcessArgs20240805{ + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_2"), + TlsCipherConfigMode: conversion.StringPtr("DEFAULT"), // To unset TlsCipherConfigMode, user needs to set this to DEFAULT + CustomOpensslCipherConfigTls12: &[]string{}, }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), @@ -141,37 +158,43 @@ func partialAdvancedConfTestCase(tb testing.TB) *resource.TestCase { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.oplog_size_mb", "1000"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "DEFAULT"), ), }, }, } } -func TestAccCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) { +func basicDefaultWriteReadAdvancedConfTestCase(tb testing.TB) *resource.TestCase { + tb.Helper() + var ( - projectID = acc.ProjectIDExecution(t) + projectID = acc.ProjectIDExecution(tb) clusterName = acc.RandomClusterName() ) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: acc.PreCheckBasicSleep(t, nil, projectID, clusterName), + return &resource.TestCase{ + PreCheck: acc.PreCheckBasicSleep(tb, nil, projectID, clusterName), ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, CheckDestroy: acc.CheckDestroyCluster, Steps: []resource.TestStep{ { - Config: configAdvancedConfDefaultWriteRead(projectID, clusterName, "false", &matlas.ProcessArgs{ - DefaultReadConcern: "available", - DefaultWriteConcern: "1", - FailIndexKeyTooLong: conversion.Pointer(false), - JavascriptEnabled: conversion.Pointer(true), - MinimumEnabledTLSProtocol: "TLS1_1", - NoTableScan: conversion.Pointer(false), - OplogSizeMB: conversion.Pointer[int64](1000), - SampleRefreshIntervalBIConnector: conversion.Pointer[int64](310), - SampleSizeBIConnector: conversion.Pointer[int64](110), - TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), - ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.Pointer[int64](113), - }), + Config: configAdvancedConfDefaultWriteRead(projectID, clusterName, "false", + &admin20240530.ClusterDescriptionProcessArgs{ + FailIndexKeyTooLong: conversion.Pointer(false), + DefaultReadConcern: conversion.StringPtr("available"), + }, + &admin.ClusterDescriptionProcessArgs20240805{ + DefaultWriteConcern: conversion.StringPtr("1"), + JavascriptEnabled: conversion.Pointer(true), + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_1"), + NoTableScan: conversion.Pointer(false), + OplogSizeMB: conversion.Pointer(1000), + SampleRefreshIntervalBIConnector: conversion.Pointer(310), + SampleSizeBIConnector: conversion.Pointer(110), + TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), + ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.Pointer(113), + }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.default_read_concern", "available"), @@ -183,11 +206,12 @@ func TestAccCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.change_stream_options_pre_and_post_images_expire_after_seconds", "113"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "DEFAULT"), ), }, { - Config: configAdvancedConfPartialDefault(projectID, clusterName, "false", &matlas.ProcessArgs{ - MinimumEnabledTLSProtocol: "TLS1_2", + Config: configAdvancedConfPartialDefault(projectID, clusterName, "false", &admin.ClusterDescriptionProcessArgs20240805{ + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_2"), }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), @@ -200,10 +224,15 @@ func TestAccCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.change_stream_options_pre_and_post_images_expire_after_seconds", "-1"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "DEFAULT"), ), }, }, - }) + } +} + +func TestAccCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) { + resource.ParallelTest(t, *basicDefaultWriteReadAdvancedConfTestCase(t)) } func TestAccCluster_emptyAdvancedConf(t *testing.T) { @@ -218,21 +247,23 @@ func TestAccCluster_emptyAdvancedConf(t *testing.T) { CheckDestroy: acc.CheckDestroyCluster, Steps: []resource.TestStep{ { - Config: configAdvancedConfPartial(projectID, clusterName, "false", &matlas.ProcessArgs{ - MinimumEnabledTLSProtocol: "TLS1_2", + Config: configAdvancedConfPartial(projectID, clusterName, "false", &admin.ClusterDescriptionProcessArgs20240805{ + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_2"), }), }, { - Config: configAdvancedConf(projectID, clusterName, "false", &matlas.ProcessArgs{ - FailIndexKeyTooLong: conversion.Pointer(false), - JavascriptEnabled: conversion.Pointer(true), - MinimumEnabledTLSProtocol: "TLS1_1", - NoTableScan: conversion.Pointer(false), - OplogSizeMB: conversion.Pointer[int64](1000), - SampleRefreshIntervalBIConnector: conversion.Pointer[int64](310), - SampleSizeBIConnector: conversion.Pointer[int64](110), - TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), - }), + Config: configAdvancedConf(projectID, clusterName, "false", &admin20240530.ClusterDescriptionProcessArgs{ + FailIndexKeyTooLong: conversion.Pointer(false), + }, + &admin.ClusterDescriptionProcessArgs20240805{ + JavascriptEnabled: conversion.Pointer(true), + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_1"), + NoTableScan: conversion.Pointer(false), + OplogSizeMB: conversion.Pointer(1000), + SampleRefreshIntervalBIConnector: conversion.Pointer(310), + SampleSizeBIConnector: conversion.Pointer(110), + TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), + }), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.fail_index_key_too_long", "false"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.javascript_enabled", "true"), @@ -260,19 +291,23 @@ func TestAccCluster_basicAdvancedConf(t *testing.T) { CheckDestroy: acc.CheckDestroyCluster, Steps: []resource.TestStep{ { - Config: configAdvancedConf(projectID, clusterName, "false", &matlas.ProcessArgs{ - FailIndexKeyTooLong: conversion.Pointer(false), - JavascriptEnabled: conversion.Pointer(true), - MinimumEnabledTLSProtocol: "TLS1_2", - NoTableScan: conversion.Pointer(true), - OplogSizeMB: conversion.Pointer[int64](1000), - SampleRefreshIntervalBIConnector: conversion.Pointer[int64](310), - SampleSizeBIConnector: conversion.Pointer[int64](110), - TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), - }), + Config: configAdvancedConf(projectID, clusterName, "false", &admin20240530.ClusterDescriptionProcessArgs{ + FailIndexKeyTooLong: conversion.Pointer(false), + DefaultReadConcern: conversion.StringPtr("available"), + }, + &admin.ClusterDescriptionProcessArgs20240805{ + JavascriptEnabled: conversion.Pointer(true), + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_2"), + NoTableScan: conversion.Pointer(true), + OplogSizeMB: conversion.Pointer(1000), + SampleRefreshIntervalBIConnector: conversion.Pointer(310), + SampleSizeBIConnector: conversion.Pointer(110), + TransactionLifetimeLimitSeconds: conversion.Pointer[int64](300), + }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.fail_index_key_too_long", "false"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.default_read_concern", "available"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.javascript_enabled", "true"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.minimum_enabled_tls_protocol", "TLS1_2"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.no_table_scan", "true"), @@ -280,19 +315,24 @@ func TestAccCluster_basicAdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.transaction_lifetime_limit_seconds", "300"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "DEFAULT"), ), }, { - Config: configAdvancedConf(projectID, clusterName, "false", &matlas.ProcessArgs{ - FailIndexKeyTooLong: conversion.Pointer(false), - JavascriptEnabled: conversion.Pointer(false), - MinimumEnabledTLSProtocol: "TLS1_1", - NoTableScan: conversion.Pointer(false), - OplogSizeMB: conversion.Pointer[int64](990), - SampleRefreshIntervalBIConnector: conversion.Pointer[int64](0), - SampleSizeBIConnector: conversion.Pointer[int64](0), - TransactionLifetimeLimitSeconds: conversion.Pointer[int64](60), - }), + Config: configAdvancedConf(projectID, clusterName, "false", &admin20240530.ClusterDescriptionProcessArgs{ + FailIndexKeyTooLong: conversion.Pointer(false), + }, + &admin.ClusterDescriptionProcessArgs20240805{ + JavascriptEnabled: conversion.Pointer(false), + MinimumEnabledTlsProtocol: conversion.StringPtr("TLS1_1"), + NoTableScan: conversion.Pointer(false), + OplogSizeMB: conversion.Pointer(990), + SampleRefreshIntervalBIConnector: conversion.Pointer(0), + SampleSizeBIConnector: conversion.Pointer(0), + TransactionLifetimeLimitSeconds: conversion.Pointer[int64](60), + TlsCipherConfigMode: conversion.StringPtr("CUSTOM"), + CustomOpensslCipherConfigTls12: &[]string{"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"}, + }), Check: resource.ComposeAggregateTestCheckFunc( acc.CheckExistsCluster(resourceName), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.fail_index_key_too_long", "false"), @@ -303,6 +343,8 @@ func TestAccCluster_basicAdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "0"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "0"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.transaction_lifetime_limit_seconds", "60"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "CUSTOM"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "1"), ), }, }, @@ -1467,7 +1509,27 @@ func configAWS(projectID, name string, backupEnabled, autoDiskGBEnabled bool) st `, projectID, name, backupEnabled, autoDiskGBEnabled) } -func configAdvancedConf(projectID, name, autoscalingEnabled string, p *matlas.ProcessArgs) string { +func configAdvancedConf(projectID, name, autoscalingEnabled string, + p20240530 *admin20240530.ClusterDescriptionProcessArgs, p *admin.ClusterDescriptionProcessArgs20240805) string { + defaultReadConcernStr := "" + tlsCipherConfigModeStr := "" + customOpensslCipherConfigTLS12Str := "" + + if p20240530.DefaultReadConcern != nil { + defaultReadConcernStr = fmt.Sprintf("default_read_concern = %[1]q", *p20240530.DefaultReadConcern) + } + + if p.TlsCipherConfigMode != nil { + tlsCipherConfigModeStr = fmt.Sprintf(`tls_cipher_config_mode = %[1]q`, *p.TlsCipherConfigMode) + if p.CustomOpensslCipherConfigTls12 != nil && len(*p.CustomOpensslCipherConfigTls12) > 0 { + //nolint:gocritic // reason: simplifying string array construction + customOpensslCipherConfigTLS12Str = fmt.Sprintf( + `custom_openssl_cipher_config_tls12 = ["%s"]`, + strings.Join(*p.CustomOpensslCipherConfigTls12, `", "`), + ) + } + } + return fmt.Sprintf(` resource "mongodbatlas_cluster" "test" { project_id = %[1]q @@ -1494,13 +1556,17 @@ func configAdvancedConf(projectID, name, autoscalingEnabled string, p *matlas.Pr advanced_configuration { fail_index_key_too_long = %[4]t - javascript_enabled = %[5]t - minimum_enabled_tls_protocol = %[6]q - no_table_scan = %[7]t - oplog_size_mb = %[8]d - sample_size_bi_connector = %[9]d - sample_refresh_interval_bi_connector = %[10]d - transaction_lifetime_limit_seconds = %[11]d + %[5]s + javascript_enabled = %[6]t + minimum_enabled_tls_protocol = %[7]q + no_table_scan = %[8]t + oplog_size_mb = %[9]d + sample_size_bi_connector = %[10]d + sample_refresh_interval_bi_connector = %[11]d + transaction_lifetime_limit_seconds = %[12]d + %[13]s + %[14]s + } } @@ -1509,11 +1575,11 @@ func configAdvancedConf(projectID, name, autoscalingEnabled string, p *matlas.Pr name = mongodbatlas_cluster.test.name } `, projectID, name, autoscalingEnabled, - *p.FailIndexKeyTooLong, *p.JavascriptEnabled, p.MinimumEnabledTLSProtocol, *p.NoTableScan, - *p.OplogSizeMB, *p.SampleSizeBIConnector, *p.SampleRefreshIntervalBIConnector, *p.TransactionLifetimeLimitSeconds) + p20240530.GetFailIndexKeyTooLong(), defaultReadConcernStr, p.GetJavascriptEnabled(), p.GetMinimumEnabledTlsProtocol(), p.GetNoTableScan(), + p.GetOplogSizeMB(), p.GetSampleSizeBIConnector(), p.GetSampleRefreshIntervalBIConnector(), p.GetTransactionLifetimeLimitSeconds(), tlsCipherConfigModeStr, customOpensslCipherConfigTLS12Str) } -func configAdvancedConfDefaultWriteRead(projectID, name, autoscalingEnabled string, p *matlas.ProcessArgs) string { +func configAdvancedConfDefaultWriteRead(projectID, name, autoscalingEnabled string, p20240530 *admin20240530.ClusterDescriptionProcessArgs, p *admin.ClusterDescriptionProcessArgs20240805) string { return fmt.Sprintf(` resource "mongodbatlas_cluster" "test" { project_id = %[1]q @@ -1550,11 +1616,24 @@ func configAdvancedConfDefaultWriteRead(projectID, name, autoscalingEnabled stri } } `, projectID, name, autoscalingEnabled, - *p.JavascriptEnabled, p.MinimumEnabledTLSProtocol, *p.NoTableScan, - *p.OplogSizeMB, *p.SampleSizeBIConnector, *p.SampleRefreshIntervalBIConnector, p.DefaultReadConcern, p.DefaultWriteConcern, *p.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds) + p.GetJavascriptEnabled(), p.GetMinimumEnabledTlsProtocol(), p.GetNoTableScan(), + p.GetOplogSizeMB(), p.GetSampleSizeBIConnector(), p.GetSampleRefreshIntervalBIConnector(), p20240530.GetDefaultReadConcern(), p.GetDefaultWriteConcern(), p.GetChangeStreamOptionsPreAndPostImagesExpireAfterSeconds()) } -func configAdvancedConfPartial(projectID, name, autoscalingEnabled string, p *matlas.ProcessArgs) string { +func configAdvancedConfPartial(projectID, name, autoscalingEnabled string, p *admin.ClusterDescriptionProcessArgs20240805) string { + tlsCipherConfigModeStr := "" + customOpensslCipherConfigTLS12Str := "" + + if p.TlsCipherConfigMode != nil { + tlsCipherConfigModeStr = fmt.Sprintf(`tls_cipher_config_mode = %[1]q`, *p.TlsCipherConfigMode) + if p.CustomOpensslCipherConfigTls12 != nil && len(*p.CustomOpensslCipherConfigTls12) > 0 { + //nolint:gocritic // reason: simplifying string array construction + customOpensslCipherConfigTLS12Str = fmt.Sprintf( + `custom_openssl_cipher_config_tls12 = ["%s"]`, + strings.Join(*p.CustomOpensslCipherConfigTls12, `", "`), + ) + } + } return fmt.Sprintf(` resource "mongodbatlas_cluster" "test" { project_id = %[1]q @@ -1582,12 +1661,14 @@ func configAdvancedConfPartial(projectID, name, autoscalingEnabled string, p *ma advanced_configuration { minimum_enabled_tls_protocol = %[4]q + %[5]s + %[6]s } } - `, projectID, name, autoscalingEnabled, p.MinimumEnabledTLSProtocol) + `, projectID, name, autoscalingEnabled, p.GetMinimumEnabledTlsProtocol(), tlsCipherConfigModeStr, customOpensslCipherConfigTLS12Str) } -func configAdvancedConfPartialDefault(projectID, name, autoscalingEnabled string, p *matlas.ProcessArgs) string { +func configAdvancedConfPartialDefault(projectID, name, autoscalingEnabled string, p *admin.ClusterDescriptionProcessArgs20240805) string { return fmt.Sprintf(` resource "mongodbatlas_cluster" "test" { project_id = %[1]q @@ -1617,7 +1698,7 @@ func configAdvancedConfPartialDefault(projectID, name, autoscalingEnabled string minimum_enabled_tls_protocol = %[4]q } } - `, projectID, name, autoscalingEnabled, p.MinimumEnabledTLSProtocol) + `, projectID, name, autoscalingEnabled, p.GetMinimumEnabledTlsProtocol()) } func configAzure(orgID, projectName, name, backupEnabled, instanceSizeName string, includeDiskType bool) string { From f28a593498dedc7c79ee03e82cf6d7fc30f38bf7 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Thu, 19 Dec 2024 18:57:38 +0000 Subject: [PATCH 27/40] chore: Updates CHANGELOG.md for #2872 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f4dc69dfa..66b82e58b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## (Unreleased) +ENHANCEMENTS: + +* data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) +* data-source/mongodbatlas_advanced_clusters: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) +* data-source/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) +* data-source/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) +* resource/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) +* resource/mongodbatlas_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) + ## 1.23.0 (December 17, 2024) ENHANCEMENTS: From b3319a796d9039e7628838d93841d3cd6f10e55d Mon Sep 17 00:00:00 2001 From: maastha <122359335+maastha@users.noreply.github.com> Date: Fri, 20 Dec 2024 08:51:01 +0000 Subject: [PATCH 28/40] upgrade guide (#2917) --- docs/guides/1.24.0-upgrade-guide.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/guides/1.24.0-upgrade-guide.md diff --git a/docs/guides/1.24.0-upgrade-guide.md b/docs/guides/1.24.0-upgrade-guide.md new file mode 100644 index 0000000000..75745adafd --- /dev/null +++ b/docs/guides/1.24.0-upgrade-guide.md @@ -0,0 +1,20 @@ +--- +page_title: "Upgrade Guide 1.24.0" +--- + +# MongoDB Atlas Provider 1.24.0: Upgrade and Information Guide + +The Terraform MongoDB Atlas Provider version 1.24.0 has a number of new and exciting features. + +## New Resources, Data Sources, and Features + +- You can now specify TLS cipher suite configuration in `mongodbatlas_advanced_cluster` and `mongodbatlas_cluster` using `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12`. This allows you to specify custom cipher suites for TLS 1.2. To learn more, see either [mongodbatlas_advanced_cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/advanced_cluster) or [mongodbatlas_cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster) resource documentation. + + +## Helpful Links + +* [Report bugs](https://github.com/mongodb/terraform-provider-mongodbatlas/issues) + +* [Request Features](https://feedback.mongodb.com/forums/924145-atlas?category_id=370723) + +* [Contact Support](https://docs.atlas.mongodb.com/support/) covered by MongoDB Atlas support plans, Developer and above. From ee544a5b19c2ae35cb0ba9110131929d0f84d13b Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Fri, 20 Dec 2024 08:56:03 +0000 Subject: [PATCH 29/40] chore: Updates examples link in index.md for v1.24.0 release --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 286e590f72..7853c904c2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -221,7 +221,7 @@ We ship binaries but do not prioritize fixes for the following operating system ## Examples from MongoDB and the Community -We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.23.0/examples) +We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.24.0/examples) in our GitHub repo that will help both beginner and more advanced users. Have a good example you've created and want to share? From 2493e868d5fba83a6bb7dfcef8cf46f1687170f1 Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Fri, 20 Dec 2024 08:56:32 +0000 Subject: [PATCH 30/40] chore: Updates CHANGELOG.md header for v1.24.0 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66b82e58b4..07cea7a447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## (Unreleased) +## 1.24.0 (December 20, 2024) + ENHANCEMENTS: * data-source/mongodbatlas_advanced_cluster: Adds `advanced_configuration.0.tls_cipher_config_mode` and `advanced_configuration.0.custom_openssl_cipher_config_tls12` attribute ([#2872](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2872)) From 7e4212c7fa0198188978a67314075cea2b2f5ede Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Fri, 20 Dec 2024 10:42:36 +0000 Subject: [PATCH 31/40] chore: Supports matching replication specs in state and plan before update advanced_cluster TPF (#2903) * feat: supports matching replication specs in state and plan before update * fix: force update when specs have been aligned * chore: Apply PR suggestions * fix: ignore replication spec ID and zone ID in state updates * test: regenerate MacT with updated values * refactor: diskIOPS are not necessary unless it is set in the plan * refactor: simplify update logic --- internal/common/update/patch_payload_test.go | 171 ++++++++++-------- .../resource_advanced_cluster_test.go | 1 - .../service/advancedclustertpf/resource.go | 12 +- ...cMockableAdvancedCluster_shardedBasic.yaml | 2 +- ...Id}_clusters_{clusterName}_2024-08-05.json | 4 - ...ncedCluster_symmetricShardedOldSchema.yaml | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 4 - ...edOldSchemaDiskSizeGBAtElectableLevel.yaml | 2 +- ...Id}_clusters_{clusterName}_2023-02-01.json | 3 - 9 files changed, 107 insertions(+), 94 deletions(-) diff --git a/internal/common/update/patch_payload_test.go b/internal/common/update/patch_payload_test.go index 8106d7453e..3f18d4c88f 100644 --- a/internal/common/update/patch_payload_test.go +++ b/internal/common/update/patch_payload_test.go @@ -1,6 +1,7 @@ package update_test import ( + "fmt" "testing" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" @@ -12,45 +13,39 @@ import ( func TestPatchReplicationSpecs(t *testing.T) { var ( - idGlobal = "id_root" - idReplicationSpec1 = "id_replicationSpec1" - idReplicationSpec2 = "id_replicationSpec2" - replicationSpec1ZoneNameOld = "replicationSpec1_zoneName_old" - replicationSpec1ZoneNameNew = "replicationSpec1_zoneName_new" - replicationSpec1ZoneID = "replicationSpec1_zoneId" - replicationSpec2ZoneID = "replicationSpec2_zoneId" - replicationSpec2ZoneName = "replicationSpec2_zoneName" - rootName = "my-cluster" - rootNameUpdated = "my-cluster-updated" - stateReplicationSpecs = []admin.ReplicationSpec20240805{ - { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, + rp1 = replicationSpec{placeholderIndex: 1}.toAdmin() + rp2 = replicationSpec{placeholderIndex: 2}.toAdmin() + rp3 = replicationSpec{placeholderIndex: 3}.toAdmin() + rp1ZoneName = rp1.GetZoneName() + rp1ID = rp1.GetId() + rp1ZoneID = rp1.GetZoneId() + idGlobal = "id_root" + + clusterName = "my-cluster" + rootNameUpdated = "my-cluster-updated" + stateReplicationSpecs = []admin.ReplicationSpec20240805{ + rp1, } state = admin.ClusterDescription20240805{ Id: &idGlobal, - Name: &rootName, + Name: &clusterName, ReplicationSpecs: &stateReplicationSpecs, } - planOptionalUpdated = admin.ClusterDescription20240805{ - Name: &rootName, - ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - ZoneName: &replicationSpec1ZoneNameNew, - }, - }, - } - planNewListEntry = admin.ClusterDescription20240805{ - ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - ZoneName: &replicationSpec1ZoneNameOld, - }, - { - ZoneName: &replicationSpec2ZoneName, - }, - }, + stateWithReplicationSpecs = func(specs []replicationSpec, id, name string) *admin.ClusterDescription20240805 { + newSpecs := make([]admin.ReplicationSpec20240805, len(specs)) + for i := range specs { + newSpecs[i] = specs[i].toAdmin() + } + cd := admin.ClusterDescription20240805{ + ReplicationSpecs: &newSpecs, + } + if id != "" { + cd.Id = &id + } + if name != "" { + cd.Name = &name + } + return &cd } planNameDifferentAndEnableBackup = admin.ClusterDescription20240805{ Name: &rootNameUpdated, @@ -59,7 +54,7 @@ func TestPatchReplicationSpecs(t *testing.T) { planNoChanges = admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { - ZoneName: &replicationSpec1ZoneNameOld, + ZoneName: &rp1ZoneName, }, }, } @@ -69,66 +64,58 @@ func TestPatchReplicationSpecs(t *testing.T) { patchExpected *admin.ClusterDescription20240805 options []update.PatchOptions }{ - "ComputedValues from the state are added to plan and unchanged attributes are not included": { + "ComputedValues from the state are added to nested attribute plan and unchanged attributes are not included": { state: &state, - plan: &planOptionalUpdated, + plan: stateWithReplicationSpecs([]replicationSpec{{zoneName: "newName"}}, "", ""), patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameNew, + Id: &rp1ID, + ZoneId: &rp1ZoneID, + ZoneName: conversion.Pointer("newName"), }, }, }, }, "New list entry added should be included": { state: &state, - plan: &planNewListEntry, + plan: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {zoneName: "zone2"}}, "", ""), patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ + rp1, { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, - { - ZoneName: &replicationSpec2ZoneName, + ZoneName: conversion.Pointer("zone2"), }, }, }, }, - "Removed list entry should be included": { - state: &admin.ClusterDescription20240805{ + "Removed list entry should be detected": { + state: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {placeholderIndex: 2}}, "", ""), + plan: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}}, "", ""), + patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, - { - Id: &idReplicationSpec2, - ZoneName: &replicationSpec2ZoneName, - ZoneId: &replicationSpec2ZoneID, - }, + rp1, }, }, - plan: &admin.ClusterDescription20240805{ + }, + "Added list entry in the middle should be detected": { + state: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {placeholderIndex: 2}}, "", ""), + plan: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {placeholderIndex: 3}, {placeholderIndex: 2}}, "", ""), + patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, + rp1, + rp3, + rp2, }, }, + }, + "Removed list entry in the middle should be detected": { + state: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {placeholderIndex: 2}, {placeholderIndex: 3}}, "", ""), + plan: stateWithReplicationSpecs([]replicationSpec{{placeholderIndex: 1}, {placeholderIndex: 3}}, "", ""), patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ - { - Id: &idReplicationSpec1, - ZoneId: &replicationSpec1ZoneID, - ZoneName: &replicationSpec1ZoneNameOld, - }, + rp1, + rp3, }, }, }, @@ -136,7 +123,7 @@ func TestPatchReplicationSpecs(t *testing.T) { state: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { - Id: &idReplicationSpec1, + Id: &rp1ID, RegionConfigs: &[]admin.CloudRegionConfig20240805{ { Priority: conversion.Pointer(1), @@ -148,7 +135,7 @@ func TestPatchReplicationSpecs(t *testing.T) { plan: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { - Id: &idReplicationSpec1, + Id: &rp1ID, RegionConfigs: &[]admin.CloudRegionConfig20240805{ { Priority: conversion.Pointer(1), @@ -163,7 +150,7 @@ func TestPatchReplicationSpecs(t *testing.T) { patchExpected: &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ { - Id: &idReplicationSpec1, + Id: &rp1ID, RegionConfigs: &[]admin.CloudRegionConfig20240805{ { Priority: conversion.Pointer(1), @@ -302,6 +289,44 @@ func TestIsEmpty(t *testing.T) { assert.False(t, update.IsZeroValues(&admin.ClusterDescription20240805{Name: conversion.Pointer("my-cluster")})) } +type replicationSpec struct { + id string + zoneName string + zoneID string + placeholderIndex int +} + +func (r replicationSpec) toAdmin() admin.ReplicationSpec20240805 { + var ( + placeholderID = "replicationSpec%d_id" + placeholderZoneID = "replicationSpec%d_zoneId" + placeholderZoneName = "replicationSpec%d_zoneName" + ) + index := r.placeholderIndex + if index != 0 { + if r.id == "" { + r.id = fmt.Sprintf(placeholderID, index) + } + if r.zoneName == "" { + r.zoneName = fmt.Sprintf(placeholderZoneName, index) + } + if r.zoneID == "" { + r.zoneID = fmt.Sprintf(placeholderZoneID, index) + } + } + spec := admin.ReplicationSpec20240805{} + if r.id != "" { + spec.SetId(r.id) + } + if r.zoneID != "" { + spec.SetZoneId(r.zoneID) + } + if r.zoneName != "" { + spec.SetZoneName(r.zoneName) + } + return spec +} + func clusterDescriptionDiskSizeNodeCount(diskSizeGBElectable float64, nodeCountElectable int, diskSizeGBReadOnly *float64, nodeCountReadOnly int, diskIopsState *int) *admin.ClusterDescription20240805 { return &admin.ClusterDescription20240805{ ReplicationSpecs: &[]admin.ReplicationSpec20240805{ diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 50bd102879..07de60ac6b 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -786,7 +786,6 @@ func TestAccClusterAdvancedClusterConfig_asymmetricGeoShardedNewSchemaAddingRemo projectName = acc.RandomProjectName() clusterName = acc.RandomClusterName() ) - acc.SkipIfAdvancedClusterV2Schema(t) // TODO: add support for matching state replication_specs with updated/removed replication_specs in config resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 5ecc041813..cf52887347 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -111,18 +111,18 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou return } isSchemaUpgrade := stateUsingLegacy && !planUsingLegacy - stateReq := normalizeFromTFModel(ctx, &state, diags, isSchemaUpgrade) + stateReq := normalizeFromTFModel(ctx, &state, diags, false) planReq := normalizeFromTFModel(ctx, &plan, diags, isSchemaUpgrade) if diags.HasError() { return } patchOptions := update.PatchOptions{ - IgnoreInStatePrefix: []string{"regionConfigs"}, - IncludeInStateSuffix: []string{"diskIOPS"}, + IgnoreInStatePrefix: []string{"regionConfigs"}, + IgnoreInStateSuffix: []string{"id", "zoneId"}, // replication_spec.*.zone_id|id doesn't have to be included, the API will do its best to create a minimal change } - if isSchemaUpgrade || findNumShardsUpdates(ctx, &state, &plan, diags) != nil { - // isSchemaUpgrade will have no changes by default after flattening; therefore, force update the replicationSpecs - // `num_shards` updates is only in the legacy ClusterDescription; therefore, force update the replicationSpecs + if findNumShardsUpdates(ctx, &state, &plan, diags) != nil { + // force update the replicationSpecs when update.PatchPayload will not detect changes by default: + // `num_shards` updates is only in the legacy ClusterDescription patchOptions.ForceUpdateAttr = append(patchOptions.ForceUpdateAttr, "replicationSpecs") } patchReq, err := update.PatchPayload(stateReq, planReq, patchOptions) diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml index 73e4eacd06..c79a455de7 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic.yaml @@ -167,7 +167,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2024-08-05' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"675bf94c216ed3746c09fc5d\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"id\": \"675bf94c216ed3746c09fc5f\",\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneId\": \"675bf94c216ed3746c09fc5b\",\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 2000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 1\n },\n \"autoScaling\": {\n \"compute\": {},\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 1000,\n \"ebsVolumeType\": \"PROVISIONED\",\n \"instanceSize\": \"M30\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 30 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json index f9b21a52d7..e118f07e1f 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_shardedBasic/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json @@ -1,7 +1,6 @@ { "replicationSpecs": [ { - "id": "675bf94c216ed3746c09fc5d", "regionConfigs": [ { "analyticsSpecs": { @@ -27,11 +26,9 @@ "regionName": "EU_WEST_1" } ], - "zoneId": "675bf94c216ed3746c09fc5b", "zoneName": "ZoneName managed by Terraform" }, { - "id": "675bf94c216ed3746c09fc5f", "regionConfigs": [ { "analyticsSpecs": { @@ -57,7 +54,6 @@ "regionName": "EU_WEST_1" } ], - "zoneId": "675bf94c216ed3746c09fc5b", "zoneName": "ZoneName managed by Terraform" } ] diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml index 2d4553d523..4717e8e110 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema.yaml @@ -157,7 +157,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2023-02-01' - text: "{\n \"replicationSpecs\": [\n {\n \"id\": \"67587cae27216120d54106e0\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"diskIOPS\": 3500,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"replicationSpecs\": [\n {\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"EU_WEST_1\"\n },\n {\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"priority\": 6,\n \"providerName\": \"AZURE\",\n \"regionName\": \"US_EAST_2\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 67 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index 02fb47bc39..f56c9f1a33 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchema/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -1,17 +1,14 @@ { "replicationSpecs": [ { - "id": "67587cae27216120d54106e0", "numShards": 2, "regionConfigs": [ { "analyticsSpecs": { - "diskIOPS": 3000, "instanceSize": "M20", "nodeCount": 1 }, "electableSpecs": { - "diskIOPS": 3000, "instanceSize": "M10", "nodeCount": 3 }, @@ -21,7 +18,6 @@ }, { "electableSpecs": { - "diskIOPS": 3500, "instanceSize": "M10", "nodeCount": 2 }, diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml index 61534ce08e..ce40260f8f 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel.yaml @@ -149,7 +149,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2023-02-01' - text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"id\": \"67587c99240d1b0223213a95\",\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" + text: "{\n \"diskSizeGB\": 55,\n \"replicationSpecs\": [\n {\n \"numShards\": 2,\n \"regionConfigs\": [\n {\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"ZoneName managed by Terraform\"\n }\n ]\n}" responses: - response_index: 61 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json index 7fba993da8..c0b5b8a6af 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectableLevel/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -2,17 +2,14 @@ "diskSizeGB": 55, "replicationSpecs": [ { - "id": "67587c99240d1b0223213a95", "numShards": 2, "regionConfigs": [ { "analyticsSpecs": { - "diskIOPS": 3000, "instanceSize": "M10", "nodeCount": 0 }, "electableSpecs": { - "diskIOPS": 3000, "instanceSize": "M10", "nodeCount": 3 }, From 24481b5d52397accb2bc0ba3e8c7e51cfa9910b6 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Fri, 20 Dec 2024 11:45:02 +0000 Subject: [PATCH 32/40] chore: Selects container_ids based on provider name and regions used in replication spec for adv_cluster TPF (#2913) * fix: select container_ids based on provider name and regions used in replication spec * chore: Adds clarifying comment --- .../resource_advanced_cluster_test.go | 5 ++-- .../model_ClusterDescription20240805.go | 23 +++++++++++++++++-- .../resource_compatibility_reuse.go | 12 ++++++---- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 07de60ac6b..bb2e244ca1 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -2227,9 +2227,10 @@ func checkGeoShardedNewSchema(isAcc, includeThirdShardInFirstZone bool) resource amtOfReplicationSpecs = 2 } clusterChecks := map[string]string{ - "replication_specs.#": fmt.Sprintf("%d", amtOfReplicationSpecs), + "replication_specs.#": fmt.Sprintf("%d", amtOfReplicationSpecs), + "replication_specs.0.container_id.%": "1", + "replication_specs.1.container_id.%": "1", } - return checkAggr(isAcc, []string{}, clusterChecks) } diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index 3acce4ce55..6fe1ff5764 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -144,11 +144,12 @@ func convertReplicationSpecs(ctx context.Context, input *[]admin.ReplicationSpec return &tfModels } legacyID := apiInfo.ZoneNameReplicationSpecIDs[zoneName] + containerIDs := selectContainerIDs(&item, apiInfo.ContainerIDs) tfModels[i] = TFReplicationSpecsModel{ Id: types.StringValue(legacyID), ExternalId: types.StringValue(conversion.SafeValue(item.Id)), NumShards: types.Int64Value(1), - ContainerId: conversion.ToTFMapOfString(ctx, diags, &apiInfo.ContainerIDs), + ContainerId: conversion.ToTFMapOfString(ctx, diags, &containerIDs), RegionConfigs: regionConfigs, ZoneId: types.StringValue(conversion.SafeValue(item.ZoneId)), ZoneName: types.StringValue(conversion.SafeValue(item.ZoneName)), @@ -157,6 +158,23 @@ func convertReplicationSpecs(ctx context.Context, input *[]admin.ReplicationSpec return &tfModels } +func selectContainerIDs(spec *admin.ReplicationSpec20240805, allIDs map[string]string) map[string]string { + containerIDs := map[string]string{} + regions := spec.GetRegionConfigs() + for i := range regions { + regionConfig := regions[i] + providerName := regionConfig.GetProviderName() + key := containerIDKey(providerName, regionConfig.GetRegionName()) + value := allIDs[key] + // Should be no hard failure if not found, as it is not required for TENANT, error responsibility in resolveContainerIDs + if value == "" { + continue + } + containerIDs[key] = value + } + return containerIDs +} + func convertReplicationSpecsLegacy(ctx context.Context, input *[]admin.ReplicationSpec20240805, diags *diag.Diagnostics, apiInfo *ExtraAPIInfo) *[]TFReplicationSpecsModel { tfModels := []TFReplicationSpecsModel{} tfModelsSkipIndexes := []int{} @@ -188,8 +206,9 @@ func convertReplicationSpecsLegacy(ctx context.Context, input *[]admin.Replicati tfModelsSkipIndexes = append(tfModelsSkipIndexes, i+j) } } + containerIDs := selectContainerIDs(&item, apiInfo.ContainerIDs) tfModels = append(tfModels, TFReplicationSpecsModel{ - ContainerId: conversion.ToTFMapOfString(ctx, diags, &apiInfo.ContainerIDs), + ContainerId: conversion.ToTFMapOfString(ctx, diags, &containerIDs), ExternalId: types.StringValue(conversion.SafeValue(item.Id)), Id: types.StringValue(legacyID), RegionConfigs: regionConfigs, diff --git a/internal/service/advancedclustertpf/resource_compatibility_reuse.go b/internal/service/advancedclustertpf/resource_compatibility_reuse.go index 41cc60c862..e890e434ff 100644 --- a/internal/service/advancedclustertpf/resource_compatibility_reuse.go +++ b/internal/service/advancedclustertpf/resource_compatibility_reuse.go @@ -55,6 +55,10 @@ func FormatMongoDBMajorVersion(version string) string { return fmt.Sprintf("%.1f", cast.ToFloat32(version)) } +func containerIDKey(providerName, regionName string) string { + return fmt.Sprintf("%s:%s", providerName, regionName) +} + // based on flattenAdvancedReplicationSpecRegionConfigs in model_advanced_cluster.go func resolveContainerIDs(ctx context.Context, projectID string, cluster *admin.ClusterDescription20240805, api admin.NetworkPeeringApi) (map[string]string, error) { containerIDs := map[string]string{} @@ -69,8 +73,8 @@ func resolveContainerIDs(ctx context.Context, projectID string, cluster *admin.C GroupId: projectID, ProviderName: &providerName, } - containerIDKey := fmt.Sprintf("%s:%s", providerName, regionConfig.GetRegionName()) - if _, ok := containerIDs[containerIDKey]; ok { + key := containerIDKey(providerName, regionConfig.GetRegionName()) + if _, ok := containerIDs[key]; ok { continue } var containersResponse *admin.PaginatedCloudProviderContainer @@ -85,9 +89,9 @@ func resolveContainerIDs(ctx context.Context, projectID string, cluster *admin.C responseCache[providerName] = containersResponse } if results := getAdvancedClusterContainerID(containersResponse.GetResults(), ®ionConfig); results != "" { - containerIDs[containerIDKey] = results + containerIDs[key] = results } else { - return nil, fmt.Errorf("container id not found for %s", containerIDKey) + return nil, fmt.Errorf("container id not found for %s", key) } } } From fc9fe9294dad21c2abc2af2fae876ea532a07885 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:35:43 +0100 Subject: [PATCH 33/40] =?UTF-8?q?Revert=20"chore:=20Moves=20`bi=5Fconnecto?= =?UTF-8?q?r=5Fconfig`=20and=20`advanced=5Fconfiguration`=20in=20TP?= =?UTF-8?q?=E2=80=A6"=20(#2915)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 233999e49a9d41623f3af0c3a257cdb7a1d96404. --- .../common/conversion/admin_generation.go | 21 -- .../model_ClusterDescription20240805.go | 8 +- ...l_ClusterDescriptionProcessArgs20240805.go | 4 +- .../model_to_ClusterDescription20240805.go | 23 +- ...o_ClusterDescriptionProcessArgs20240805.go | 38 ++-- ..._to_ClusterDescriptionProcessArgsLegacy.go | 24 +- .../service/advancedclustertpf/resource.go | 4 +- .../resource_compatiblity.go | 9 +- .../resource_test_cases_test.go | 9 +- internal/service/advancedclustertpf/schema.go | 205 +++++++++--------- ...ncedCluster_replicasetAdvConfigUpdate.yaml | 4 +- ...Id}_clusters_{clusterName}_2024-10-23.json | 3 +- ..._{clusterName}_processArgs_2024-08-05.json | 1 - .../acc/advanced_cluster_schema_v2.go | 4 + .../acc/advanced_cluster_schema_v2_test.go | 50 ++--- 15 files changed, 199 insertions(+), 208 deletions(-) delete mode 100644 internal/common/conversion/admin_generation.go diff --git a/internal/common/conversion/admin_generation.go b/internal/common/conversion/admin_generation.go deleted file mode 100644 index 4f8583494c..0000000000 --- a/internal/common/conversion/admin_generation.go +++ /dev/null @@ -1,21 +0,0 @@ -package conversion - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/types" -) - -func SingleListTFToSDK[TFModel, SDKRequest any](ctx context.Context, diags *diag.Diagnostics, input *types.List, fnTransform func(tf TFModel) SDKRequest) SDKRequest { - var resp SDKRequest - if input == nil || input.IsUnknown() || input.IsNull() || len(input.Elements()) == 0 { - return resp - } - elements := make([]TFModel, len(input.Elements())) - diags.Append(input.ElementsAs(ctx, &elements, false)...) - if diags.HasError() { - return resp - } - return fnTransform(elements[0]) -} diff --git a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go index 6fe1ff5764..d57b4fa70c 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescription20240805.go @@ -70,17 +70,17 @@ func NewTFModel(ctx context.Context, input *admin.ClusterDescription20240805, ti } } -func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.List { +func NewBiConnectorConfigObjType(ctx context.Context, input *admin.BiConnector, diags *diag.Diagnostics) types.Object { if input == nil { - return types.ListNull(BiConnectorConfigObjType) + return types.ObjectNull(BiConnectorConfigObjType.AttrTypes) } tfModel := TFBiConnectorModel{ Enabled: types.BoolValue(conversion.SafeValue(input.Enabled)), ReadPreference: types.StringValue(conversion.SafeValue(input.ReadPreference)), } - listType, diagsLocal := types.ListValueFrom(ctx, BiConnectorConfigObjType, []TFBiConnectorModel{tfModel}) + objType, diagsLocal := types.ObjectValueFrom(ctx, BiConnectorConfigObjType.AttrTypes, tfModel) diags.Append(diagsLocal...) - return listType + return objType } func NewConnectionStringsObjType(ctx context.Context, input *admin.ClusterConnectionStrings, diags *diag.Diagnostics) types.Object { diff --git a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go index 15d097c664..ff14a68650 100644 --- a/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go +++ b/internal/service/advancedclustertpf/model_ClusterDescriptionProcessArgs20240805.go @@ -46,7 +46,7 @@ func AddAdvancedConfig(ctx context.Context, tfModel *TFModel, input *admin.Clust TransactionLifetimeLimitSeconds: types.Int64Value(conversion.SafeValue(input.TransactionLifetimeLimitSeconds)), } } - listType, diagsLocal := types.ListValueFrom(ctx, AdvancedConfigurationObjType, []TFAdvancedConfigurationModel{advancedConfig}) + objType, diagsLocal := types.ObjectValueFrom(ctx, AdvancedConfigurationObjType.AttrTypes, advancedConfig) diags.Append(diagsLocal...) - tfModel.AdvancedConfiguration = listType + tfModel.AdvancedConfiguration = objType } diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index 80d1420e98..a0bf99fc5a 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -45,16 +45,21 @@ func NewAtlasReq(ctx context.Context, input *TFModel, diags *diag.Diagnostics) * VersionReleaseSystem: conversion.NilForUnknown(input.VersionReleaseSystem, input.VersionReleaseSystem.ValueStringPointer()), } } - -func newBiConnector(ctx context.Context, input types.List, diags *diag.Diagnostics) *admin.BiConnector { - return conversion.SingleListTFToSDK(ctx, diags, &input, func(tf TFBiConnectorModel) *admin.BiConnector { - return &admin.BiConnector{ - Enabled: conversion.NilForUnknown(tf.Enabled, tf.Enabled.ValueBoolPointer()), - ReadPreference: conversion.NilForUnknown(tf.ReadPreference, tf.ReadPreference.ValueStringPointer()), - } - }) +func newBiConnector(ctx context.Context, input types.Object, diags *diag.Diagnostics) *admin.BiConnector { + var resp *admin.BiConnector + if input.IsUnknown() || input.IsNull() { + return resp + } + item := &TFBiConnectorModel{} + if localDiags := input.As(ctx, item, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { + diags.Append(localDiags...) + return resp + } + return &admin.BiConnector{ + Enabled: conversion.NilForUnknown(item.Enabled, item.Enabled.ValueBoolPointer()), + ReadPreference: conversion.NilForUnknown(item.ReadPreference, item.ReadPreference.ValueStringPointer()), + } } - func newComponentLabel(ctx context.Context, input types.Set, diags *diag.Diagnostics) *[]admin.ComponentLabel { if input.IsUnknown() { return nil diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go index 79dc88c1a5..f23ff302f8 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgs20240805.go @@ -5,23 +5,31 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "go.mongodb.org/atlas-sdk/v20241113003/admin" ) -func NewAtlasReqAdvancedConfiguration(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805 { - return conversion.SingleListTFToSDK(ctx, diags, input, func(tf TFAdvancedConfigurationModel) *admin.ClusterDescriptionProcessArgs20240805 { - return &admin.ClusterDescriptionProcessArgs20240805{ - ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.NilForUnknown(tf.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds, conversion.Int64PtrToIntPtr(tf.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds.ValueInt64Pointer())), - DefaultWriteConcern: conversion.NilForUnknown(tf.DefaultWriteConcern, tf.DefaultWriteConcern.ValueStringPointer()), - JavascriptEnabled: conversion.NilForUnknown(tf.JavascriptEnabled, tf.JavascriptEnabled.ValueBoolPointer()), - MinimumEnabledTlsProtocol: conversion.NilForUnknown(tf.MinimumEnabledTlsProtocol, tf.MinimumEnabledTlsProtocol.ValueStringPointer()), - NoTableScan: conversion.NilForUnknown(tf.NoTableScan, tf.NoTableScan.ValueBoolPointer()), - OplogMinRetentionHours: conversion.NilForUnknown(tf.OplogMinRetentionHours, tf.OplogMinRetentionHours.ValueFloat64Pointer()), - OplogSizeMB: conversion.NilForUnknown(tf.OplogSizeMb, conversion.Int64PtrToIntPtr(tf.OplogSizeMb.ValueInt64Pointer())), - SampleRefreshIntervalBIConnector: conversion.NilForUnknown(tf.SampleRefreshIntervalBiconnector, conversion.Int64PtrToIntPtr(tf.SampleRefreshIntervalBiconnector.ValueInt64Pointer())), - SampleSizeBIConnector: conversion.NilForUnknown(tf.SampleSizeBiconnector, conversion.Int64PtrToIntPtr(tf.SampleSizeBiconnector.ValueInt64Pointer())), - TransactionLifetimeLimitSeconds: conversion.NilForUnknown(tf.TransactionLifetimeLimitSeconds, tf.TransactionLifetimeLimitSeconds.ValueInt64Pointer()), - } - }) +func NewAtlasReqAdvancedConfiguration(ctx context.Context, objInput *types.Object, diags *diag.Diagnostics) *admin.ClusterDescriptionProcessArgs20240805 { + var resp *admin.ClusterDescriptionProcessArgs20240805 + if objInput == nil || objInput.IsUnknown() || objInput.IsNull() { + return resp + } + input := &TFAdvancedConfigurationModel{} + if localDiags := objInput.As(ctx, input, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { + diags.Append(localDiags...) + return resp + } + return &admin.ClusterDescriptionProcessArgs20240805{ + ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds: conversion.NilForUnknown(input.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds, conversion.Int64PtrToIntPtr(input.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds.ValueInt64Pointer())), + DefaultWriteConcern: conversion.NilForUnknown(input.DefaultWriteConcern, input.DefaultWriteConcern.ValueStringPointer()), + JavascriptEnabled: conversion.NilForUnknown(input.JavascriptEnabled, input.JavascriptEnabled.ValueBoolPointer()), + MinimumEnabledTlsProtocol: conversion.NilForUnknown(input.MinimumEnabledTlsProtocol, input.MinimumEnabledTlsProtocol.ValueStringPointer()), + NoTableScan: conversion.NilForUnknown(input.NoTableScan, input.NoTableScan.ValueBoolPointer()), + OplogMinRetentionHours: conversion.NilForUnknown(input.OplogMinRetentionHours, input.OplogMinRetentionHours.ValueFloat64Pointer()), + OplogSizeMB: conversion.NilForUnknown(input.OplogSizeMb, conversion.Int64PtrToIntPtr(input.OplogSizeMb.ValueInt64Pointer())), + SampleRefreshIntervalBIConnector: conversion.NilForUnknown(input.SampleRefreshIntervalBiconnector, conversion.Int64PtrToIntPtr(input.SampleRefreshIntervalBiconnector.ValueInt64Pointer())), + SampleSizeBIConnector: conversion.NilForUnknown(input.SampleSizeBiconnector, conversion.Int64PtrToIntPtr(input.SampleSizeBiconnector.ValueInt64Pointer())), + TransactionLifetimeLimitSeconds: conversion.NilForUnknown(input.TransactionLifetimeLimitSeconds, input.TransactionLifetimeLimitSeconds.ValueInt64Pointer()), + } } diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go index 7d168dabd2..cd8f3f60c8 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescriptionProcessArgsLegacy.go @@ -5,16 +5,24 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin" ) -func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, input *types.List, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs { - return conversion.SingleListTFToSDK(ctx, diags, input, func(tf TFAdvancedConfigurationModel) *admin20240530.ClusterDescriptionProcessArgs { - // Choosing to only handle legacy fields in the old API - return &admin20240530.ClusterDescriptionProcessArgs{ - DefaultReadConcern: conversion.NilForUnknown(tf.DefaultReadConcern, tf.DefaultReadConcern.ValueStringPointer()), - FailIndexKeyTooLong: conversion.NilForUnknown(tf.FailIndexKeyTooLong, tf.FailIndexKeyTooLong.ValueBoolPointer()), - } - }) +func NewAtlasReqAdvancedConfigurationLegacy(ctx context.Context, objInput *types.Object, diags *diag.Diagnostics) *admin20240530.ClusterDescriptionProcessArgs { + var resp *admin20240530.ClusterDescriptionProcessArgs + if objInput == nil || objInput.IsUnknown() || objInput.IsNull() { + return resp + } + input := &TFAdvancedConfigurationModel{} + if localDiags := objInput.As(ctx, input, basetypes.ObjectAsOptions{}); len(localDiags) > 0 { + diags.Append(localDiags...) + return resp + } + // Choosing to only handle legacy fields in the old API + return &admin20240530.ClusterDescriptionProcessArgs{ + DefaultReadConcern: conversion.NilForUnknown(input.DefaultReadConcern, input.DefaultReadConcern.ValueStringPointer()), + FailIndexKeyTooLong: conversion.NilForUnknown(input.FailIndexKeyTooLong, input.FailIndexKeyTooLong.ValueBoolPointer()), + } } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index cf52887347..97adefc7bb 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -77,7 +77,6 @@ func (r *rs) Create(ctx context.Context, req resource.CreateRequest, resp *resou } model := r.createCluster(ctx, &plan, diags) if model != nil { - overrideAttributesWithPlanValue(model, &plan) diags.Append(resp.State.Set(ctx, model)...) } } @@ -91,7 +90,6 @@ func (r *rs) Read(ctx context.Context, req resource.ReadRequest, resp *resource. } model := r.readCluster(ctx, diags, &state, &resp.State) if model != nil { - overrideAttributesWithPlanValue(model, &state) diags.Append(resp.State.Set(ctx, model)...) } } @@ -169,7 +167,6 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou } else { modelOut.AdvancedConfiguration = state.AdvancedConfiguration } - overrideAttributesWithPlanValue(modelOut, &plan) diags.Append(resp.State.Set(ctx, modelOut)...) } @@ -467,6 +464,7 @@ func getBasicClusterModel(ctx context.Context, diags *diag.Diagnostics, client * if diags.HasError() { return nil, nil } + overrideAttributesWithPrevStateValue(modelIn, modelOut) return modelOut, extraInfo } diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index 4f3a2d4841..ff8a877d55 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -13,7 +13,7 @@ import ( "go.mongodb.org/atlas-sdk/v20241113003/admin" ) -func overrideAttributesWithPlanValue(modelOut, modelIn *TFModel) { +func overrideAttributesWithPrevStateValue(modelIn, modelOut *TFModel) { beforeVersion := conversion.NilForUnknown(modelIn.MongoDBMajorVersion, modelIn.MongoDBMajorVersion.ValueStringPointer()) if beforeVersion != nil && !modelIn.MongoDBMajorVersion.Equal(modelOut.MongoDBMajorVersion) { modelOut.MongoDBMajorVersion = types.StringPointerValue(beforeVersion) @@ -22,13 +22,6 @@ func overrideAttributesWithPlanValue(modelOut, modelIn *TFModel) { if retainBackups != nil && !modelIn.RetainBackupsEnabled.Equal(modelOut.RetainBackupsEnabled) { modelOut.RetainBackupsEnabled = types.BoolPointerValue(retainBackups) } - // Blocks can't be included if not in the config - if modelIn.AdvancedConfiguration.IsNull() { - modelOut.AdvancedConfiguration = types.ListNull(AdvancedConfigurationObjType) - } - if modelIn.BiConnectorConfig.IsNull() { - modelOut.BiConnectorConfig = types.ListNull(BiConnectorConfigObjType) - } } func findNumShardsUpdates(ctx context.Context, state, plan *TFModel, diags *diag.Diagnostics) map[string]int64 { diff --git a/internal/service/advancedclustertpf/resource_test_cases_test.go b/internal/service/advancedclustertpf/resource_test_cases_test.go index 056c352fc2..335c2793c8 100644 --- a/internal/service/advancedclustertpf/resource_test_cases_test.go +++ b/internal/service/advancedclustertpf/resource_test_cases_test.go @@ -333,7 +333,7 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { clusterName = acc.RandomClusterName() fullUpdate = ` backup_enabled = true - bi_connector_config { + bi_connector_config = { enabled = true } # config_server_management_mode = "ATLAS_MANAGED" UNSTABLE: After applying this test step, the non-refresh plan was not empty @@ -354,7 +354,7 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { # termination_protection_enabled = true # must be reset to false to enable delete version_release_system = "CONTINUOUS" - advanced_configuration { + advanced_configuration = { change_stream_options_pre_and_post_images_expire_after_seconds = 100 default_read_concern = "available" default_write_concern = "majority" @@ -385,11 +385,10 @@ func replicasetAdvConfigUpdate(t *testing.T) *resource.TestCase { Config: configBasic(projectID, clusterName, fullUpdate), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "mongo_db_major_version", "8.0"), - resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.change_stream_options_pre_and_post_images_expire_after_seconds", "100"), ), }, - // These ignored fields are blocks so can't be included if not in the config - acc.TestStepImportCluster(resourceName, "advanced_configuration", "bi_connector_config"), + acc.TestStepImportCluster(resourceName), }, } } diff --git a/internal/service/advancedclustertpf/schema.go b/internal/service/advancedclustertpf/schema.go index ad685e5517..f262de0155 100644 --- a/internal/service/advancedclustertpf/schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" - "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" dsschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" @@ -34,6 +33,23 @@ func resourceSchema(ctx context.Context) schema.Schema { Optional: true, MarkdownDescription: "Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses [Cloud Backups](https://docs.atlas.mongodb.com/backup/cloud-backup/overview/) for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups.", }, + "bi_connector_config": schema.SingleNestedAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster.", + Attributes: map[string]schema.Attribute{ + "enabled": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster.", + }, + "read_preference": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes.", + }, + }, + }, "cluster_type": schema.StringAttribute{ Required: true, MarkdownDescription: "Configuration of nodes that comprise the cluster.", @@ -276,6 +292,7 @@ func resourceSchema(ctx context.Context) schema.Schema { Optional: true, MarkdownDescription: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier.", }, + "advanced_configuration": AdvancedConfigurationSchema(ctx), "pinned_fcv": schema.SingleNestedAttribute{ Optional: true, MarkdownDescription: "Pins the Feature Compatibility Version (FCV) to the current MongoDB version with a provided expiration date. To unpin the FCV the `pinned_fcv` attribute must be removed. This operation can take several minutes as the request processes through the MongoDB data plane. Once FCV is unpinned it will not be possible to downgrade the `mongo_db_major_version`. It is advised that updates to `pinned_fcv` are done isolated from other cluster changes. If a plan contains multiple changes, the FCV change will be applied first. If FCV is unpinned past the expiration date the `pinned_fcv` attribute must be removed. The following [knowledge hub article](https://kb.corp.mongodb.com/article/000021785/) and [FCV documentation](https://www.mongodb.com/docs/atlas/tutorial/major-version-change/#manage-feature-compatibility--fcv--during-upgrades) can be referenced for more details.", @@ -297,105 +314,6 @@ func resourceSchema(ctx context.Context) schema.Schema { }), }, Blocks: map[string]schema.Block{ - "advanced_configuration": schema.ListNestedBlock{ - MarkdownDescription: "advanced_configuration", // TODO: add description - Validators: []validator.List{ - listvalidator.SizeAtMost(1), - }, - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "change_stream_options_pre_and_post_images_expire_after_seconds": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "The minimum pre- and post-image retention time in seconds.", - Default: int64default.StaticInt64(-1), // in case the user removes the value, we should set it to -1, a special value used by the backend to use its default behavior - PlanModifiers: []planmodifier.Int64{ - PlanMustUseMongoDBVersion(7.0, EqualOrHigher), - }, - }, - "default_write_concern": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Default level of acknowledgment requested from MongoDB for write operations when none is specified by the driver.", - }, - "javascript_enabled": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript. When using 8.0+, we recommend disabling server-side JavaScript and using operators of aggregation pipeline as more performant alternative.", - }, - "minimum_enabled_tls_protocol": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version.", - }, - "no_table_scan": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results.", - }, - "oplog_min_retention_hours": schema.Float64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates.", - }, - "oplog_size_mb": schema.Int64Attribute{ - Computed: true, - Optional: true, - Validators: []validator.Int64{ - int64validator.AtLeast(0), - }, - MarkdownDescription: "Storage limit of cluster's oplog expressed in megabytes. A value of null indicates that the cluster uses the default oplog size that MongoDB Cloud calculates.", - }, - "sample_refresh_interval_bi_connector": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Interval in seconds at which the mongosqld process re-samples data to create its relational schema.", - }, - "sample_size_bi_connector": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Number of documents per database to sample when gathering schema information.", - }, - "transaction_lifetime_limit_seconds": schema.Int64Attribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process.", - }, - "default_read_concern": schema.StringAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, - Computed: true, - Optional: true, - MarkdownDescription: "default_read_concern", // TODO: add description - }, - "fail_index_key_too_long": schema.BoolAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, - Computed: true, - Optional: true, - MarkdownDescription: "fail_index_key_too_long", // TODO: add description - }, - }, - }, - }, - "bi_connector_config": schema.ListNestedBlock{ - MarkdownDescription: "Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster.", - Validators: []validator.List{ - listvalidator.SizeAtMost(1), - }, - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "enabled": schema.BoolAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster.", - }, - "read_preference": schema.StringAttribute{ - Computed: true, - Optional: true, - MarkdownDescription: "Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes.", - }, - }, - }, - }, "labels": schema.SetNestedBlock{ MarkdownDescription: "Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels.\n\nCluster labels are deprecated and will be removed in a future release. We strongly recommend that you use [resource tags](https://dochub.mongodb.org/core/add-cluster-tag-atlas) instead.", NestedObject: schema.NestedBlockObject{ @@ -534,6 +452,85 @@ func SpecsSchema(markdownDescription string) schema.SingleNestedAttribute { } } +func AdvancedConfigurationSchema(ctx context.Context) schema.SingleNestedAttribute { + return schema.SingleNestedAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "advanced_configuration", // TODO: add description + Attributes: map[string]schema.Attribute{ + "change_stream_options_pre_and_post_images_expire_after_seconds": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The minimum pre- and post-image retention time in seconds.", + Default: int64default.StaticInt64(-1), // in case the user removes the value, we should set it to -1, a special value used by the backend to use its default behavior + PlanModifiers: []planmodifier.Int64{ + PlanMustUseMongoDBVersion(7.0, EqualOrHigher), + }, + }, + "default_write_concern": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Default level of acknowledgment requested from MongoDB for write operations when none is specified by the driver.", + }, + "javascript_enabled": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript. When using 8.0+, we recommend disabling server-side JavaScript and using operators of aggregation pipeline as more performant alternative.", + }, + "minimum_enabled_tls_protocol": schema.StringAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version.", + }, + "no_table_scan": schema.BoolAttribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results.", + }, + "oplog_min_retention_hours": schema.Float64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates.", + }, + "oplog_size_mb": schema.Int64Attribute{ + Optional: true, + Computed: true, + Validators: []validator.Int64{ + int64validator.AtLeast(0), + }, + MarkdownDescription: "Storage limit of cluster's oplog expressed in megabytes. A value of null indicates that the cluster uses the default oplog size that MongoDB Cloud calculates.", + }, + "sample_refresh_interval_bi_connector": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Interval in seconds at which the mongosqld process re-samples data to create its relational schema.", + }, + "sample_size_bi_connector": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Number of documents per database to sample when gathering schema information.", + }, + "transaction_lifetime_limit_seconds": schema.Int64Attribute{ + Computed: true, + Optional: true, + MarkdownDescription: "Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process.", + }, + "default_read_concern": schema.StringAttribute{ + DeprecationMessage: DeprecationMsgOldSchema, + Computed: true, + Optional: true, + MarkdownDescription: "default_read_concern", // TODO: add description + }, + "fail_index_key_too_long": schema.BoolAttribute{ + DeprecationMessage: DeprecationMsgOldSchema, + Computed: true, + Optional: true, + MarkdownDescription: "fail_index_key_too_long", // TODO: add description + }, + }, + } +} + type TFModel struct { DiskSizeGB types.Float64 `tfsdk:"disk_size_gb"` Labels types.Set `tfsdk:"labels"` @@ -552,12 +549,12 @@ type TFModel struct { MongoDBVersion types.String `tfsdk:"mongo_db_version"` Name types.String `tfsdk:"name"` VersionReleaseSystem types.String `tfsdk:"version_release_system"` - BiConnectorConfig types.List `tfsdk:"bi_connector_config"` + BiConnectorConfig types.Object `tfsdk:"bi_connector_config"` ConfigServerType types.String `tfsdk:"config_server_type"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` ClusterType types.String `tfsdk:"cluster_type"` RootCertType types.String `tfsdk:"root_cert_type"` - AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` + AdvancedConfiguration types.Object `tfsdk:"advanced_configuration"` PinnedFCV types.Object `tfsdk:"pinned_fcv"` TerminationProtectionEnabled types.Bool `tfsdk:"termination_protection_enabled"` Paused types.Bool `tfsdk:"paused"` @@ -576,8 +573,8 @@ type TFModelDS struct { Tags types.Set `tfsdk:"tags"` ReplicaSetScalingStrategy types.String `tfsdk:"replica_set_scaling_strategy"` Name types.String `tfsdk:"name"` - AdvancedConfiguration types.List `tfsdk:"advanced_configuration"` - BiConnectorConfig types.List `tfsdk:"bi_connector_config"` + AdvancedConfiguration types.Object `tfsdk:"advanced_configuration"` + BiConnectorConfig types.Object `tfsdk:"bi_connector_config"` RootCertType types.String `tfsdk:"root_cert_type"` ClusterType types.String `tfsdk:"cluster_type"` MongoDBMajorVersion types.String `tfsdk:"mongo_db_major_version"` diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml index 48a70895fd..f8b157a51d 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate.yaml @@ -161,7 +161,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} method: PATCH version: '2024-10-23' - text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" + text: "{\n \"backupEnabled\": true,\n \"biConnector\": {\n \"enabled\": true,\n \"readPreference\": \"secondary\"\n },\n \"labels\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"pitEnabled\": true,\n \"redactClientLogData\": true,\n \"replicaSetScalingStrategy\": \"NODE_TYPE\",\n \"tags\": [\n {\n \"key\": \"env\",\n \"value\": \"test\"\n }\n ],\n \"versionReleaseSystem\": \"CONTINUOUS\"\n}" responses: - response_index: 34 status: 200 @@ -169,7 +169,7 @@ steps: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs method: PATCH version: '2024-08-05' - text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"javascriptEnabled\": true,\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" + text: "{\n \"changeStreamOptionsPreAndPostImagesExpireAfterSeconds\": 100,\n \"defaultWriteConcern\": \"majority\",\n \"minimumEnabledTlsProtocol\": \"TLS1_0\",\n \"noTableScan\": true,\n \"sampleRefreshIntervalBIConnector\": 310,\n \"sampleSizeBIConnector\": 110,\n \"transactionLifetimeLimitSeconds\": 300\n}" responses: - response_index: 41 status: 200 diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json index c80592bd94..f3b9f55a0a 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_01_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-10-23.json @@ -1,7 +1,8 @@ { "backupEnabled": true, "biConnector": { - "enabled": true + "enabled": true, + "readPreference": "secondary" }, "labels": [ { diff --git a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json index fa21da6b1a..602856e979 100644 --- a/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json +++ b/internal/service/advancedclustertpf/testdata/TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate/02_02_PATCH__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json @@ -1,7 +1,6 @@ { "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": 100, "defaultWriteConcern": "majority", - "javascriptEnabled": true, "minimumEnabledTlsProtocol": "TLS1_0", "noTableScan": true, "sampleRefreshIntervalBIConnector": 310, diff --git a/internal/testutil/acc/advanced_cluster_schema_v2.go b/internal/testutil/acc/advanced_cluster_schema_v2.go index e458456eb9..3a49779ca5 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2.go @@ -69,6 +69,8 @@ var tpfSingleNestedAttrs = []string{ "electable_specs", "read_only_specs", "auto_scaling", // includes analytics_auto_scaling + "advanced_configuration", + "bi_connector_config", "pinned_fcv", } @@ -96,6 +98,8 @@ func ConvertAdvancedClusterToSchemaV2(t *testing.T, isAcc bool, def string) stri } writeBody := resource.Body() convertAttrs(t, "replication_specs", writeBody, true, getReplicationSpecs) + convertAttrs(t, "advanced_configuration", writeBody, false, hcl.GetAttrVal) + convertAttrs(t, "bi_connector_config", writeBody, false, hcl.GetAttrVal) } content := parse.Bytes() return string(content) diff --git a/internal/testutil/acc/advanced_cluster_schema_v2_test.go b/internal/testutil/acc/advanced_cluster_schema_v2_test.go index 8bdf6d0a60..e5faab26f6 100644 --- a/internal/testutil/acc/advanced_cluster_schema_v2_test.go +++ b/internal/testutil/acc/advanced_cluster_schema_v2_test.go @@ -14,18 +14,18 @@ func TestConvertToSchemaV2AttrsMapAndAttrsSet(t *testing.T) { t.Skip("Skipping test as not in AdvancedClusterV2Schema") } attrsMap := map[string]string{ - "attr": "val1", - "electable_specs.0": "val2", - "prefixauto_scaling.0": "val3", - "electable_specs.0postfix": "val4", - "electable_specs.0auto_scaling.0auto_scaling.0": "val5", + "attr": "val1", + "electable_specs.0": "val2", + "prefixbi_connector_config.0": "val3", + "advanced_configuration.0postfix": "val4", + "electable_specs.0advanced_configuration.0bi_connector_config.0": "val5", } expectedMap := map[string]string{ - "attr": "val1", - "electable_specs": "val2", - "prefixauto_scaling": "val3", - "electable_specspostfix": "val4", - "electable_specsauto_scalingauto_scaling": "val5", + "attr": "val1", + "electable_specs": "val2", + "prefixbi_connector_config": "val3", + "advanced_configurationpostfix": "val4", + "electable_specsadvanced_configurationbi_connector_config": "val5", } actualMap := acc.ConvertToSchemaV2AttrsMap(true, attrsMap) assert.Equal(t, expectedMap, actualMap) @@ -178,22 +178,7 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { value = "Value Label 3" } - advanced_configuration { - fail_index_key_too_long = false - javascript_enabled = true - minimum_enabled_tls_protocol = "TLS1_1" - no_table_scan = false - oplog_size_mb = 1000 - sample_size_bi_connector = 110 - sample_refresh_interval_bi_connector = 310 - transaction_lifetime_limit_seconds = 300 - change_stream_options_pre_and_post_images_expire_after_seconds = 100 - } - bi_connector_config { - enabled = true - read_preference = "secondary" - } replication_specs = [{ region_configs = [{ analytics_specs = { @@ -236,6 +221,21 @@ func TestConvertAdvancedClusterToSchemaV2(t *testing.T) { region_name = "EU_WEST_1" }] }] + advanced_configuration = { + change_stream_options_pre_and_post_images_expire_after_seconds = 100 + fail_index_key_too_long = false + javascript_enabled = true + minimum_enabled_tls_protocol = "TLS1_1" + no_table_scan = false + oplog_size_mb = 1000 + sample_refresh_interval_bi_connector = 310 + sample_size_bi_connector = 110 + transaction_lifetime_limit_seconds = 300 + } + bi_connector_config = { + enabled = true + read_preference = "secondary" + } } ` ) From 382907158599e6dfcc73079e180b63500b2f3005 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:36:54 +0100 Subject: [PATCH 34/40] chore: Bump actions/setup-go from 5.1.0 to 5.2.0 (#2906) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.1.0 to 5.2.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed...3041bf56c941b39c61721a86cd11f3bb1338122a) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/acceptance-tests-runner.yml | 50 +++++++++---------- .../workflows/check-changelog-entry-file.yml | 2 +- .github/workflows/code-health.yml | 6 +-- .github/workflows/examples.yml | 4 +- .github/workflows/jira-release-version.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/run-script-and-commit.yml | 2 +- .github/workflows/update-sdk.yml | 2 +- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 5eb9232b82..347385e7ed 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -334,7 +334,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -358,7 +358,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -402,7 +402,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -426,7 +426,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -466,7 +466,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -504,7 +504,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -526,7 +526,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -548,7 +548,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -570,7 +570,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -616,7 +616,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -652,7 +652,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -674,7 +674,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -712,7 +712,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -736,7 +736,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -763,7 +763,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -785,7 +785,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -814,7 +814,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -836,7 +836,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -881,7 +881,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -919,7 +919,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -944,7 +944,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -971,7 +971,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -993,7 +993,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -1015,7 +1015,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -1041,7 +1041,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.ref || github.ref }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd diff --git a/.github/workflows/check-changelog-entry-file.yml b/.github/workflows/check-changelog-entry-file.yml index e83f27cd4c..80f5896211 100644 --- a/.github/workflows/check-changelog-entry-file.yml +++ b/.github/workflows/check-changelog-entry-file.yml @@ -14,7 +14,7 @@ jobs: permissions: {} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - run: make check-changelog-entry-file diff --git a/.github/workflows/code-health.yml b/.github/workflows/code-health.yml index a0717564e9..5a3a8b35d4 100644 --- a/.github/workflows/code-health.yml +++ b/.github/workflows/code-health.yml @@ -18,7 +18,7 @@ jobs: permissions: {} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - name: Build @@ -30,7 +30,7 @@ jobs: pull-requests: write # Needed by sticky-pull-request-comment steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - name: Unit Test @@ -42,7 +42,7 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: Install Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index fd1f4afff1..5818a33824 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -18,7 +18,7 @@ jobs: permissions: {} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd @@ -32,7 +32,7 @@ jobs: permissions: {} steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - name: tflint diff --git a/.github/workflows/jira-release-version.yml b/.github/workflows/jira-release-version.yml index 0ca985de78..88144d5d0f 100644 --- a/.github/workflows/jira-release-version.yml +++ b/.github/workflows/jira-release-version.yml @@ -24,7 +24,7 @@ jobs: - name: Validation of version format, no pre-releases run: | echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+$' - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - run: make jira-release-version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3350c10d4f..65bbfe32f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -135,7 +135,7 @@ jobs: with: ref: ${{ inputs.version_number }} - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - name: Import GPG key diff --git a/.github/workflows/run-script-and-commit.yml b/.github/workflows/run-script-and-commit.yml index 23d1212210..e3fcedbe57 100644 --- a/.github/workflows/run-script-and-commit.yml +++ b/.github/workflows/run-script-and-commit.yml @@ -33,7 +33,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.apix_bot_pat }} - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' diff --git a/.github/workflows/update-sdk.yml b/.github/workflows/update-sdk.yml index 33c5e88a62..c3cd565210 100644 --- a/.github/workflows/update-sdk.yml +++ b/.github/workflows/update-sdk.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: go-version-file: 'go.mod' - name: Update files From 4ca88fcd2a7d45673729ba800aebef50dc431f86 Mon Sep 17 00:00:00 2001 From: svc-apix-Bot <142542575+svc-apix-Bot@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:21:00 +0100 Subject: [PATCH 35/40] chore: Updates repository to use supported Terraform versions (#2912) Co-authored-by: maastha <122359335+maastha@users.noreply.github.com> --- .tool-versions | 2 +- scripts/generate-doc.sh | 2 +- scripts/generate-docs-all.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.tool-versions b/.tool-versions index 6650ebad8f..e6fbd6d1a3 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -terraform 1.10.2 +terraform 1.10.3 diff --git a/scripts/generate-doc.sh b/scripts/generate-doc.sh index cfc7c05d20..118ba7f4df 100755 --- a/scripts/generate-doc.sh +++ b/scripts/generate-doc.sh @@ -32,7 +32,7 @@ set -euo pipefail -TF_VERSION="${TF_VERSION:-"1.10.2"}" # TF version to use when running tfplugindocs. Default: 1.10.2 +TF_VERSION="${TF_VERSION:-"1.10.3"}" # TF version to use when running tfplugindocs. Default: 1.10.3 TEMPLATE_FOLDER_PATH="${TEMPLATE_FOLDER_PATH:-"templates"}" # PATH to the templates folder. Default: templates diff --git a/scripts/generate-docs-all.sh b/scripts/generate-docs-all.sh index 99f52f8604..01ab28def4 100755 --- a/scripts/generate-docs-all.sh +++ b/scripts/generate-docs-all.sh @@ -26,7 +26,7 @@ set -euo pipefail -TF_VERSION="${TF_VERSION:-"1.10.2"}" # TF version to use when running tfplugindocs. Default: 1.10.2 +TF_VERSION="${TF_VERSION:-"1.10.3"}" # TF version to use when running tfplugindocs. Default: 1.10.3 TEMPLATE_FOLDER_PATH="${TEMPLATE_FOLDER_PATH:-"templates"}" # PATH to the templates folder. Default: templates # ensure preview resource and data sources are also included during generation From f668cba051270dcbc3817e0c0e41853ec982cb5c Mon Sep 17 00:00:00 2001 From: maastha <122359335+maastha@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:14:41 +0000 Subject: [PATCH 36/40] fix assertion (#2920) --- .../advancedcluster/resource_advanced_cluster_migration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go index 353ac866c0..9fbfc16488 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_migration_test.go @@ -226,7 +226,7 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.default_max_time_ms", "65"), resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.tls_cipher_config_mode", "CUSTOM"), - resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "2"), + resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.custom_openssl_cipher_config_tls12.#", "1"), resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.enabled", "false"), resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.read_preference", "secondary"), ), From 5504e20c15cc9dbd8ba371d453dee01e41c6eabb Mon Sep 17 00:00:00 2001 From: Oriol Date: Mon, 23 Dec 2024 14:22:14 +0100 Subject: [PATCH 37/40] feat: Supports new `networking` attribute in `mongodbatlas_stream_connection` (#2474) * support new networking attribute in stream connection * add changelog entry * fix unit tests * documentation * fix migration tests * include netwerking in examples for stream_connection * improve changelog entry * include acces.name attribute in model unit tests * fix: add PlanModifiers to avoid unexpected plan changes * test: refactor the kafkaStreamConnectionConfig and use normal `mig.CreateAndRunTest` * test: refactor `testCaseCluster` and re-use in migration test * test: improve check using actual name * chore: add revertable commit to avoid pending resources in CI * refactor: remove `networking.access.name` attribute (tests will fail until blocked issue is resolved) * chore: remove name also from data source schema * test: fix wrong parameter for kafkaNetworking * clean up test after merge * move into var block * address PR comments * test: remove old sleep function from stream connection tests * test: refactor networking.access.type check to all test cases * test: conditionally check networking.access.type based on provider version * feat: implement DeleteStreamConnection with retry logic and add tests --------- Co-authored-by: EspenAlbert --- .changelog/2474.txt | 11 +++ docs/data-sources/stream_connection.md | 8 ++ docs/data-sources/stream_connections.md | 8 ++ docs/resources/stream_connection.md | 8 ++ .../mongodbatlas_stream_connection/main.tf | 5 + .../data_source_stream_connection_test.go | 8 +- .../data_source_stream_connections_test.go | 4 +- .../model_stream_connection.go | 25 +++++ .../model_stream_connection_test.go | 27 ++++++ .../streamconnection/resource_schema.go | 21 +++++ .../resource_stream_connection.go | 23 ++++- ...source_stream_connection_migration_test.go | 65 +------------ .../resource_stream_connection_test.go | 92 ++++++++++++++++--- .../streamconnection/state_transition.go | 25 +++++ .../streamconnection/state_transition_test.go | 51 ++++++++++ 15 files changed, 295 insertions(+), 86 deletions(-) create mode 100644 .changelog/2474.txt create mode 100644 internal/service/streamconnection/state_transition.go create mode 100644 internal/service/streamconnection/state_transition_test.go diff --git a/.changelog/2474.txt b/.changelog/2474.txt new file mode 100644 index 0000000000..fc7943c4a1 --- /dev/null +++ b/.changelog/2474.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/mongodbatlas_stream_connection: Adds `networking` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_stream_connection: Adds `networking` attribute +``` + +```release-note:enhancement +data-source/mongodbatlas_stream_connections: Adds `networking` attribute +``` \ No newline at end of file diff --git a/docs/data-sources/stream_connection.md b/docs/data-sources/stream_connection.md index 242837f186..9085f16cb2 100644 --- a/docs/data-sources/stream_connection.md +++ b/docs/data-sources/stream_connection.md @@ -31,6 +31,7 @@ If `type` is of value `Kafka` the following additional attributes are defined: * `bootstrap_servers` - Comma separated list of server addresses. * `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. * `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security). +* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking). ### Authentication @@ -48,5 +49,12 @@ If `type` is of value `Kafka` the following additional attributes are defined: * `role` - The name of the role to use. Can be a built in role or a custom role. * `type` - Type of the DB role. Can be either BUILT_IN or CUSTOM. +### Networking +* `access` - Information about the networking access. See [access](#access). + +### Access +* `name` - Id of the vpc peer when the type is `VPC`. +* `type` - Selected networking type. Either `PUBLIC` or `VPC`. Defaults to `PUBLIC`. + To learn more, see: [MongoDB Atlas API - Stream Connection](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/getStreamConnection) Documentation. The [Terraform Provider Examples Section](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/examples/mongodbatlas_stream_instance/atlas-streams-user-journey.md) also contains details on the overall support for Atlas Streams Processing in Terraform. diff --git a/docs/data-sources/stream_connections.md b/docs/data-sources/stream_connections.md index 6bdbfe2261..c25ee9a7b4 100644 --- a/docs/data-sources/stream_connections.md +++ b/docs/data-sources/stream_connections.md @@ -43,6 +43,7 @@ If `type` is of value `Kafka` the following additional attributes are defined: * `bootstrap_servers` - Comma separated list of server addresses. * `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. * `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security). +* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking). ### Authentication @@ -60,5 +61,12 @@ If `type` is of value `Kafka` the following additional attributes are defined: * `role` - The name of the role to use. Can be a built in role or a custom role. * `type` - Type of the DB role. Can be either BUILT_IN or CUSTOM. +### Networking +* `access` - Information about the networking access. See [access](#access). + +### Access +* `name` - Id of the vpc peer when the type is `VPC`. +* `type` - Networking type. Either `PUBLIC` or `VPC`. Default is `PUBLIC`. + To learn more, see: [MongoDB Atlas API - Stream Connection](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Streams/operation/listStreamConnections) Documentation. The [Terraform Provider Examples Section](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/examples/mongodbatlas_stream_instance/atlas-streams-user-journey.md) also contains details on the overall support for Atlas Streams Processing in Terraform. diff --git a/docs/resources/stream_connection.md b/docs/resources/stream_connection.md index 9fd9d50454..b97b4de655 100644 --- a/docs/resources/stream_connection.md +++ b/docs/resources/stream_connection.md @@ -82,6 +82,7 @@ If `type` is of value `Kafka` the following additional arguments are defined: * `bootstrap_servers` - Comma separated list of server addresses. * `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. * `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security). +* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking). ### Authentication @@ -99,6 +100,13 @@ If `type` is of value `Kafka` the following additional arguments are defined: * `role` - The name of the role to use. Value can be `atlasAdmin`, `readWriteAnyDatabase`, or `readAnyDatabase` if `type` is set to `BUILT_IN`, or the name of a user-defined role if `type` is set to `CUSTOM`. * `type` - Type of the DB role. Can be either BUILT_IN or CUSTOM. +### Networking +* `access` - Information about the networking access. See [access](#access). + +### Access +* `name` - Id of the vpc peer when the type is `VPC`. +* `type` - Selected networking type. Either `PUBLIC` or `VPC`. Defaults to `PUBLIC`. + ## Import You can import a stream connection resource using the instance name, project ID, and connection name. The format must be `INSTANCE_NAME-PROJECT_ID-CONNECTION_NAME`. For example: diff --git a/examples/mongodbatlas_stream_connection/main.tf b/examples/mongodbatlas_stream_connection/main.tf index 0dc56c6cad..31e4ebdfdf 100644 --- a/examples/mongodbatlas_stream_connection/main.tf +++ b/examples/mongodbatlas_stream_connection/main.tf @@ -36,6 +36,11 @@ resource "mongodbatlas_stream_connection" "example-kafka-plaintext" { security = { protocol = "PLAINTEXT" } + networking = { + access = { + type = "PUBLIC" + } + } } resource "mongodbatlas_stream_connection" "example-kafka-ssl" { diff --git a/internal/service/streamconnection/data_source_stream_connection_test.go b/internal/service/streamconnection/data_source_stream_connection_test.go index de6e62e828..612f7c8779 100644 --- a/internal/service/streamconnection/data_source_stream_connection_test.go +++ b/internal/service/streamconnection/data_source_stream_connection_test.go @@ -20,8 +20,8 @@ func TestAccStreamDSStreamConnection_kafkaPlaintext(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: streamConnectionDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false)), - Check: kafkaStreamConnectionAttributeChecks(dataSourceName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false, false), + Config: streamConnectionDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", kafkaNetworkingPublic, false)), + Check: kafkaStreamConnectionAttributeChecks(dataSourceName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", networkingTypePublic, false, false), }, }, }) @@ -39,8 +39,8 @@ func TestAccStreamDSStreamConnection_kafkaSSL(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: streamConnectionDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true)), - Check: kafkaStreamConnectionAttributeChecks(dataSourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true, false), + Config: streamConnectionDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", kafkaNetworkingPublic, true)), + Check: kafkaStreamConnectionAttributeChecks(dataSourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", networkingTypePublic, true, false), }, }, }) diff --git a/internal/service/streamconnection/data_source_stream_connections_test.go b/internal/service/streamconnection/data_source_stream_connections_test.go index 9603eb6b93..094743dfd6 100644 --- a/internal/service/streamconnection/data_source_stream_connections_test.go +++ b/internal/service/streamconnection/data_source_stream_connections_test.go @@ -21,7 +21,7 @@ func TestAccStreamDSStreamConnections_basic(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: streamConnectionsDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false)), + Config: streamConnectionsDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", kafkaNetworkingPublic, false)), Check: streamConnectionsAttributeChecks(dataSourceName, nil, nil, 1), }, }, @@ -40,7 +40,7 @@ func TestAccStreamDSStreamConnections_withPageConfig(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: streamConnectionsWithPageAttrDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false)), + Config: streamConnectionsWithPageAttrDataSourceConfig(kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", kafkaNetworkingPublic, false)), Check: streamConnectionsAttributeChecks(dataSourceName, admin.PtrInt(2), admin.PtrInt(1), 0), }, }, diff --git a/internal/service/streamconnection/model_stream_connection.go b/internal/service/streamconnection/model_stream_connection.go index 80fc6d5697..036bd24fc3 100644 --- a/internal/service/streamconnection/model_stream_connection.go +++ b/internal/service/streamconnection/model_stream_connection.go @@ -60,6 +60,18 @@ func NewStreamConnectionReq(ctx context.Context, plan *TFStreamConnectionModel) } } + if !plan.Networking.IsNull() && !plan.Networking.IsUnknown() { + networkingModel := &TFNetworkingModel{} + if diags := plan.Networking.As(ctx, networkingModel, basetypes.ObjectAsOptions{}); diags.HasError() { + return nil, diags + } + streamConnection.Networking = &admin.StreamsKafkaNetworking{ + Access: &admin.StreamsKafkaNetworkingAccess{ + Type: networkingModel.Access.Type.ValueStringPointer(), + }, + } + } + return &streamConnection, nil } @@ -114,6 +126,19 @@ func NewTFStreamConnection(ctx context.Context, projID, instanceName string, cur connectionModel.DBRoleToExecute = dbRoleToExecuteModel } + connectionModel.Networking = types.ObjectNull(NetworkingObjectType.AttrTypes) + if apiResp.Networking != nil { + networkingModel, diags := types.ObjectValueFrom(ctx, NetworkingObjectType.AttrTypes, TFNetworkingModel{ + Access: TFNetworkingAccessModel{ + Type: types.StringPointerValue(apiResp.Networking.Access.Type), + }, + }) + if diags.HasError() { + return nil, diags + } + connectionModel.Networking = networkingModel + } + return &connectionModel, nil } diff --git a/internal/service/streamconnection/model_stream_connection_test.go b/internal/service/streamconnection/model_stream_connection_test.go index f206b5d47c..09b5cffab2 100644 --- a/internal/service/streamconnection/model_stream_connection_test.go +++ b/internal/service/streamconnection/model_stream_connection_test.go @@ -24,6 +24,7 @@ const ( dbRole = "customRole" dbRoleType = "CUSTOM" sampleConnectionName = "sample_stream_solar" + networkingType = "PUBLIC" ) var configMap = map[string]string{ @@ -67,6 +68,7 @@ func TestStreamConnectionSDKToTFModel(t *testing.T) { Config: types.MapNull(types.StringType), Security: types.ObjectNull(streamconnection.ConnectionSecurityObjectType.AttrTypes), DBRoleToExecute: tfDBRoleToExecuteObject(t, dbRole, dbRoleType), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, { @@ -98,6 +100,7 @@ func TestStreamConnectionSDKToTFModel(t *testing.T) { Config: tfConfigMap(t, configMap), Security: tfSecurityObject(t, DummyCACert, securityProtocol), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, { @@ -118,6 +121,7 @@ func TestStreamConnectionSDKToTFModel(t *testing.T) { Config: types.MapNull(types.StringType), Security: types.ObjectNull(streamconnection.ConnectionSecurityObjectType.AttrTypes), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, { @@ -149,6 +153,7 @@ func TestStreamConnectionSDKToTFModel(t *testing.T) { Config: tfConfigMap(t, configMap), Security: tfSecurityObject(t, DummyCACert, securityProtocol), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, { @@ -168,6 +173,7 @@ func TestStreamConnectionSDKToTFModel(t *testing.T) { Config: types.MapNull(types.StringType), Security: types.ObjectNull(streamconnection.ConnectionSecurityObjectType.AttrTypes), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, } @@ -212,6 +218,11 @@ func TestStreamConnectionsSDKToTFModel(t *testing.T) { Protocol: admin.PtrString(securityProtocol), BrokerPublicCertificate: admin.PtrString(DummyCACert), }, + Networking: &admin.StreamsKafkaNetworking{ + Access: &admin.StreamsKafkaNetworkingAccess{ + Type: admin.PtrString(networkingType), + }, + }, }, { Name: admin.PtrString(connectionName), @@ -253,6 +264,7 @@ func TestStreamConnectionsSDKToTFModel(t *testing.T) { Config: tfConfigMap(t, configMap), Security: tfSecurityObject(t, DummyCACert, securityProtocol), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: tfNetworkingObject(t, networkingType), }, { ID: types.StringValue(fmt.Sprintf("%s-%s-%s", instanceName, dummyProjectID, connectionName)), @@ -265,6 +277,7 @@ func TestStreamConnectionsSDKToTFModel(t *testing.T) { Config: types.MapNull(types.StringType), Security: types.ObjectNull(streamconnection.ConnectionSecurityObjectType.AttrTypes), DBRoleToExecute: tfDBRoleToExecuteObject(t, dbRole, dbRoleType), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, { ID: types.StringValue(fmt.Sprintf("%s-%s-%s", instanceName, dummyProjectID, sampleConnectionName)), @@ -277,6 +290,7 @@ func TestStreamConnectionsSDKToTFModel(t *testing.T) { Config: types.MapNull(types.StringType), Security: types.ObjectNull(streamconnection.ConnectionSecurityObjectType.AttrTypes), DBRoleToExecute: types.ObjectNull(streamconnection.DBRoleToExecuteObjectType.AttrTypes), + Networking: types.ObjectNull(streamconnection.NetworkingObjectType.AttrTypes), }, }, }, @@ -470,3 +484,16 @@ func tfDBRoleToExecuteObject(t *testing.T, role, roleType string) types.Object { } return auth } + +func tfNetworkingObject(t *testing.T, networkingType string) types.Object { + t.Helper() + networking, diags := types.ObjectValueFrom(context.Background(), streamconnection.NetworkingObjectType.AttrTypes, streamconnection.TFNetworkingModel{ + Access: streamconnection.TFNetworkingAccessModel{ + Type: types.StringValue(networkingType), + }, + }) + if diags.HasError() { + t.Errorf("failed to create terraform data model: %s", diags.Errors()[0].Summary()) + } + return networking +} diff --git a/internal/service/streamconnection/resource_schema.go b/internal/service/streamconnection/resource_schema.go index be3ec15d42..c28cc4ca83 100644 --- a/internal/service/streamconnection/resource_schema.go +++ b/internal/service/streamconnection/resource_schema.go @@ -5,6 +5,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" @@ -16,6 +17,9 @@ func ResourceSchema(ctx context.Context) schema.Schema { Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, }, "project_id": schema.StringAttribute{ Required: true, @@ -95,6 +99,23 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, }, + "networking": schema.SingleNestedAttribute{ + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.Object{ + objectplanmodifier.UseStateForUnknown(), + }, + Attributes: map[string]schema.Attribute{ + "access": schema.SingleNestedAttribute{ + Required: true, + Attributes: map[string]schema.Attribute{ + "type": schema.StringAttribute{ + Required: true, + }, + }, + }, + }, + }, }, } } diff --git a/internal/service/streamconnection/resource_stream_connection.go b/internal/service/streamconnection/resource_stream_connection.go index f4f571ce23..56ac82bb2f 100644 --- a/internal/service/streamconnection/resource_stream_connection.go +++ b/internal/service/streamconnection/resource_stream_connection.go @@ -5,12 +5,14 @@ import ( "errors" "net/http" "regexp" + "time" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + + "github.com/hashicorp/terraform-plugin-framework/types" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) @@ -43,6 +45,7 @@ type TFStreamConnectionModel struct { Config types.Map `tfsdk:"config"` Security types.Object `tfsdk:"security"` DBRoleToExecute types.Object `tfsdk:"db_role_to_execute"` + Networking types.Object `tfsdk:"networking"` } type TFConnectionAuthenticationModel struct { @@ -77,6 +80,22 @@ var DBRoleToExecuteObjectType = types.ObjectType{AttrTypes: map[string]attr.Type "type": types.StringType, }} +type TFNetworkingAccessModel struct { + Type types.String `tfsdk:"type"` +} + +var NetworkingAccessObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{ + "type": types.StringType, +}} + +type TFNetworkingModel struct { + Access TFNetworkingAccessModel `tfsdk:"access"` +} + +var NetworkingObjectType = types.ObjectType{AttrTypes: map[string]attr.Type{ + "access": NetworkingAccessObjectType, +}} + func (r *streamConnectionRS) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = ResourceSchema(ctx) conversion.UpdateSchemaDescription(&resp.Schema) @@ -181,7 +200,7 @@ func (r *streamConnectionRS) Delete(ctx context.Context, req resource.DeleteRequ projectID := streamConnectionState.ProjectID.ValueString() instanceName := streamConnectionState.InstanceName.ValueString() connectionName := streamConnectionState.ConnectionName.ValueString() - if _, _, err := connV2.StreamsApi.DeleteStreamConnection(ctx, projectID, instanceName, connectionName).Execute(); err != nil { + if err := DeleteStreamConnection(ctx, connV2.StreamsApi, projectID, instanceName, connectionName, time.Minute); err != nil { resp.Diagnostics.AddError("error deleting resource", err.Error()) return } diff --git a/internal/service/streamconnection/resource_stream_connection_migration_test.go b/internal/service/streamconnection/resource_stream_connection_migration_test.go index 77202bbd65..de1596577f 100644 --- a/internal/service/streamconnection/resource_stream_connection_migration_test.go +++ b/internal/service/streamconnection/resource_stream_connection_migration_test.go @@ -4,76 +4,15 @@ import ( _ "embed" "testing" - "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) func TestMigStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { - var ( - resourceName = "mongodbatlas_stream_connection.test" - projectID = acc.ProjectIDExecution(t) - instanceName = acc.RandomName() - config = kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false) - ) mig.SkipIfVersionBelow(t, "1.16.0") // when reached GA - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acc.PreCheckBasic(t) }, - CheckDestroy: CheckDestroyStreamConnection, - Steps: []resource.TestStep{ - { - ExternalProviders: mig.ExternalProviders(), - Config: config, - Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false, true), - }, - mig.TestStepCheckEmptyPlan(config), - }, - }) -} - -func TestMigStreamRSStreamConnection_kafkaSSL(t *testing.T) { - var ( - resourceName = "mongodbatlas_stream_connection.test" - projectID = acc.ProjectIDExecution(t) - instanceName = acc.RandomName() - config = kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true) - ) - mig.SkipIfVersionBelow(t, "1.16.0") // when reached GA - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acc.PreCheckBasic(t) }, - CheckDestroy: CheckDestroyStreamConnection, - Steps: []resource.TestStep{ - { - ExternalProviders: mig.ExternalProviders(), - Config: config, - Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true, true), - }, - mig.TestStepCheckEmptyPlan(config), - }, - }) + mig.CreateAndRunTest(t, testCaseKafkaPlaintext(t)) } func TestMigStreamRSStreamConnection_cluster(t *testing.T) { - var ( - resourceName = "mongodbatlas_stream_connection.test" - projectID, clusterName = acc.ClusterNameExecution(t) - instanceName = acc.RandomName() - config = clusterStreamConnectionConfig(projectID, instanceName, clusterName) - ) mig.SkipIfVersionBelow(t, "1.16.0") // when reached GA - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acc.PreCheckBasic(t) }, - CheckDestroy: CheckDestroyStreamConnection, - Steps: []resource.TestStep{ - { - ExternalProviders: mig.ExternalProviders(), - Config: config, - Check: clusterStreamConnectionAttributeChecks(resourceName, clusterName), - }, - mig.TestStepCheckEmptyPlan(config), - }, - }) + mig.CreateAndRunTest(t, testCaseCluster(t)) } diff --git a/internal/service/streamconnection/resource_stream_connection_test.go b/internal/service/streamconnection/resource_stream_connection_test.go index f65dce618b..f7cebd7074 100644 --- a/internal/service/streamconnection/resource_stream_connection_test.go +++ b/internal/service/streamconnection/resource_stream_connection_test.go @@ -9,12 +9,63 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" ) -//go:embed testdata/dummy-ca.pem -var DummyCACert string +var ( + //go:embed testdata/dummy-ca.pem + DummyCACert string + networkingTypeVPC = "VPC" + networkingTypePublic = "PUBLIC" + kafkaNetworkingVPC = fmt.Sprintf(`networking = { + access = { + type = %[1]q + } + }`, networkingTypeVPC) + kafkaNetworkingPublic = fmt.Sprintf(`networking = { + access = { + type = %[1]q + } + }`, networkingTypePublic) +) func TestAccStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { + testCase := testCaseKafkaPlaintext(t) + resource.ParallelTest(t, *testCase) +} + +func testCaseKafkaPlaintext(t *testing.T) *resource.TestCase { + t.Helper() + var ( + resourceName = "mongodbatlas_stream_connection.test" + projectID = acc.ProjectIDExecution(t) + instanceName = acc.RandomName() + ) + return &resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: CheckDestroyStreamConnection, + Steps: []resource.TestStep{ + { + Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", "", false), + Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", networkingTypePublic, false, true), + }, + { + Config: kafkaStreamConnectionConfig(projectID, instanceName, "user2", "otherpassword", "localhost:9093", "latest", kafkaNetworkingPublic, false), + Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user2", "otherpassword", "localhost:9093", "latest", networkingTypePublic, false, true), + }, + { + ResourceName: resourceName, + ImportStateIdFunc: checkStreamConnectionImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"authentication.password"}, + }, + }, + } +} + +func TestAccStreamRSStreamConnection_kafkaNetworkingVPC(t *testing.T) { var ( resourceName = "mongodbatlas_stream_connection.test" projectID = acc.ProjectIDExecution(t) @@ -26,12 +77,14 @@ func TestAccStreamRSStreamConnection_kafkaPlaintext(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false), - Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092,localhost:9092", "earliest", false, true), + Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", kafkaNetworkingPublic, true), + Check: resource.ComposeAggregateTestCheckFunc( + kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", networkingTypePublic, true, true), + ), }, { - Config: kafkaStreamConnectionConfig(projectID, instanceName, "user2", "otherpassword", "localhost:9093", "latest", false), - Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user2", "otherpassword", "localhost:9093", "latest", false, true), + Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", kafkaNetworkingVPC, true), + Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", networkingTypeVPC, true, true), }, { ResourceName: resourceName, @@ -56,8 +109,8 @@ func TestAccStreamRSStreamConnection_kafkaSSL(t *testing.T) { CheckDestroy: CheckDestroyStreamConnection, Steps: []resource.TestStep{ { - Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true), - Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", true, true), + Config: kafkaStreamConnectionConfig(projectID, instanceName, "user", "rawpassword", "localhost:9092", "earliest", kafkaNetworkingPublic, true), + Check: kafkaStreamConnectionAttributeChecks(resourceName, instanceName, "user", "rawpassword", "localhost:9092", "earliest", networkingTypePublic, true, true), }, { ResourceName: resourceName, @@ -71,12 +124,18 @@ func TestAccStreamRSStreamConnection_kafkaSSL(t *testing.T) { } func TestAccStreamRSStreamConnection_cluster(t *testing.T) { + testCase := testCaseCluster(t) + resource.ParallelTest(t, *testCase) +} + +func testCaseCluster(t *testing.T) *resource.TestCase { + t.Helper() var ( resourceName = "mongodbatlas_stream_connection.test" projectID, clusterName = acc.ClusterNameExecution(t) instanceName = acc.RandomName() ) - resource.ParallelTest(t, resource.TestCase{ + return &resource.TestCase{ PreCheck: func() { acc.PreCheckBasic(t) }, ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, CheckDestroy: CheckDestroyStreamConnection, @@ -92,7 +151,7 @@ func TestAccStreamRSStreamConnection_cluster(t *testing.T) { ImportStateVerify: true, }, }, - }) + } } func TestAccStreamRSStreamConnection_sample(t *testing.T) { @@ -121,7 +180,7 @@ func TestAccStreamRSStreamConnection_sample(t *testing.T) { }) } -func kafkaStreamConnectionConfig(projectID, instanceName, username, password, bootstrapServers, configValue string, useSSL bool) string { +func kafkaStreamConnectionConfig(projectID, instanceName, username, password, bootstrapServers, configValue, networkingConfig string, useSSL bool) string { projectAndStreamInstanceConfig := acc.StreamInstanceConfig(projectID, instanceName, "VIRGINIA_USA", "AWS") securityConfig := ` security = { @@ -135,7 +194,6 @@ func kafkaStreamConnectionConfig(projectID, instanceName, username, password, bo protocol = "SSL" }`, DummyCACert) } - return fmt.Sprintf(` %[1]s @@ -154,8 +212,9 @@ func kafkaStreamConnectionConfig(projectID, instanceName, username, password, bo "auto.offset.reset": %[5]q } %[6]s + %[7]s } - `, projectAndStreamInstanceConfig, username, password, bootstrapServers, configValue, securityConfig) + `, projectAndStreamInstanceConfig, username, password, bootstrapServers, configValue, networkingConfig, securityConfig) } func sampleStreamConnectionConfig(projectID, instanceName, sampleName string) string { @@ -186,18 +245,21 @@ func sampleStreamConnectionAttributeChecks( } func kafkaStreamConnectionAttributeChecks( - resourceName, instanceName, username, password, bootstrapServers, configValue string, usesSSL, checkPassword bool) resource.TestCheckFunc { + resourceName, instanceName, username, password, bootstrapServers, configValue, networkingType string, usesSSL, checkPassword bool) resource.TestCheckFunc { resourceChecks := []resource.TestCheckFunc{ checkStreamConnectionExists(), resource.TestCheckResourceAttrSet(resourceName, "project_id"), - resource.TestCheckResourceAttrSet(resourceName, "instance_name"), resource.TestCheckResourceAttrSet(resourceName, "connection_name"), resource.TestCheckResourceAttr(resourceName, "type", "Kafka"), + resource.TestCheckResourceAttr(resourceName, "instance_name", instanceName), resource.TestCheckResourceAttr(resourceName, "authentication.mechanism", "PLAIN"), resource.TestCheckResourceAttr(resourceName, "authentication.username", username), resource.TestCheckResourceAttr(resourceName, "bootstrap_servers", bootstrapServers), resource.TestCheckResourceAttr(resourceName, "config.auto.offset.reset", configValue), } + if mig.IsProviderVersionAtLeast("1.25.0") { + resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "networking.access.type", networkingType)) + } if checkPassword { resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "authentication.password", password)) } diff --git a/internal/service/streamconnection/state_transition.go b/internal/service/streamconnection/state_transition.go new file mode 100644 index 0000000000..6a21ca9b49 --- /dev/null +++ b/internal/service/streamconnection/state_transition.go @@ -0,0 +1,25 @@ +package streamconnection + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "go.mongodb.org/atlas-sdk/v20241113003/admin" +) + +func DeleteStreamConnection(ctx context.Context, api admin.StreamsApi, projectID, instanceName, connectionName string, timeout time.Duration) error { + return retry.RetryContext(ctx, timeout, func() *retry.RetryError { + _, resp, err := api.DeleteStreamConnection(ctx, projectID, instanceName, connectionName).Execute() + if err == nil { + return nil + } + if admin.IsErrorCode(err, "STREAM_KAFKA_CONNECTION_IS_DEPLOYING") { + return retry.RetryableError(err) + } + if resp != nil && resp.StatusCode == 404 { + return nil + } + return retry.NonRetryableError(err) + }) +} diff --git a/internal/service/streamconnection/state_transition_test.go b/internal/service/streamconnection/state_transition_test.go new file mode 100644 index 0000000000..e42a263e95 --- /dev/null +++ b/internal/service/streamconnection/state_transition_test.go @@ -0,0 +1,51 @@ +package streamconnection_test + +import ( + "context" + "net/http" + "testing" + "time" + + "go.mongodb.org/atlas-sdk/v20241113003/admin" + "go.mongodb.org/atlas-sdk/v20241113003/mockadmin" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/streamconnection" +) + +func TestStreamConnectionDeletion(t *testing.T) { + var ( + m = mockadmin.NewStreamsApi(t) + projectID = "projectID" + instanceName = "instanceName" + connectionName = "connectionName" + errDeleteInProgress = admin.ApiError{ + ErrorCode: "STREAM_KAFKA_CONNECTION_IS_DEPLOYING", + Error: 409, + } + genericErr = admin.GenericOpenAPIError{} + ) + genericErr.SetError("error") + genericErr.SetModel(errDeleteInProgress) + m.EXPECT().DeleteStreamConnection(mock.Anything, projectID, instanceName, connectionName).Return(admin.DeleteStreamConnectionApiRequest{ApiService: m}).Times(3) + m.EXPECT().DeleteStreamConnectionExecute(mock.Anything).Once().Return(nil, nil, &genericErr) + m.EXPECT().DeleteStreamConnectionExecute(mock.Anything).Once().Return(nil, nil, &genericErr) + m.EXPECT().DeleteStreamConnectionExecute(mock.Anything).Once().Return(nil, nil, nil) + err := streamconnection.DeleteStreamConnection(context.Background(), m, projectID, instanceName, connectionName, time.Minute) + assert.NoError(t, err) +} + +func TestStreamConnectionDeletion404(t *testing.T) { + var ( + m = mockadmin.NewStreamsApi(t) + projectID = "projectID" + instanceName = "instanceName" + connectionName = "connectionName" + ) + m.EXPECT().DeleteStreamConnection(mock.Anything, projectID, instanceName, connectionName).Return(admin.DeleteStreamConnectionApiRequest{ApiService: m}).Once() + m.EXPECT().DeleteStreamConnectionExecute(mock.Anything).Once().Return(nil, &http.Response{StatusCode: 404}, nil) + err := streamconnection.DeleteStreamConnection(context.Background(), m, projectID, instanceName, connectionName, time.Minute) + assert.NoError(t, err) +} From 0285df725a321395d64c58570cee97d9a436e77c Mon Sep 17 00:00:00 2001 From: svc-apix-bot Date: Mon, 23 Dec 2024 13:24:21 +0000 Subject: [PATCH 38/40] chore: Updates CHANGELOG.md for #2474 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07cea7a447..139e48e40a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## (Unreleased) +ENHANCEMENTS: + +* data-source/mongodbatlas_stream_connection: Adds `networking` attribute ([#2474](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2474)) +* data-source/mongodbatlas_stream_connections: Adds `networking` attribute ([#2474](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2474)) +* resource/mongodbatlas_stream_connection: Adds `networking` attribute ([#2474](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2474)) + ## 1.24.0 (December 20, 2024) ENHANCEMENTS: From a3f7e432ed60298d57f13ab929afce2f62e571d0 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Mon, 23 Dec 2024 13:30:23 +0000 Subject: [PATCH 39/40] chore: Improves error handling messages in advanced cluster tpf (#2914) * chore: improves error handling messages in advanced cluster tpf * chore: update deprecation messages for schema attributes to include the name of the attribute * chore: fix duplicate error message * chore: Adding link to migration guide --- .../service/advancedclustertpf/data_source.go | 10 +- .../advancedclustertpf/plural_data_source.go | 2 +- .../service/advancedclustertpf/resource.go | 104 +++++++++++------- .../resource_compatibility_reuse.go | 5 +- .../resource_compatiblity.go | 4 +- internal/service/advancedclustertpf/schema.go | 11 +- .../advancedclustertpf/state_transition.go | 8 +- .../advancedclustertpf/validate_schema.go | 2 +- 8 files changed, 87 insertions(+), 59 deletions(-) diff --git a/internal/service/advancedclustertpf/data_source.go b/internal/service/advancedclustertpf/data_source.go index a005dd0a12..801c02b023 100644 --- a/internal/service/advancedclustertpf/data_source.go +++ b/internal/service/advancedclustertpf/data_source.go @@ -14,6 +14,12 @@ import ( var _ datasource.DataSource = &ds{} var _ datasource.DataSourceWithConfigure = &ds{} +const ( + errorReadDatasource = "Error reading advanced cluster datasource" + errorReadDatasourceForceAsymmetric = "Error reading advanced cluster datasource, was expecting symmetric shards but found asymmetric shards" + errorReadDatasourceForceAsymmetricDetail = "Cluster name %s. Please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. %s" +) + func DataSource() datasource.DataSource { return &ds{ DSCommon: config.DSCommon{ @@ -53,7 +59,7 @@ func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS * if admin.IsErrorCode(err, ErrorCodeClusterNotFound) { return nil } - diags.AddError("errorRead", fmt.Sprintf(errorRead, clusterName, err.Error())) + diags.AddError(errorReadDatasource, defaultAPIErrorDetails(clusterName, err)) return nil } modelIn := &TFModel{ @@ -65,7 +71,7 @@ func (d *ds) readCluster(ctx context.Context, diags *diag.Diagnostics, modelDS * return nil } if extraInfo.ForceLegacySchemaFailed { - diags.AddError("errorRead", "Please add `use_replication_spec_per_shard = true` to your data source configuration to enable asymmetric shard support. Refer to documentation for more details.") + diags.AddError(errorReadDatasourceForceAsymmetric, fmt.Sprintf(errorReadDatasourceForceAsymmetricDetail, clusterName, DeprecationOldSchemaAction)) return nil } updateModelAdvancedConfig(ctx, diags, d.Client, modelOut, nil, nil) diff --git a/internal/service/advancedclustertpf/plural_data_source.go b/internal/service/advancedclustertpf/plural_data_source.go index f1e4928903..46560e717a 100644 --- a/internal/service/advancedclustertpf/plural_data_source.go +++ b/internal/service/advancedclustertpf/plural_data_source.go @@ -59,7 +59,7 @@ func (d *pluralDS) readClusters(ctx context.Context, diags *diag.Diagnostics, pl return request.Execute() }) if err != nil { - diags.AddError("errorList", fmt.Sprintf(errorList, projectID, err.Error())) + diags.AddError(errorList, fmt.Sprintf(errorListDetail, projectID, err.Error())) return nil } outs := &TFModelPluralDS{ diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 97adefc7bb..7dcfe14d69 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -23,32 +23,54 @@ var _ resource.ResourceWithImportState = &rs{} var _ resource.ResourceWithMoveState = &rs{} const ( - resourceName = "advanced_cluster" - errorCreate = "error creating advanced cluster: %s" - errorRead = "error reading advanced cluster (%s): %s" - errorDelete = "error deleting advanced cluster (%s): %s" - errorUpdate = "error updating advanced cluster (%s): %s" - errorList = "error reading advanced cluster list for project %s: %s" - errorConfigUpdate = "error updating advanced cluster configuration options (%s): %s" - errorConfigRead = "error reading advanced cluster configuration options (%s): %s" - ErrorClusterSetting = "error setting `%s` for MongoDB Cluster (%s): %s" - ErrorAdvancedConfRead = "error reading Advanced Configuration Option form MongoDB Cluster (%s): %s" - ErrorClusterAdvancedSetting = "error setting `%s` for MongoDB ClusterAdvanced (%s): %s" - ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" - ErrorOperationNotPermitted = "error operation not permitted" - ignoreLabel = "Infrastructure Tool" - DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details at https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown" - defaultTimeout = 3 * time.Hour - ErrorCodeClusterNotFound = "CLUSTER_NOT_FOUND" - changeReasonUpdate = "update" - changeReasonCreate = "create" - changeReasonDelete = "delete" + resourceName = "advanced_cluster" + errorSchemaDowngrade = "error operation not permitted, nums_shards from 1 -> > 1" + errorPatchPayload = "error creating patch payload" + errorCreate = "error creating advanced cluster" + errorDetailDefault = "cluster name %s. API error detail %s" + errorUpdateAdvancedConfigLegacy = "error updating advanced cluster advanced configuration options with legacy API" + errorSchemaUpgradeReadIDs = "error reading IDs from API when upgrading schema" + errorReadResource = "error reading advanced cluster" + errorAdvancedConfRead = "error reading Advanced Configuration" + errorAdvancedConfReadLegacy = "error reading Advanced Configuration from legacy API" + errorDelete = "error deleting advanced cluster" + errorUpdate = "error updating advanced cluster" + errorUpdateLegacy20240805 = "error updating advanced cluster legacy API 20240805" + errorUpdateLegacy20240530 = "error updating advanced cluster legacy API 20240530" + errorList = "error reading advanced cluster list" + errorListDetail = "project ID %s. Error %s" + errorTenantUpgrade = "error upgrading tenant cluster" + errorReadLegacy20240530 = "error reading cluster with legacy API 20240530" + errorResolveContainerIDs = "error resolving container IDs" + errorRegionPriorities = "priority values in region_configs must be in descending order" + errorUnknownChangeReason = "unknown change reason" + errorAwaitState = "error awaiting cluster to reach desired state" + errorAwaitStateResultType = "the result of awaiting cluster wasn't of the expected type" + + // TODO: Used in two places + errorAdvancedConfUpdate = "error updating Advanced Configuration" + errorAdvancedConfUpdateLegacy = "error updating Advanced Configuration from legacy API" + + DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details at https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown" + defaultTimeout = 3 * time.Hour + ErrorCodeClusterNotFound = "CLUSTER_NOT_FOUND" + changeReasonUpdate = "update" + changeReasonCreate = "create" + changeReasonDelete = "delete" ) +func defaultAPIErrorDetails(clusterName string, err error) string { + return fmt.Sprintf(errorDetailDefault, clusterName, err.Error()) +} + +func deprecationMsgOldSchema(name string) string { + return fmt.Sprintf("%s Name=%s. %s", constant.DeprecationParam, name, DeprecationOldSchemaAction) +} + var ( - DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction) - pauseRequest = admin.ClusterDescription20240805{Paused: conversion.Pointer(true)} - resumeRequest = admin.ClusterDescription20240805{Paused: conversion.Pointer(false)} + pauseRequest = admin.ClusterDescription20240805{Paused: conversion.Pointer(true)} + resumeRequest = admin.ClusterDescription20240805{Paused: conversion.Pointer(false)} + errorSchemaDowngradeDetail = "Cluster name %s. " + fmt.Sprintf("cannot increase num_shards to > 1 under the current configuration. New shards can be defined by adding new replication spec objects; %s", DeprecationOldSchemaAction) ) func Resource() resource.Resource { @@ -105,7 +127,7 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou stateUsingLegacy := usingLegacySchema(ctx, state.ReplicationSpecs, diags) planUsingLegacy := usingLegacySchema(ctx, plan.ReplicationSpecs, diags) if planUsingLegacy && !stateUsingLegacy { - diags.AddError("error operation not permitted, nums_shards from 1 -> > 1", fmt.Sprintf("cannot increase num_shards to > 1 under the current configuration. New shards can be defined by adding new replication spec objects; %s", DeprecationOldSchemaAction)) + diags.AddError(errorSchemaDowngrade, fmt.Sprintf(errorSchemaDowngradeDetail, plan.Name.ValueString())) return } isSchemaUpgrade := stateUsingLegacy && !planUsingLegacy @@ -125,7 +147,7 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou } patchReq, err := update.PatchPayload(stateReq, planReq, patchOptions) if err != nil { - diags.AddError("errorPatchPayload", err.Error()) + diags.AddError(errorPatchPayload, err.Error()) return } var clusterResp *admin.ClusterDescription20240805 @@ -135,9 +157,9 @@ func (r *rs) Update(ctx context.Context, req resource.UpdateRequest, resp *resou clusterResp = r.applyTenantUpgrade(ctx, &plan, upgradeRequest, diags) } else { if isSchemaUpgrade { - specs, localDiags := populateIDValuesUsingNewAPI(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), r.Client.AtlasV2.ClustersApi, patchReq.ReplicationSpecs) - conversion.AddLegacyDiags(diags, localDiags) - if diags.HasError() { + specs, err := populateIDValuesUsingNewAPI(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), r.Client.AtlasV2.ClustersApi, patchReq.ReplicationSpecs) + if err != nil { + diags.AddError(errorSchemaUpgradeReadIDs, defaultAPIErrorDetails(plan.Name.ValueString(), err)) return } patchReq.ReplicationSpecs = specs @@ -189,7 +211,7 @@ func (r *rs) Delete(ctx context.Context, req resource.DeleteRequest, resp *resou } _, err := api.DeleteClusterWithParams(ctx, params).Execute() if err != nil { - diags.AddError("errorDelete", fmt.Sprintf(errorDelete, clusterName, err.Error())) + diags.AddError(errorDelete, defaultAPIErrorDetails(clusterName, err)) return } _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &state.Timeouts, diags, projectID, clusterName, changeReasonDelete) @@ -223,7 +245,7 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn _, _, err = api.CreateCluster(ctx, projectID, latestReq).Execute() } if err != nil { - diags.AddError("errorCreate", fmt.Sprintf(errorCreate, err.Error())) + diags.AddError(errorCreate, defaultAPIErrorDetails(clusterName, err)) return nil } clusterResp := AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) @@ -239,7 +261,7 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn legacyAdvConfig, _, err = api20240530.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, legacyAdvConfigUpdate).Execute() if err != nil { // Maybe should be warning instead of error to avoid having to re-create the cluster - diags.AddError("errorUpdateeAdvConfigLegacy", fmt.Sprintf(errorCreate, err.Error())) + diags.AddError(errorAdvancedConfUpdateLegacy, defaultAPIErrorDetails(clusterName, err)) return nil } _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) @@ -254,7 +276,7 @@ func (r *rs) createCluster(ctx context.Context, plan *TFModel, diags *diag.Diagn advConfig, _, err = api.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, advConfigUpdate).Execute() if err != nil { // Maybe should be warning instead of error to avoid having to re-create the cluster - diags.AddError("errorUpdateAdvConfig", fmt.Sprintf(errorCreate, err.Error())) + diags.AddError(errorAdvancedConfUpdate, defaultAPIErrorDetails(clusterName, err)) return nil } _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonCreate) @@ -283,7 +305,7 @@ func (r *rs) readCluster(ctx context.Context, diags *diag.Diagnostics, modelIn * state.RemoveResource(ctx) return nil } - diags.AddError("errorRead", fmt.Sprintf(errorRead, clusterName, err.Error())) + diags.AddError(errorReadResource, defaultAPIErrorDetails(clusterName, err)) return nil } modelOut, _ := getBasicClusterModel(ctx, diags, r.Client, readResp, modelIn, false) @@ -311,7 +333,7 @@ func (r *rs) applyAdvancedConfigurationChanges(ctx context.Context, diags *diag. changed = true advConfig, _, err = api.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, patchReqProcessArgs).Execute() if err != nil { - diags.AddError("errorUpdateAdvancedConfig", fmt.Sprintf(errorConfigUpdate, clusterName, err.Error())) + diags.AddError(errorAdvancedConfUpdate, defaultAPIErrorDetails(clusterName, err)) return nil, nil, false } _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) @@ -324,7 +346,7 @@ func (r *rs) applyAdvancedConfigurationChanges(ctx context.Context, diags *diag. changed = true legacyAdvConfig, _, err = r.Client.AtlasV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, clusterName, patchReqProcessArgsLegacy).Execute() if err != nil { - diags.AddError("errorUpdateAdvancedConfigLegacy", fmt.Sprintf(errorConfigUpdate, clusterName, err.Error())) + diags.AddError(errorAdvancedConfUpdateLegacy, defaultAPIErrorDetails(clusterName, err)) return nil, nil, false } _ = AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) @@ -409,7 +431,7 @@ func (r *rs) updateLegacyReplicationSpecs(ctx context.Context, state, plan *TFMo api20240530 := r.Client.AtlasV220240530.ClustersApi _, _, err := api20240530.UpdateCluster(ctx, plan.ProjectID.ValueString(), plan.Name.ValueString(), legacyPatch).Execute() if err != nil { - diags.AddError("errorUpdateLegacy", fmt.Sprintf(errorUpdate, plan.Name.ValueString(), err.Error())) + diags.AddError(errorUpdateLegacy20240530, defaultAPIErrorDetails(plan.Name.ValueString(), err)) return false } return true @@ -421,7 +443,7 @@ func (r *rs) updateAndWait(ctx context.Context, patchReq *admin.ClusterDescripti clusterName := tfModel.Name.ValueString() _, _, err := api.UpdateCluster(ctx, projectID, clusterName, patchReq).Execute() if err != nil { - diags.AddError("errorUpdate", fmt.Sprintf(errorUpdate, clusterName, err.Error())) + diags.AddError(errorUpdate, defaultAPIErrorDetails(clusterName, err)) return nil } return AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &tfModel.Timeouts, diags, projectID, clusterName, changeReasonUpdate) @@ -433,7 +455,7 @@ func (r *rs) updateAndWaitLegacy(ctx context.Context, patchReq *admin20240805.Cl clusterName := plan.Name.ValueString() _, _, err := api20240805.UpdateCluster(ctx, projectID, clusterName, patchReq).Execute() if err != nil { - diags.AddError("errorUpdateLegacy", fmt.Sprintf(errorUpdate, clusterName, err.Error())) + diags.AddError(errorUpdateLegacy20240805, defaultAPIErrorDetails(clusterName, err)) return nil } return AwaitChanges(ctx, r.Client.AtlasV2.ClustersApi, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) @@ -446,7 +468,7 @@ func (r *rs) applyTenantUpgrade(ctx context.Context, plan *TFModel, upgradeReque upgradeRequest.Name = clusterName _, _, err := api.UpgradeSharedCluster(ctx, projectID, upgradeRequest).Execute() if err != nil { - diags.AddError("errorTenantUpgrade", fmt.Sprintf(errorUpdate, clusterName, err.Error())) + diags.AddError(errorTenantUpgrade, defaultAPIErrorDetails(clusterName, err)) return nil } return AwaitChanges(ctx, api, &plan.Timeouts, diags, projectID, clusterName, changeReasonUpdate) @@ -477,14 +499,14 @@ func updateModelAdvancedConfig(ctx context.Context, diags *diag.Diagnostics, cli if legacyAdvConfig == nil { legacyAdvConfig, _, err = api20240530.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - diags.AddError("errorReadAdvConfigLegacy", fmt.Sprintf(errorRead, clusterName, err.Error())) + diags.AddError(errorAdvancedConfReadLegacy, defaultAPIErrorDetails(clusterName, err)) return } } if advConfig == nil { advConfig, _, err = api.GetClusterAdvancedConfiguration(ctx, projectID, clusterName).Execute() if err != nil { - diags.AddError("errorReadAdvConfig", fmt.Sprintf(errorRead, clusterName, err.Error())) + diags.AddError(errorAdvancedConfRead, defaultAPIErrorDetails(clusterName, err)) return } } diff --git a/internal/service/advancedclustertpf/resource_compatibility_reuse.go b/internal/service/advancedclustertpf/resource_compatibility_reuse.go index e890e434ff..556e22c984 100644 --- a/internal/service/advancedclustertpf/resource_compatibility_reuse.go +++ b/internal/service/advancedclustertpf/resource_compatibility_reuse.go @@ -6,7 +6,6 @@ import ( "strconv" "strings" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster" @@ -176,13 +175,13 @@ func convertDedicatedHardwareSpecToOldSDK(spec *admin.DedicatedHardwareSpec20240 } // copied from advancedcluster/resource_update_logic.go -func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName string, connV2ClusterAPI admin.ClustersApi, replicationSpecs *[]admin.ReplicationSpec20240805) (*[]admin.ReplicationSpec20240805, diag.Diagnostics) { +func populateIDValuesUsingNewAPI(ctx context.Context, projectID, clusterName string, connV2ClusterAPI admin.ClustersApi, replicationSpecs *[]admin.ReplicationSpec20240805) (*[]admin.ReplicationSpec20240805, error) { if replicationSpecs == nil || len(*replicationSpecs) == 0 { return replicationSpecs, nil } cluster, _, err := connV2ClusterAPI.GetCluster(ctx, projectID, clusterName).Execute() if err != nil { - return nil, diag.FromErr(fmt.Errorf(errorRead, clusterName, err)) + return nil, err } zoneToReplicationSpecsIDs := groupIDsByZone(cluster.GetReplicationSpecs()) diff --git a/internal/service/advancedclustertpf/resource_compatiblity.go b/internal/service/advancedclustertpf/resource_compatiblity.go index ff8a877d55..1f61d103b3 100644 --- a/internal/service/advancedclustertpf/resource_compatiblity.go +++ b/internal/service/advancedclustertpf/resource_compatiblity.go @@ -52,7 +52,7 @@ func resolveAPIInfo(ctx context.Context, diags *diag.Diagnostics, client *config if admin20240530.IsErrorCode(err, "ASYMMETRIC_SHARD_UNSUPPORTED") { forceLegacySchemaFailed = forceLegacySchema } else { - diags.AddError("errorRead", fmt.Sprintf("error reading advanced cluster with 2024-05-30 API (%s): %s", clusterName, err)) + diags.AddError(errorReadLegacy20240530, defaultAPIErrorDetails(clusterName, err)) return nil } } @@ -61,7 +61,7 @@ func resolveAPIInfo(ctx context.Context, diags *diag.Diagnostics, client *config } containerIDs, err := resolveContainerIDs(ctx, projectID, clusterLatest, client.AtlasV2.NetworkPeeringApi) if err != nil { - diags.AddError("resolveContainerIDs failed", err.Error()) + diags.AddError(errorResolveContainerIDs, fmt.Sprintf("cluster name = %s, error details: %s", clusterName, err.Error())) return nil } info := &ExtraAPIInfo{ diff --git a/internal/service/advancedclustertpf/schema.go b/internal/service/advancedclustertpf/schema.go index f262de0155..8f2bd65ee9 100644 --- a/internal/service/advancedclustertpf/schema.go +++ b/internal/service/advancedclustertpf/schema.go @@ -199,7 +199,7 @@ func resourceSchema(ctx context.Context) schema.Schema { NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, + DeprecationMessage: deprecationMsgOldSchema("id"), Computed: true, MarkdownDescription: "Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. If you include existing shard replication configurations in the request, you must specify this parameter. If you add a new shard to an existing Cluster, you may specify this parameter. The request deletes any existing shards in the Cluster that you exclude from the request. This corresponds to Shard ID displayed in the UI.", }, @@ -213,7 +213,7 @@ func resourceSchema(ctx context.Context) schema.Schema { MarkdownDescription: "external_id", // TODO: add description }, "num_shards": schema.Int64Attribute{ - DeprecationMessage: DeprecationMsgOldSchema, + DeprecationMessage: deprecationMsgOldSchema("num_shards"), Default: int64default.StaticInt64(1), Computed: true, Optional: true, @@ -287,7 +287,7 @@ func resourceSchema(ctx context.Context) schema.Schema { MarkdownDescription: "Flag that indicates whether to retain backup snapshots for the deleted dedicated cluster.", }, "disk_size_gb": schema.Float64Attribute{ - DeprecationMessage: DeprecationMsgOldSchema, + DeprecationMessage: deprecationMsgOldSchema("disk_size_gb"), Computed: true, Optional: true, MarkdownDescription: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier.", @@ -516,13 +516,14 @@ func AdvancedConfigurationSchema(ctx context.Context) schema.SingleNestedAttribu MarkdownDescription: "Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process.", }, "default_read_concern": schema.StringAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, + DeprecationMessage: deprecationMsgOldSchema("default_read_concern"), + Computed: true, Optional: true, MarkdownDescription: "default_read_concern", // TODO: add description }, "fail_index_key_too_long": schema.BoolAttribute{ - DeprecationMessage: DeprecationMsgOldSchema, + DeprecationMessage: deprecationMsgOldSchema("fail_index_key_too_long"), Computed: true, Optional: true, MarkdownDescription: "fail_index_key_too_long", // TODO: add description diff --git a/internal/service/advancedclustertpf/state_transition.go b/internal/service/advancedclustertpf/state_transition.go index 5bf2cc0526..f295398bb3 100644 --- a/internal/service/advancedclustertpf/state_transition.go +++ b/internal/service/advancedclustertpf/state_transition.go @@ -40,7 +40,7 @@ func AwaitChanges(ctx context.Context, api admin.ClustersApi, t *timeouts.Value, targetState = retrystrategy.RetryStrategyDeletedState extraPending = append(extraPending, retrystrategy.RetryStrategyIdleState) default: - diags.AddError("errorAwaitingChanges", "unknown change reason "+changeReason) + diags.AddError(errorUnknownChangeReason, "unknown change reason "+changeReason) } if diags.HasError() { return nil @@ -48,10 +48,10 @@ func AwaitChanges(ctx context.Context, api admin.ClustersApi, t *timeouts.Value, stateConf := CreateStateChangeConfig(ctx, api, projectID, clusterName, targetState, timeoutDuration, extraPending...) clusterAny, err := stateConf.WaitForStateContext(ctx) if err != nil { - if admin.IsErrorCode(err, ErrorCodeClusterNotFound) && changeReason == "delete" { + if admin.IsErrorCode(err, ErrorCodeClusterNotFound) && changeReason == changeReasonDelete { return nil } - diags.AddError("errorAwaitingCluster", fmt.Sprintf(errorCreate, err)) + diags.AddError(errorAwaitState, fmt.Sprintf("change reason: %s, desired state: %s, error: %s", changeReason, targetState, err)) return nil } if targetState == retrystrategy.RetryStrategyDeletedState { @@ -59,7 +59,7 @@ func AwaitChanges(ctx context.Context, api admin.ClustersApi, t *timeouts.Value, } cluster, ok := clusterAny.(*admin.ClusterDescription20240805) if !ok { - diags.AddError("errorAwaitingCluster", fmt.Sprintf(errorCreate, "unexpected type from WaitForStateContext")) + diags.AddError(errorAwaitStateResultType, fmt.Sprintf("unexpected type: %T", clusterAny)) return nil } return cluster diff --git a/internal/service/advancedclustertpf/validate_schema.go b/internal/service/advancedclustertpf/validate_schema.go index 18b9e9a50e..d1ce698dbd 100644 --- a/internal/service/advancedclustertpf/validate_schema.go +++ b/internal/service/advancedclustertpf/validate_schema.go @@ -101,7 +101,7 @@ func (v RegionSpecPriorityOrderDecreasingValidator) ValidateList(ctx context.Con configs := *regionConfigs for i := range len(configs) - 1 { if configs[i].GetPriority() < configs[i+1].GetPriority() { - diags.AddError("priority values in region_configs must be in descending order", fmt.Sprintf("priority value at index %d is %d and priority value at index %d is %d", i, configs[i].GetPriority(), i+1, configs[i+1].GetPriority())) + diags.AddError(errorRegionPriorities, fmt.Sprintf("priority value at index %d is %d and priority value at index %d is %d", i, configs[i].GetPriority(), i+1, configs[i+1].GetPriority())) } } } From c2dd5db3ae93ff30497718d7f52efb9e4ca90d8c Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Tue, 24 Dec 2024 11:44:15 +0100 Subject: [PATCH 40/40] refactor: Removes deprecation messages for is_slow_operation_thresholding_enabled and unreachable code (#2922) * refactor: remove deprecations * remove unreachable code * feat: add support for additional MongoDB Atlas public and private keys to use for testing limited access * fix: update MongoDB Atlas key references for QA and DEV environments in acceptance tests * refactor: Renames keys from PUBLIC_KEY2 to PUBLIC_KEY_READ_ONLY --- .github/workflows/acceptance-tests-runner.yml | 6 ++ .github/workflows/acceptance-tests.yml | 4 +- .../service/project/data_source_project.go | 3 +- .../service/project/data_source_projects.go | 3 +- internal/service/project/resource_project.go | 6 -- .../project/resource_project_schema.go | 5 +- .../service/project/resource_project_test.go | 68 +++++++++++++++++++ internal/testutil/acc/pre_check.go | 7 ++ internal/testutil/acc/provider.go | 4 ++ 9 files changed, 92 insertions(+), 14 deletions(-) diff --git a/.github/workflows/acceptance-tests-runner.yml b/.github/workflows/acceptance-tests-runner.yml index 347385e7ed..f563dfcf10 100644 --- a/.github/workflows/acceptance-tests-runner.yml +++ b/.github/workflows/acceptance-tests-runner.yml @@ -103,6 +103,10 @@ on: required: true mongodb_atlas_private_key: required: true + mongodb_atlas_public_key_read_only: + required: true + mongodb_atlas_private_key_read_only: + required: true ca_cert: required: true aws_account_id: @@ -175,6 +179,8 @@ env: MONGODB_ATLAS_ORG_ID: ${{ inputs.mongodb_atlas_org_id }} MONGODB_ATLAS_PUBLIC_KEY: ${{ secrets.mongodb_atlas_public_key }} MONGODB_ATLAS_PRIVATE_KEY: ${{ secrets.mongodb_atlas_private_key }} + MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY: ${{ secrets.mongodb_atlas_public_key_read_only }} + MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY: ${{ secrets.mongodb_atlas_private_key_read_only }} MONGODB_ATLAS_GOV_PUBLIC_KEY: ${{ secrets.mongodb_atlas_gov_public_key }} MONGODB_ATLAS_GOV_PRIVATE_KEY: ${{ secrets.mongodb_atlas_gov_private_key }} MONGODB_ATLAS_GOV_BASE_URL: ${{ inputs.mongodb_atlas_gov_base_url }} diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index 22b164959d..0a6f1e26f4 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -55,7 +55,9 @@ jobs: secrets: mongodb_atlas_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_QA || secrets.MONGODB_ATLAS_PUBLIC_KEY_CLOUD_DEV }} mongodb_atlas_private_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_QA || secrets.MONGODB_ATLAS_PRIVATE_KEY_CLOUD_DEV }} - mongodb_atlas_gov_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_GOV_PUBLIC_KEY_QA || secrets.MONGODB_ATLAS_GOV_PUBLIC_KEY_DEV }} + mongodb_atlas_public_key_read_only: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY_QA || secrets.MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY_DEV }} + mongodb_atlas_private_key_read_only: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY_QA || secrets.MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY_DEV }} + mongodb_atlas_gov_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_GOV_PUBLIC_KEY_QA || secrets.MONGODB_ATLAS_GOV_PUBLIC_KEY_DEV }} mongodb_atlas_gov_private_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_GOV_PRIVATE_KEY_QA || secrets.MONGODB_ATLAS_GOV_PRIVATE_KEY_DEV }} mongodb_atlas_rp_public_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_RP_PUBLIC_KEY_QA || secrets.MONGODB_ATLAS_RP_PUBLIC_KEY_DEV }} mongodb_atlas_rp_private_key: ${{ inputs.atlas_cloud_env == 'qa' && secrets.MONGODB_ATLAS_RP_PRIVATE_KEY_QA || secrets.MONGODB_ATLAS_RP_PRIVATE_KEY_DEV }} diff --git a/internal/service/project/data_source_project.go b/internal/service/project/data_source_project.go index a31cb5b444..ee3ada0b35 100644 --- a/internal/service/project/data_source_project.go +++ b/internal/service/project/data_source_project.go @@ -104,8 +104,7 @@ func (d *projectDS) Schema(ctx context.Context, req datasource.SchemaRequest, re Computed: true, }, "is_slow_operation_thresholding_enabled": schema.BoolAttribute{ - Computed: true, - DeprecationMessage: fmt.Sprintf(constant.DeprecationParamByVersion, "1.24.0"), + Computed: true, }, "region_usage_restrictions": schema.StringAttribute{ Computed: true, diff --git a/internal/service/project/data_source_projects.go b/internal/service/project/data_source_projects.go index 1982c07853..415131a591 100644 --- a/internal/service/project/data_source_projects.go +++ b/internal/service/project/data_source_projects.go @@ -98,8 +98,7 @@ func (d *ProjectsDS) Schema(ctx context.Context, req datasource.SchemaRequest, r Computed: true, }, "is_slow_operation_thresholding_enabled": schema.BoolAttribute{ - Computed: true, - DeprecationMessage: fmt.Sprintf(constant.DeprecationParamByVersion, "1.24.0"), + Computed: true, }, "region_usage_restrictions": schema.StringAttribute{ Computed: true, diff --git a/internal/service/project/resource_project.go b/internal/service/project/resource_project.go index 9e21510dbd..a13e540de7 100644 --- a/internal/service/project/resource_project.go +++ b/internal/service/project/resource_project.go @@ -420,12 +420,6 @@ func SetSlowOperationThresholding(ctx context.Context, performanceAdvisorAPI adm func ReadIsSlowMsThresholdingEnabled(ctx context.Context, api admin.PerformanceAdvisorApi, projectID string, warnings *diag.Diagnostics) (bool, error) { response, err := api.GetManagedSlowMs(ctx, projectID).Execute() if err != nil { - if admin.IsErrorCode(err, "USER_UNAUTHORIZED") { - if warnings != nil { - warnings.AddWarning("user does not have permission to read is_slow_operation_thresholding_enabled. Please read our documentation for more information.", fmt.Sprintf(ErrorProjectRead, projectID, err.Error())) - } - return false, nil - } return false, err } var isEnabled bool diff --git a/internal/service/project/resource_project_schema.go b/internal/service/project/resource_project_schema.go index 3292b3e89a..37fd35b255 100644 --- a/internal/service/project/resource_project_schema.go +++ b/internal/service/project/resource_project_schema.go @@ -101,9 +101,8 @@ func ResourceSchema(ctx context.Context) schema.Schema { }, }, "is_slow_operation_thresholding_enabled": schema.BoolAttribute{ - Computed: true, - Optional: true, - DeprecationMessage: fmt.Sprintf(constant.DeprecationParamByVersion, "1.24.0"), + Computed: true, + Optional: true, PlanModifiers: []planmodifier.Bool{ boolplanmodifier.UseStateForUnknown(), }, diff --git a/internal/service/project/resource_project_test.go b/internal/service/project/resource_project_test.go index efe49c0a6c..231eaed59c 100644 --- a/internal/service/project/resource_project_test.go +++ b/internal/service/project/resource_project_test.go @@ -1080,6 +1080,74 @@ func TestAccProject_withTags(t *testing.T) { }) } +func TestAccProject_slowOperationReadOnly(t *testing.T) { + var ( + orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") + projectName = acc.RandomProjectName() + config = configBasic(orgID, projectName, "", false, nil, conversion.Pointer(false)) + providerConfigReadOnly = acc.ConfigReadOnlyProvider() + ) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acc.PreCheckBasic(t); acc.PreCheckPublicKey2(t) }, + ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, + CheckDestroy: acc.CheckDestroyProject, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "is_slow_operation_thresholding_enabled", "false"), + ), + }, + { + PreConfig: func() { changeRoles(t, orgID, projectName, "GROUP_READ_ONLY") }, + Config: providerConfigReadOnly + config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "is_slow_operation_thresholding_enabled", "false"), + ), + }, + // Validate the API Key has a different role + { + Config: providerConfigReadOnly + configBasic(orgID, projectName, "", false, nil, conversion.Pointer(true)), + ExpectError: regexp.MustCompile("error in project settings update"), + }, + // read back again to ensure no changes, and allow deletion to work + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "is_slow_operation_thresholding_enabled", "false"), + ), + }, + }, + }) +} + +func changeRoles(t *testing.T, orgID, projectName, roleName string) { + t.Helper() + ctx := context.Background() + respProject, _, _ := acc.ConnV2().ProjectsApi.GetProjectByName(ctx, projectName).Execute() + projectID := respProject.GetId() + if projectID == "" { + t.Errorf("PreConfig: error finding project %s", projectName) + } + api := acc.ConnV2().ProgrammaticAPIKeysApi + respList, _, _ := api.ListApiKeys(ctx, orgID).Execute() + publicKey := os.Getenv("MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY") + keys := respList.GetResults() + for _, result := range keys { + if result.GetPublicKey() != publicKey { + continue + } + apiKeyID := result.GetId() + assignment := admin.UpdateAtlasProjectApiKey{Roles: &[]string{roleName}} + _, _, err := api.UpdateApiKeyRoles(ctx, projectID, apiKeyID, &assignment).Execute() + if err != nil { + t.Errorf("PreConfig: error updating key %s", err) + } + return + } + t.Error("PreConfig: key not found") +} + func createDataFederationLimit(limitName string) admin.DataFederationLimit { return admin.DataFederationLimit{ Name: limitName, diff --git a/internal/testutil/acc/pre_check.go b/internal/testutil/acc/pre_check.go index 1c8e0d68df..470f0d2f72 100644 --- a/internal/testutil/acc/pre_check.go +++ b/internal/testutil/acc/pre_check.go @@ -148,6 +148,13 @@ func PreCheckGovBasic(tb testing.TB) { tb.Fatal("`MONGODB_ATLAS_GOV_BASE_URL`, `MONGODB_ATLAS_GOV_PUBLIC_KEY`, `MONGODB_ATLAS_GOV_PRIVATE_KEY`and `MONGODB_ATLAS_GOV_ORG_ID` must be set for acceptance testing") } } +func PreCheckPublicKey2(tb testing.TB) { + tb.Helper() + if os.Getenv("MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY") == "" || + os.Getenv("MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY") == "" { + tb.Fatal("`MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY`, `MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY` must be set for acceptance testing") + } +} func PreCheckGPCEnv(tb testing.TB) { tb.Helper() diff --git a/internal/testutil/acc/provider.go b/internal/testutil/acc/provider.go index b7770257c1..027da49606 100644 --- a/internal/testutil/acc/provider.go +++ b/internal/testutil/acc/provider.go @@ -76,6 +76,10 @@ func ConfigGovProvider() string { return configProvider(os.Getenv("MONGODB_ATLAS_GOV_PUBLIC_KEY"), os.Getenv("MONGODB_ATLAS_GOV_PRIVATE_KEY"), os.Getenv("MONGODB_ATLAS_GOV_BASE_URL")) } +func ConfigReadOnlyProvider() string { + return configProvider(os.Getenv("MONGODB_ATLAS_PUBLIC_KEY_READ_ONLY"), os.Getenv("MONGODB_ATLAS_PRIVATE_KEY_READ_ONLY"), os.Getenv("MONGODB_ATLAS_BASE_URL")) +} + // configAzapiProvider creates a new azure/azapi provider with credentials explicit in config. // This will authorize the provider for a client func ConfigAzapiProvider(subscriptionID, clientID, clientSecret, tenantID string) string {