From 851b0eda3fc96881f7e8dd117528abbfdcde6288 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 11:26:45 +0000 Subject: [PATCH 01/10] refactor: Use new plan modifier helper functions --- .../advancedclustertpf/plan_modifier.go | 346 ++++++------------ .../advancedclustertpf/plan_modifier_test.go | 71 +++- .../service/advancedclustertpf/resource.go | 16 +- .../main_cluster_type_changed.tf | 26 ++ .../main_electable_disk_size_changed.tf | 26 ++ .../main_pin_fcv.tf | 30 ++ .../main_tls_cipher_config_mode_changed.tf | 29 ++ 7 files changed, 296 insertions(+), 248 deletions(-) create mode 100644 internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_cluster_type_changed.tf create mode 100644 internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_electable_disk_size_changed.tf create mode 100644 internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_pin_fcv.tf create mode 100644 internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_tls_cipher_config_mode_changed.tf diff --git a/internal/service/advancedclustertpf/plan_modifier.go b/internal/service/advancedclustertpf/plan_modifier.go index a354723df6..8eef4594a0 100644 --- a/internal/service/advancedclustertpf/plan_modifier.go +++ b/internal/service/advancedclustertpf/plan_modifier.go @@ -2,24 +2,34 @@ package advancedclustertpf import ( "context" - "fmt" - "slices" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/schemafunc" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" + "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/customplanmodifier" ) var ( + attributePlanModifiers = map[string]customplanmodifier.UnknownReplacementCall[PlanModifyResourceInfo]{ + "read_only_specs": readOnlyReplaceUnknown, + "analytics_specs": analyticsAndElectableSpecsReplaceUnknown, + "electable_specs": analyticsAndElectableSpecsReplaceUnknown, + "auto_scaling": autoScalingReplaceUnknown, + "analytics_auto_scaling": autoScalingReplaceUnknown, + // TODO: Add the other computed attributes + } // Change mappings uses `attribute_name`, it doesn't care about the nested level. + // However, it doesn't stop calling `replication_specs.**.attribute_name`. attributeRootChangeMapping = map[string][]string{ - "disk_size_gb": {}, // disk_size_gb can be change at any level/spec - "replication_specs": {}, - "mongo_db_major_version": {"mongo_db_version"}, + "disk_size_gb": {}, // disk_size_gb can be change at any level/spec + "replication_specs": {}, + // "mongo_db_major_version": {"mongo_db_version"}, // Using new plan modifier logic to test this "tls_cipher_config_mode": {"custom_openssl_cipher_config_tls12"}, "cluster_type": {"config_server_management_mode", "config_server_type"}, // computed values of config server change when REPLICA_SET changes to SHARDED + "expiration_date": {"version"}, // pinned_fcv } attributeReplicationSpecChangeMapping = map[string][]string{ // All these fields can exist in specs that are computed, therefore, it is not safe to use them when they have changed. @@ -31,232 +41,147 @@ var ( "region_name": {"container_id"}, // container_id changes based on region_name changes "zone_name": {"zone_id"}, // zone_id copy from state is not safe when } - keepUnknownsCalls = schemafunc.KeepUnknownFuncOr(keepUnkownFuncWithNodeCount, keepUnkownFuncWithNonEmptyAutoScaling) ) -func keepUnkownFuncWithNodeCount(name string, replacement attr.Value) bool { - return name == "node_count" && !replacement.Equal(types.Int64Value(0)) -} - -func keepUnkownFuncWithNonEmptyAutoScaling(name string, replacement attr.Value) bool { - autoScalingBoolValues := []string{"compute_enabled", "disk_gb_enabled", "compute_scale_down_enabled"} - autoScalingStringValues := []string{"compute_min_instance_size", "compute_max_instance_size"} - boolValues := slices.Contains(autoScalingBoolValues, name) && replacement.Equal(types.BoolValue(true)) - stringValues := slices.Contains(autoScalingStringValues, name) && replacement.(types.String).ValueString() != "" - return boolValues || stringValues -} - -// useStateForUnknowns should be called only in Update, because of findClusterDiff -func useStateForUnknowns(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel) { - shardingConfigUpgrade := isShardingConfigUpgrade(ctx, state, plan, diags) +func unknownReplacements(ctx context.Context, tfsdkState *tfsdk.State, tfsdkPlan *tfsdk.Plan, diags *diag.Diagnostics) { + var plan, state TFModel + diags.Append(tfsdkState.Get(ctx, &state)...) + diags.Append(tfsdkPlan.Get(ctx, &plan)...) if diags.HasError() { return } - // Don't adjust region_configs upgrades if it's a sharding config upgrade because it will be done only in the first shard, because state only has the first shard with num_shards > 1. - // This avoid errors like AUTO_SCALINGS_MUST_BE_IN_EVERY_REGION_CONFIG. - if !shardingConfigUpgrade { - AdjustRegionConfigsChildren(ctx, diags, state, plan) - } - diff := findClusterDiff(ctx, state, plan, diags) + diff := findClusterDiff(ctx, &state, &plan, diags) if diags.HasError() || diff.isAnyUpgrade() { // Don't do anything in upgrades return } - attributeChanges := schemafunc.NewAttributeChanges(ctx, state, plan) - keepUnknown := []string{"connection_strings", "state_name"} // Volatile attributes, should not be copied from state - keepUnknown = append(keepUnknown, attributeChanges.KeepUnknown(attributeRootChangeMapping)...) - keepUnknown = append(keepUnknown, determineKeepUnknownsAutoScaling(ctx, diags, state, plan)...) - schemafunc.CopyUnknowns(ctx, state, plan, keepUnknown, nil) - /* pending revision if logic can be reincorporated safely: - if slices.Contains(keepUnknown, "replication_specs") { - useStateForUnknownsReplicationSpecs(ctx, diags, state, plan, &attributeChanges) - } - */ -} - -func UseStateForUnknownsReplicationSpecs(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel, attrChanges *schemafunc.AttributeChanges) { - stateRepSpecsTF := TFModelList[TFReplicationSpecsModel](ctx, diags, state.ReplicationSpecs) - planRepSpecsTF := TFModelList[TFReplicationSpecsModel](ctx, diags, plan.ReplicationSpecs) - if diags.HasError() { - return + computedUsed, diskUsed := autoScalingUsed(ctx, diags, &state, &plan) + shardingConfigUpgrade := isShardingConfigUpgrade(ctx, &state, &plan, diags) + info := PlanModifyResourceInfo{ + AutoScalingComputedUsed: computedUsed, + AutoScalingDiskUsed: diskUsed, + isShardingConfigUpgrade: shardingConfigUpgrade, } - planWithUnknowns := []TFReplicationSpecsModel{} - keepUnknownsUnchangedSpec := determineKeepUnknownsUnchangedReplicationSpecs(ctx, diags, state, plan, attrChanges) - keepUnknownsUnchangedSpec = append(keepUnknownsUnchangedSpec, determineKeepUnknownsAutoScaling(ctx, diags, state, plan)...) - if diags.HasError() { - return + unknownReplacements := customplanmodifier.NewUnknownReplacements(ctx, tfsdkState, tfsdkPlan, diags, ResourceSchema(ctx), info) + for attrName, replacer := range attributePlanModifiers { + unknownReplacements.AddReplacement(attrName, replacer) } - for i := range planRepSpecsTF { - if i < len(stateRepSpecsTF) { - keepUnknowns := keepUnknownsUnchangedSpec - if attrChanges.ListIndexChanged("replication_specs", i) { - keepUnknowns = determineKeepUnknownsChangedReplicationSpec(keepUnknownsUnchangedSpec, attrChanges, fmt.Sprintf("replication_specs[%d]", i)) - } - schemafunc.CopyUnknowns(ctx, &stateRepSpecsTF[i], &planRepSpecsTF[i], keepUnknowns, keepUnknownsCalls) - } - planWithUnknowns = append(planWithUnknowns, planRepSpecsTF[i]) + unknownReplacements.AddKeepUnknownAlways("connection_strings", "state_name", "mongo_db_version") // Volatile attributes, should not be copied from state) + unknownReplacements.AddKeepUnknownOnChanges(attributeRootChangeMapping) + if computedUsed { + unknownReplacements.AddKeepUnknownAlways("instance_size") } - listType, diagsLocal := types.ListValueFrom(ctx, ReplicationSpecsObjType, planWithUnknowns) - diags.Append(diagsLocal...) - if diags.HasError() { - return + if diskUsed { + unknownReplacements.AddKeepUnknownAlways("disk_size_gb") } - plan.ReplicationSpecs = listType + unknownReplacements.AddKeepUnknownsExtraCall(replicationSpecsKeepUnknownWhenChanged) + unknownReplacements.ApplyReplacements(ctx, diags) } -// AdjustRegionConfigsChildren modifies the planned values of region configs based on the current state. -// This ensures proper handling of removing auto scaling and specs attributes by preserving state values. -func AdjustRegionConfigsChildren(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel) { - stateRepSpecsTF := TFModelList[TFReplicationSpecsModel](ctx, diags, state.ReplicationSpecs) - planRepSpecsTF := TFModelList[TFReplicationSpecsModel](ctx, diags, plan.ReplicationSpecs) - if diags.HasError() { - return +func autoScalingReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { + // don't use auto_scaling or analytics_auto_scaling from state if it's not enabled as it doesn't need to be present in Update request payload + if req.Info.AutoScalingComputedUsed || req.Info.AutoScalingDiskUsed { + return state.(types.Object) } - for i := range minLen(planRepSpecsTF, stateRepSpecsTF) { - stateRegionConfigsTF := TFModelList[TFRegionConfigsModel](ctx, diags, stateRepSpecsTF[i].RegionConfigs) - planRegionConfigsTF := TFModelList[TFRegionConfigsModel](ctx, diags, planRepSpecsTF[i].RegionConfigs) - planElectableSpecInReplicationSpec := findDefinedElectableSpecInReplicationSpec(ctx, planRegionConfigsTF) - if diags.HasError() { - return - } - for j := range minLen(planRegionConfigsTF, stateRegionConfigsTF) { - stateElectableSpecs := TFModelObject[TFSpecsModel](ctx, stateRegionConfigsTF[j].ElectableSpecs) - planElectableSpecs := TFModelObject[TFSpecsModel](ctx, planRegionConfigsTF[j].ElectableSpecs) - if planElectableSpecs == nil && stateElectableSpecs != nil && stateElectableSpecs.NodeCount.ValueInt64() > 0 { - planRegionConfigsTF[j].ElectableSpecs = stateRegionConfigsTF[j].ElectableSpecs - planElectableSpecs = stateElectableSpecs - } - stateReadOnlySpecs := TFModelObject[TFSpecsModel](ctx, stateRegionConfigsTF[j].ReadOnlySpecs) - planReadOnlySpecs := TFModelObject[TFSpecsModel](ctx, planRegionConfigsTF[j].ReadOnlySpecs) - if stateReadOnlySpecs != nil { // read_only_specs is present in state - // logic below ensures that if read only specs is present in state but not in the plan, plan will be populated so that read only spec configuration is not removed on update operations - newPlanReadOnlySpecs := planReadOnlySpecs - if newPlanReadOnlySpecs == nil { - newPlanReadOnlySpecs = new(TFSpecsModel) // start with null attributes if not present plan - } - baseReadOnlySpecs := stateReadOnlySpecs // using values directly from state if no electable specs are present in plan - if planElectableSpecInReplicationSpec != nil { // ensures values are taken from a defined electable spec if not present in current region config - baseReadOnlySpecs = planElectableSpecInReplicationSpec - } - if planElectableSpecs != nil { - // we favor plan electable spec defined in same region config over one defined in replication spec - // with current API this is redudant but is more future proof in case scaling between regions becomes independent in the future - baseReadOnlySpecs = planElectableSpecs - } - copyAttrIfDestNotKnown(&baseReadOnlySpecs.DiskSizeGb, &newPlanReadOnlySpecs.DiskSizeGb) - copyAttrIfDestNotKnown(&baseReadOnlySpecs.EbsVolumeType, &newPlanReadOnlySpecs.EbsVolumeType) - copyAttrIfDestNotKnown(&baseReadOnlySpecs.InstanceSize, &newPlanReadOnlySpecs.InstanceSize) - copyAttrIfDestNotKnown(&baseReadOnlySpecs.DiskIops, &newPlanReadOnlySpecs.DiskIops) - // unknown node_count is always taken from state as it not dependent on electable_specs changes - copyAttrIfDestNotKnown(&stateReadOnlySpecs.NodeCount, &newPlanReadOnlySpecs.NodeCount) - objType, diagsLocal := types.ObjectValueFrom(ctx, SpecsObjType.AttrTypes, newPlanReadOnlySpecs) - diags.Append(diagsLocal...) - if diags.HasError() { - return - } - planRegionConfigsTF[j].ReadOnlySpecs = objType - } + return req.Unknown +} - stateAnalyticsSpecs := TFModelObject[TFSpecsModel](ctx, stateRegionConfigsTF[j].AnalyticsSpecs) - planAnalyticsSpecs := TFModelObject[TFSpecsModel](ctx, planRegionConfigsTF[j].AnalyticsSpecs) - // don't get analytics_specs from state if node_count is 0 to avoid possible ANALYTICS_INSTANCE_SIZE_MUST_MATCH errors - if planAnalyticsSpecs == nil && stateAnalyticsSpecs != nil && stateAnalyticsSpecs.NodeCount.ValueInt64() > 0 { - newPlanAnalyticsSpecs := TFModelObject[TFSpecsModel](ctx, stateRegionConfigsTF[j].AnalyticsSpecs) - // if disk_size_gb is defined at root level we cannot use analytics_specs.disk_size_gb from state as it can be outdated - // read_only_specs implicitly covers this as it uses value from electable_specs which is unknown if not defined. - if plan.DiskSizeGB.ValueFloat64() > 0 { // has known value in config - newPlanAnalyticsSpecs.DiskSizeGb = types.Float64Unknown() - } - objType, diagsLocal := types.ObjectValueFrom(ctx, SpecsObjType.AttrTypes, newPlanAnalyticsSpecs) - diags.Append(diagsLocal...) - if diags.HasError() { - return - } - planRegionConfigsTF[j].AnalyticsSpecs = objType - } +type PlanModifyResourceInfo struct { + AutoScalingComputedUsed bool + AutoScalingDiskUsed bool + isShardingConfigUpgrade bool +} - // don't use auto_scaling or analytics_auto_scaling from state if it's not enabled as it doesn't need to be present in Update request payload - stateAutoScaling := TFModelObject[TFAutoScalingModel](ctx, stateRegionConfigsTF[j].AutoScaling) - planAutoScaling := TFModelObject[TFAutoScalingModel](ctx, planRegionConfigsTF[j].AutoScaling) - if planAutoScaling == nil && stateAutoScaling != nil && (stateAutoScaling.ComputeEnabled.ValueBool() || stateAutoScaling.DiskGBEnabled.ValueBool()) { - planRegionConfigsTF[j].AutoScaling = stateRegionConfigsTF[j].AutoScaling - } - stateAnalyticsAutoScaling := TFModelObject[TFAutoScalingModel](ctx, stateRegionConfigsTF[j].AnalyticsAutoScaling) - planAnalyticsAutoScaling := TFModelObject[TFAutoScalingModel](ctx, planRegionConfigsTF[j].AnalyticsAutoScaling) - if planAnalyticsAutoScaling == nil && stateAnalyticsAutoScaling != nil && (stateAnalyticsAutoScaling.ComputeEnabled.ValueBool() || stateAnalyticsAutoScaling.DiskGBEnabled.ValueBool()) { - planRegionConfigsTF[j].AnalyticsAutoScaling = stateRegionConfigsTF[j].AnalyticsAutoScaling - } - } - listRegionConfigs, diagsLocal := types.ListValueFrom(ctx, RegionConfigsObjType, planRegionConfigsTF) - diags.Append(diagsLocal...) - if diags.HasError() { - return - } - planRepSpecsTF[i].RegionConfigs = listRegionConfigs +func parentRegionConfigs(ctx context.Context, path path.Path, differ *customplanmodifier.PlanModifyDiffer, diags *diag.Diagnostics) []TFRegionConfigsModel { + regionConfigsPath := conversion.AncestorPathNoIndex(path, "region_configs", diags) + if diags.HasError() { + return nil } - listRepSpecs, diagsLocal := types.ListValueFrom(ctx, ReplicationSpecsObjType, planRepSpecsTF) - diags.Append(diagsLocal...) + regionConfigs := customplanmodifier.ReadPlanStructValues[TFRegionConfigsModel](ctx, differ, regionConfigsPath, diags) if diags.HasError() { - return + return nil } - plan.ReplicationSpecs = listRepSpecs + return regionConfigs } -func findDefinedElectableSpecInReplicationSpec(ctx context.Context, regionConfigs []TFRegionConfigsModel) *TFSpecsModel { - for i := range regionConfigs { - electableSpecs := TFModelObject[TFSpecsModel](ctx, regionConfigs[i].ElectableSpecs) - if electableSpecs != nil { - return electableSpecs +func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { + if req.Info.isShardingConfigUpgrade { + return req.Unknown + } + stateParsed := conversion.TFModelObject[TFSpecsModel](ctx, state.(types.Object)) + if stateParsed == nil { + return req.Unknown + } + electablePath := req.Path.ParentPath().AtName("electable_specs") + electable := customplanmodifier.ReadPlanStructValue[TFSpecsModel](ctx, req.Differ, electablePath) + if electable == nil { + regionConfigs := parentRegionConfigs(ctx, req.Path, req.Differ, req.Diags) + if req.Diags.HasError() { + return req.Unknown + } + // ensures values are taken from a defined electable spec if not present in current region config + electable = findDefinedElectableSpecInReplicationSpec(ctx, regionConfigs) + } + var newReadOnly *TFSpecsModel + if electable == nil { + // using values directly from state if no electable specs are present in plan + newReadOnly = stateParsed + } else { + // node_count is from state, all others are from electable_specs plan + newReadOnly = &TFSpecsModel{ + NodeCount: stateParsed.NodeCount, + InstanceSize: electable.InstanceSize, + DiskSizeGb: electable.DiskSizeGb, + EbsVolumeType: electable.EbsVolumeType, + DiskIops: electable.DiskIops, } } - return nil + return conversion.AsObjectValue(ctx, newReadOnly, SpecsObjType.AttrTypes) } -// determineKeepUnknownsChangedReplicationSpec: These fields must be kept unknown in the replication_specs[index_of_changes] -func determineKeepUnknownsChangedReplicationSpec(keepUnknownsAlways []string, attributeChanges *schemafunc.AttributeChanges, parentPath string) []string { - var keepUnknowns = slices.Clone(keepUnknownsAlways) - if attributeChanges.NestedListLenChanges(parentPath + ".region_configs") { - keepUnknowns = append(keepUnknowns, "container_id") +func analyticsAndElectableSpecsReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { + if req.Info.isShardingConfigUpgrade { + return req.Unknown + } + stateParsed := conversion.TFModelObject[TFSpecsModel](ctx, state.(types.Object)) + // don't get analytics_specs from state if node_count is 0 to avoid possible ANALYTICS_INSTANCE_SIZE_MUST_MATCH and INSTANCE_SIZE_MUST_MATCH errors + if stateParsed == nil || stateParsed.NodeCount.ValueInt64() == 0 { + return req.Unknown } - return append(keepUnknowns, attributeChanges.KeepUnknown(attributeReplicationSpecChangeMapping)...) + // if disk_size_gb is defined at root level we cannot use (analytics|electable)_specs.disk_size_gb from state as it can be outdated + if req.Changes.AttributeChanged("disk_size_gb") { + stateParsed.DiskSizeGb = types.Float64Unknown() + } + return conversion.AsObjectValue(ctx, stateParsed, SpecsObjType.AttrTypes) } -func determineKeepUnknownsUnchangedReplicationSpecs(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel, attributeChanges *schemafunc.AttributeChanges) []string { - keepUnknowns := []string{} - // Could be set to "" if we are using an ISS cluster - if usingNewShardingConfig(ctx, plan.ReplicationSpecs, diags) { // When using new sharding config, the legacy id must never be copied - keepUnknowns = append(keepUnknowns, "id") +func replicationSpecsKeepUnknownWhenChanged(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) []string { + if !conversion.HasAncestor(req.Path, path.Root("replication_specs")) { + return nil } - // for isShardingConfigUpgrade, it will be empty in the plan, so we need to keep it unknown - // for listLenChanges, it might be an insertion in the middle of replication spec leading to wrong value from state copied - if isShardingConfigUpgrade(ctx, state, plan, diags) || attributeChanges.ListLenChanges("replication_specs") { - keepUnknowns = append(keepUnknowns, "external_id") + if req.Changes.AttributeChanged("replication_specs") { + return []string{req.AttributeName} } - return keepUnknowns + return nil } -func determineKeepUnknownsAutoScaling(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel) []string { - var keepUnknown []string - computedUsed, diskUsed := autoScalingUsed(ctx, diags, state, plan) - if computedUsed { - keepUnknown = append(keepUnknown, "instance_size") - keepUnknown = append(keepUnknown, attributeReplicationSpecChangeMapping["instance_size"]...) - } - if diskUsed { - keepUnknown = append(keepUnknown, "disk_size_gb") - keepUnknown = append(keepUnknown, attributeReplicationSpecChangeMapping["disk_size_gb"]...) +func findDefinedElectableSpecInReplicationSpec(ctx context.Context, regionConfigs []TFRegionConfigsModel) *TFSpecsModel { + for i := range regionConfigs { + electableSpecs := conversion.TFModelObject[TFSpecsModel](ctx, regionConfigs[i].ElectableSpecs) + if electableSpecs != nil { + return electableSpecs + } } - return keepUnknown + return nil } -// autoScalingUsed checks is auto-scaling was enabled (state) or will be enabled (plan). func autoScalingUsed(ctx context.Context, diags *diag.Diagnostics, state, plan *TFModel) (computedUsed, diskUsed bool) { for _, model := range []*TFModel{state, plan} { - repSpecsTF := TFModelList[TFReplicationSpecsModel](ctx, diags, model.ReplicationSpecs) + repSpecsTF := conversion.TFModelList[TFReplicationSpecsModel](ctx, diags, model.ReplicationSpecs) for i := range repSpecsTF { - regiongConfigsTF := TFModelList[TFRegionConfigsModel](ctx, diags, repSpecsTF[i].RegionConfigs) + regiongConfigsTF := conversion.TFModelList[TFRegionConfigsModel](ctx, diags, repSpecsTF[i].RegionConfigs) for j := range regiongConfigsTF { for _, autoScalingTF := range []types.Object{regiongConfigsTF[j].AutoScaling, regiongConfigsTF[j].AnalyticsAutoScaling} { - autoscaling := TFModelObject[TFAutoScalingModel](ctx, autoScalingTF) + autoscaling := conversion.TFModelObject[TFAutoScalingModel](ctx, autoScalingTF) if autoscaling == nil { continue } @@ -272,40 +197,3 @@ func autoScalingUsed(ctx context.Context, diags *diag.Diagnostics, state, plan * } return } - -func TFModelList[T any](ctx context.Context, diags *diag.Diagnostics, input types.List) []T { - elements := make([]T, len(input.Elements())) - diags.Append(input.ElementsAs(ctx, &elements, false)...) - if diags.HasError() { - return nil - } - return elements -} - -// TFModelObject returns nil if the Terraform object is null or unknown, or casting to T is not valid. However object attributes can be null or unknown. -func TFModelObject[T any](ctx context.Context, input types.Object) *T { - item := new(T) - if diags := input.As(ctx, item, basetypes.ObjectAsOptions{}); diags.HasError() { - return nil - } - return item -} - -func copyAttrIfDestNotKnown[T attr.Value](src, dest *T) { - if !isKnown(*dest) { - *dest = *src - } -} - -// isKnown returns true if the attribute is known (not null or unknown). Note that !isKnown is not the same as IsUnknown because null is !isKnown but not IsUnknown. -func isKnown(attribute attr.Value) bool { - return !attribute.IsNull() && !attribute.IsUnknown() -} - -func minLen[T any](a, b []T) int { - la, lb := len(a), len(b) - if la < lb { - return la - } - return lb -} diff --git a/internal/service/advancedclustertpf/plan_modifier_test.go b/internal/service/advancedclustertpf/plan_modifier_test.go index c0ce795bd9..5f21bb010b 100644 --- a/internal/service/advancedclustertpf/plan_modifier_test.go +++ b/internal/service/advancedclustertpf/plan_modifier_test.go @@ -14,6 +14,7 @@ var ( repSpec1 = tfjsonpath.New("replication_specs").AtSliceIndex(1) regionConfig0 = repSpec0.AtMapKey("region_configs").AtSliceIndex(0) regionConfig1 = repSpec1.AtMapKey("region_configs").AtSliceIndex(0) + advConfig = tfjsonpath.New("advanced_configuration") mockConfig = unit.MockConfigAdvancedClusterTPF ) @@ -69,9 +70,69 @@ func TestPlanChecksClusterTwoRepSpecsWithAutoScalingAndSpecs(t *testing.T) { }, } ) - for _, testCase := range testCases { - t.Run(testCase.ConfigFilename, func(t *testing.T) { - unit.MockPlanChecksAndRun(t, baseConfig.WithPlanCheckTest(testCase)) - }) - } + unit.RunPlanCheckTests(t, baseConfig, testCases) +} + +func TestMockPlanChecks_ClusterReplicasetOneRegion(t *testing.T) { + var ( + baseConfig = unit.NewMockPlanChecksConfig(t, &mockConfig, unit.ImportNameClusterReplicasetOneRegion) + resourceName = baseConfig.ResourceName + testCases = []unit.PlanCheckTest{ + { + ConfigFilename: "main_mongo_db_major_version_changed.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("mongo_db_version")), + }, + }, + { + ConfigFilename: "main_backup_enabled.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + // should use state values inside replication_specs as no changes are made to replication_specs + plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("zone_name"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("zone_id"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("electable_specs").AtMapKey("ebs_volume_type"), knownvalue.NotNull()), + }, + }, + { + ConfigFilename: "main_electable_disk_size_changed.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("disk_size_gb")), + plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("read_only_specs").AtMapKey("disk_size_gb"), knownvalue.Int64Exact(99)), + plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("electable_specs").AtMapKey("disk_size_gb"), knownvalue.Int64Exact(99)), + }, + }, + { + ConfigFilename: "main_tls_cipher_config_mode_changed.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, advConfig.AtMapKey("custom_openssl_cipher_config_tls12")), + plancheck.ExpectKnownValue(resourceName, advConfig.AtMapKey("javascript_enabled"), knownvalue.Bool(true)), + }, + }, + { + ConfigFilename: "main_cluster_type_changed.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("config_server_type")), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("config_server_management_mode")), + plancheck.ExpectKnownValue(resourceName, tfjsonpath.New("bi_connector_config"), knownvalue.ObjectExact(map[string]knownvalue.Check{ + "enabled": knownvalue.Bool(false), + "read_preference": knownvalue.StringExact("secondary"), + })), + }, + }, + { + ConfigFilename: "main_pin_fcv.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("pinned_fcv").AtMapKey("version")), + }, + }, + } + ) + unit.RunPlanCheckTests(t, baseConfig, testCases) } diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index 1559736cbc..da08061aa6 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -98,22 +98,10 @@ type rs struct { // 1. UseStateForUnknown always copies the state for unknown values. However, that leads to `Error: Provider produced inconsistent result after apply` in some cases (see implementation below). // 2. Adding the different UseStateForUnknown is very verbose. func (r *rs) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - if req.State.Raw.IsNull() || req.Plan.Raw.IsNull() || req.Plan.Raw.IsFullyKnown() { // Return early unless it is an Update + if req.State.Raw.IsNull() || req.Plan.Raw.IsNull() || resp.Plan.Raw.IsFullyKnown() { // Return early unless it is an Update return } - var plan, state TFModel - diags := &resp.Diagnostics - diags.Append(req.Plan.Get(ctx, &plan)...) - diags.Append(req.State.Get(ctx, &state)...) - if diags.HasError() { - return - } - - useStateForUnknowns(ctx, diags, &state, &plan) - if diags.HasError() { - return - } - diags.Append(resp.Plan.Set(ctx, plan)...) + unknownReplacements(ctx, &req.State, &resp.Plan, &resp.Diagnostics) } func (r *rs) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { diff --git a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_cluster_type_changed.tf b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_cluster_type_changed.tf new file mode 100644 index 0000000000..cbe65dd0c0 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_cluster_type_changed.tf @@ -0,0 +1,26 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "SHARDED" + + replication_specs = [{ + region_configs = [{ + auto_scaling = { + compute_enabled = false + compute_scale_down_enabled = false + disk_gb_enabled = true + } + electable_specs = { + disk_size_gb = 10 + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + }] + timeouts = { + create = "6000s" + } +} diff --git a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_electable_disk_size_changed.tf b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_electable_disk_size_changed.tf new file mode 100644 index 0000000000..65118cd184 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_electable_disk_size_changed.tf @@ -0,0 +1,26 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + auto_scaling = { + compute_enabled = false + compute_scale_down_enabled = false + disk_gb_enabled = true + } + electable_specs = { + disk_size_gb = 99 + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + }] + timeouts = { + create = "6000s" + } +} diff --git a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_pin_fcv.tf b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_pin_fcv.tf new file mode 100644 index 0000000000..a1f62dde97 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_pin_fcv.tf @@ -0,0 +1,30 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "REPLICASET" + + pinned_fcv = { + expiration_date = "2025-04-03T00:00:00Z" + } + + replication_specs = [{ + region_configs = [{ + auto_scaling = { + compute_enabled = false + compute_scale_down_enabled = false + disk_gb_enabled = true + } + electable_specs = { + disk_size_gb = 10 + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + }] + timeouts = { + create = "6000s" + } +} diff --git a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_tls_cipher_config_mode_changed.tf b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_tls_cipher_config_mode_changed.tf new file mode 100644 index 0000000000..9516587a03 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion/main_tls_cipher_config_mode_changed.tf @@ -0,0 +1,29 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "REPLICASET" + + replication_specs = [{ + region_configs = [{ + auto_scaling = { + compute_enabled = false + compute_scale_down_enabled = false + disk_gb_enabled = true + } + electable_specs = { + disk_size_gb = 10 + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + }] + timeouts = { + create = "6000s" + } + advanced_configuration = { + tls_cipher_config_mode = "CUSTOM" + } +} From b578282d5b4fbe1d335feb1b74c8af838f86671f Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 11:31:14 +0000 Subject: [PATCH 02/10] chore: fix lint error --- internal/service/advancedclustertpf/plan_modifier.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/advancedclustertpf/plan_modifier.go b/internal/service/advancedclustertpf/plan_modifier.go index 8eef4594a0..3d6c28ce6b 100644 --- a/internal/service/advancedclustertpf/plan_modifier.go +++ b/internal/service/advancedclustertpf/plan_modifier.go @@ -31,7 +31,7 @@ var ( "cluster_type": {"config_server_management_mode", "config_server_type"}, // computed values of config server change when REPLICA_SET changes to SHARDED "expiration_date": {"version"}, // pinned_fcv } - attributeReplicationSpecChangeMapping = map[string][]string{ + attributeReplicationSpecChangeMapping = map[string][]string{ //nolint:unused // Add logic to use this in CLOUDP-308783 // All these fields can exist in specs that are computed, therefore, it is not safe to use them when they have changed. "disk_iops": {}, "ebs_volume_type": {}, From 2d62230218895833bfae1cbccba88ace6f24721b Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 12:40:02 +0000 Subject: [PATCH 03/10] test: relax match expression to avoid Attribute 'mongo_db_major_version' expected "8.0", got "8.1" --- .../advancedcluster/resource_advanced_cluster_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index a7133ec44b..2ae3e83219 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -15,6 +15,9 @@ import ( "go.mongodb.org/atlas-sdk/v20250219001/admin" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/knownvalue" + "github.com/hashicorp/terraform-plugin-testing/statecheck" + "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -1255,7 +1258,6 @@ func TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate(t *testing.T) { "state_name": "IDLE", "backup_enabled": "true", "bi_connector_config.0.enabled": "true", - "mongo_db_major_version": "8.0", "pit_enabled": "true", "redact_client_log_data": "true", "replica_set_scaling_strategy": "NODE_TYPE", @@ -1325,6 +1327,10 @@ func TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate(t *testing.T) { { Config: configBasicReplicaset(t, projectID, clusterName, ""), Check: checks, + ConfigStateChecks: []statecheck.StateCheck{ + statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("mongo_db_major_version"), knownvalue.StringRegexp(regexp.MustCompile(`8\.\d+`))), + statecheck.ExpectKnownValue(dataSourceName, tfjsonpath.New("mongo_db_major_version"), knownvalue.StringRegexp(regexp.MustCompile(`8\.\d+`))), + }, }, acc.TestStepImportCluster(resourceName), }, From 5e9e870efc812f95b20c3acf99e73d9ab9c62109 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 13:30:35 +0000 Subject: [PATCH 04/10] test: improve unknown spec replacement to respect changes and auto_scaling --- ...dvancedCluster_removeBlocksFromConfig.yaml | 412 ++++++++++++++++++ .../advancedclustertpf/plan_modifier.go | 30 +- .../advancedclustertpf/plan_modifier_test.go | 62 ++- .../ClusterReplicasetOneRegion.tmpl.yaml | 13 + .../TwoRepSpecsMultipleRegions.tmpl.yaml | 139 ++++++ ...Id}_clusters_{clusterName}_2023-02-01.json | 212 +++++++++ ...Id}_clusters_{clusterName}_2024-08-05.json | 220 ++++++++++ ..._{clusterName}_processArgs_2023-01-01.json | 19 + ..._{clusterName}_processArgs_2024-08-05.json | 17 + ...ontainers?providerName=AWS_2023-01-01.json | 27 ++ .../TwoRepSpecsMultipleRegions/main.tf | 92 ++++ .../main_specs_removed.tf | 30 ++ .../testutil/unit/http_mocker_plan_checks.go | 5 +- .../unit/http_mocker_plan_checks_test.go | 7 + 14 files changed, 1256 insertions(+), 29 deletions(-) create mode 100644 internal/service/advancedcluster/testdata/TestAccAdvancedCluster_removeBlocksFromConfig.yaml create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions.tmpl.yaml create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_containers?providerName=AWS_2023-01-01.json create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main.tf create mode 100644 internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main_specs_removed.tf diff --git a/internal/service/advancedcluster/testdata/TestAccAdvancedCluster_removeBlocksFromConfig.yaml b/internal/service/advancedcluster/testdata/TestAccAdvancedCluster_removeBlocksFromConfig.yaml new file mode 100644 index 0000000000..4feb087fd7 --- /dev/null +++ b/internal/service/advancedcluster/testdata/TestAccAdvancedCluster_removeBlocksFromConfig.yaml @@ -0,0 +1,412 @@ +variables: + clusterName: test-acc-tf-c-1180295375826324773 + groupId: 67e51853f90e9f3acf6b3a40 +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "67e51853f90e9f3acf6b3a40" + name = "test-acc-tf-c-1180295375826324773" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 5 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + analytics_specs = { + instance_size = "M10" + node_count = 4 + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 1 + } + region_name = "US_WEST_2" + }, { + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + priority = 0 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + version: '2024-10-23' + text: "{\n \"clusterType\": \"GEOSHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 1\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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\": \"GEOSHARDED\",\n \"labels\": [],\n \"name\": \"{clusterName}\",\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 1\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"tags\": []\n}" + responses: + - response_index: 1 + status: 201 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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: 21 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": []\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"CREATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 24 + status: 200 + duplicate_responses: 1 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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: 25 + status: 200 + duplicate_responses: 1 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e0\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers?providerName=AWS + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 26 + 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\": \"67e5185ec30ea008dc4672f7\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0d8d5e2dcfc6b32a7\"\n },\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67e5185ec30ea008dc4672f8\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_WEST_2\",\n \"vpcId\": \"vpc-01daec068f35507b2\"\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: 27 + 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: 28 + 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 = "67e51853f90e9f3acf6b3a40" + name = "test-acc-tf-c-1180295375826324773" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + electable_specs = { + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_WEST_2" + }, { + priority = 0 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] + } + diff_requests: [] + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 34 + status: 200 + duplicate_responses: 1 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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 \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e0\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers?providerName=AWS + 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\": \"67e5185ec30ea008dc4672f7\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0d8d5e2dcfc6b32a7\"\n },\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67e5185ec30ea008dc4672f8\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_WEST_2\",\n \"vpcId\": \"vpc-01daec068f35507b2\"\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: 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\": 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: 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\": 1,\n \"sampleRefreshIntervalBIConnector\": null,\n \"sampleSizeBIConnector\": null,\n \"tlsCipherConfigMode\": \"DEFAULT\",\n \"transactionLifetimeLimitSeconds\": null\n}" + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "67e51853f90e9f3acf6b3a40" + name = "test-acc-tf-c-1180295375826324773" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + electable_specs = { + instance_size = "M20" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_WEST_2" + }, { + priority = 0 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] + } + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + version: '2024-10-23' + text: "{\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 1\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 2\"\n }\n ]\n}" + responses: + - response_index: 49 + status: 200 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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: 44 + status: 200 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 50 + status: 200 + duplicate_responses: 45 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 96 + status: 200 + duplicate_responses: 1 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\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: 45 + status: 200 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskSizeGB\": 10,\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e0\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e2\",\n \"numShards\": 1,\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\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\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 97 + status: 400 + duplicate_responses: 1 + text: "{\n \"detail\": \"Asymmetric sharded cluster is not supported by the current API version. Please use the latest API instead. Documentation for the latest API is available at https://docs.atlas.mongodb.com/reference/api/clusters-advanced/.\",\n \"error\": 400,\n \"errorCode\": \"ASYMMETRIC_SHARD_UNSUPPORTED\",\n \"parameters\": [],\n \"reason\": \"Bad Request\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers?providerName=AWS + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 46 + 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\": \"67e5185ec30ea008dc4672f7\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0d8d5e2dcfc6b32a7\"\n },\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67e5185ec30ea008dc4672f8\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_WEST_2\",\n \"vpcId\": \"vpc-01daec068f35507b2\"\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: 47 + 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: 48 + 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-10-23' + text: "{\n \"replicationSpecs\": [\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 1\"\n },\n {\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskSizeGB\": 10,\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneName\": \"Zone 2\"\n }\n ]\n}" + responses: + - response_index: 49 + status: 200 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"UPDATING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - config: "" + diff_requests: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + version: '2023-02-01' + text: "" + responses: + - response_index: 109 + status: 202 + text: "{}" + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 104 + status: 200 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"IDLE\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 110 + status: 200 + duplicate_responses: 6 + text: "{\n \"advancedConfiguration\": {\n \"customOpensslCipherConfigTls12\": [],\n \"minimumEnabledTlsProtocol\": \"TLS1_2\",\n \"tlsCipherConfigMode\": \"DEFAULT\"\n },\n \"backupEnabled\": false,\n \"biConnector\": {\n \"enabled\": false,\n \"readPreference\": \"secondary\"\n },\n \"clusterType\": \"GEOSHARDED\",\n \"configServerManagementMode\": \"ATLAS_MANAGED\",\n \"configServerType\": \"DEDICATED\",\n \"connectionStrings\": {\n \"awsPrivateLinkSrv\": {},\n \"privateEndpoint\": [],\n \"standard\": \"mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\\u0026authSource=admin\",\n \"standardSrv\": \"mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net\"\n },\n \"createDate\": \"2025-03-27T09:20:30Z\",\n \"diskWarmingMode\": \"FULLY_WARMED\",\n \"encryptionAtRestProvider\": \"NONE\",\n \"featureCompatibilityVersion\": \"8.0\",\n \"globalClusterSelfManagedSharding\": false,\n \"groupId\": \"{groupId}\",\n \"id\": \"67e5185ec30ea008dc4672f9\",\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.6\",\n \"name\": \"{clusterName}\",\n \"paused\": false,\n \"pitEnabled\": false,\n \"redactClientLogData\": false,\n \"replicationSpecs\": [\n {\n \"id\": \"67e5185dc30ea008dc4672e1\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 5\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672de\",\n \"zoneName\": \"Zone 1\"\n },\n {\n \"id\": \"67e5185dc30ea008dc4672e3\",\n \"regionConfigs\": [\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"analyticsSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M10\",\n \"nodeCount\": 4\n },\n \"autoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 3\n },\n \"priority\": 7,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 1\n },\n \"regionName\": \"US_WEST_2\"\n },\n {\n \"analyticsAutoScaling\": {\n \"compute\": {\n \"enabled\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\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\": true,\n \"maxInstanceSize\": \"M30\",\n \"minInstanceSize\": \"M10\",\n \"predictiveEnabled\": false,\n \"scaleDownEnabled\": true\n },\n \"diskGB\": {\n \"enabled\": true\n }\n },\n \"electableSpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 0\n },\n \"priority\": 0,\n \"providerName\": \"AWS\",\n \"readOnlySpecs\": {\n \"diskIOPS\": 3000,\n \"diskSizeGB\": 10,\n \"ebsVolumeType\": \"STANDARD\",\n \"instanceSize\": \"M20\",\n \"nodeCount\": 2\n },\n \"regionName\": \"US_EAST_1\"\n }\n ],\n \"zoneId\": \"67e5185dc30ea008dc4672df\",\n \"zoneName\": \"Zone 2\"\n }\n ],\n \"rootCertType\": \"ISRGROOTX1\",\n \"stateName\": \"DELETING\",\n \"tags\": [],\n \"terminationProtectionEnabled\": false,\n \"versionReleaseSystem\": \"LTS\"\n}" + - response_index: 117 + 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: 105 + status: 400 + text: "{\n \"detail\": \"Asymmetric sharded cluster is not supported by the current API version. Please use the latest API instead. Documentation for the latest API is available at https://docs.atlas.mongodb.com/reference/api/clusters-advanced/.\",\n \"error\": 400,\n \"errorCode\": \"ASYMMETRIC_SHARD_UNSUPPORTED\",\n \"parameters\": [],\n \"reason\": \"Bad Request\"\n}" + - path: /api/atlas/v2/groups/{groupId}/containers?providerName=AWS + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 106 + 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\": \"67e5185ec30ea008dc4672f7\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_EAST_1\",\n \"vpcId\": \"vpc-0d8d5e2dcfc6b32a7\"\n },\n {\n \"atlasCidrBlock\": \"192.168.240.0/21\",\n \"id\": \"67e5185ec30ea008dc4672f8\",\n \"providerName\": \"AWS\",\n \"provisioned\": true,\n \"regionName\": \"US_WEST_2\",\n \"vpcId\": \"vpc-01daec068f35507b2\"\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: 107 + 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: 108 + 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: 109 + status: 202 + text: "{}" diff --git a/internal/service/advancedclustertpf/plan_modifier.go b/internal/service/advancedclustertpf/plan_modifier.go index 3d6c28ce6b..07224b9117 100644 --- a/internal/service/advancedclustertpf/plan_modifier.go +++ b/internal/service/advancedclustertpf/plan_modifier.go @@ -24,9 +24,8 @@ var ( // Change mappings uses `attribute_name`, it doesn't care about the nested level. // However, it doesn't stop calling `replication_specs.**.attribute_name`. attributeRootChangeMapping = map[string][]string{ - "disk_size_gb": {}, // disk_size_gb can be change at any level/spec - "replication_specs": {}, - // "mongo_db_major_version": {"mongo_db_version"}, // Using new plan modifier logic to test this + "disk_size_gb": {}, // disk_size_gb can be change at any level/spec + "replication_specs": {}, "tls_cipher_config_mode": {"custom_openssl_cipher_config_tls12"}, "cluster_type": {"config_server_management_mode", "config_server_type"}, // computed values of config server change when REPLICA_SET changes to SHARDED "expiration_date": {"version"}, // pinned_fcv @@ -68,7 +67,7 @@ func unknownReplacements(ctx context.Context, tfsdkState *tfsdk.State, tfsdkPlan unknownReplacements.AddKeepUnknownAlways("connection_strings", "state_name", "mongo_db_version") // Volatile attributes, should not be copied from state) unknownReplacements.AddKeepUnknownOnChanges(attributeRootChangeMapping) if computedUsed { - unknownReplacements.AddKeepUnknownAlways("instance_size") + unknownReplacements.AddKeepUnknownAlways("instance_size", "disk_iops") } if diskUsed { unknownReplacements.AddKeepUnknownAlways("disk_size_gb") @@ -113,6 +112,12 @@ func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *custompl } electablePath := req.Path.ParentPath().AtName("electable_specs") electable := customplanmodifier.ReadPlanStructValue[TFSpecsModel](ctx, req.Differ, electablePath) + if electable == nil { + electableState := customplanmodifier.ReadStateStructValue[TFSpecsModel](ctx, req.Differ, electablePath) + if electableState.NodeCount.ValueInt64() > 0 { + electable = electableState + } + } if electable == nil { regionConfigs := parentRegionConfigs(ctx, req.Path, req.Differ, req.Diags) if req.Diags.HasError() { @@ -135,7 +140,7 @@ func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *custompl DiskIops: electable.DiskIops, } } - return conversion.AsObjectValue(ctx, newReadOnly, SpecsObjType.AttrTypes) + return ensureSpecRespectChanges(ctx, newReadOnly, req) } func analyticsAndElectableSpecsReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { @@ -147,11 +152,18 @@ func analyticsAndElectableSpecsReplaceUnknown(ctx context.Context, state attr.Va if stateParsed == nil || stateParsed.NodeCount.ValueInt64() == 0 { return req.Unknown } - // if disk_size_gb is defined at root level we cannot use (analytics|electable)_specs.disk_size_gb from state as it can be outdated - if req.Changes.AttributeChanged("disk_size_gb") { - stateParsed.DiskSizeGb = types.Float64Unknown() + return ensureSpecRespectChanges(ctx, stateParsed, req) +} + +func ensureSpecRespectChanges(ctx context.Context, spec *TFSpecsModel, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) types.Object { + // if disk_size_gb is defined at root level we cannot use (analytics|electable|read_only)_specs.disk_size_gb from state as it can be outdated + if req.Changes.AttributeChanged("disk_size_gb") || req.Info.AutoScalingDiskUsed { + spec.DiskSizeGb = types.Float64Unknown() + } + if req.Info.AutoScalingComputedUsed { + spec.DiskIops = types.Int64Unknown() } - return conversion.AsObjectValue(ctx, stateParsed, SpecsObjType.AttrTypes) + return conversion.AsObjectValue(ctx, spec, SpecsObjType.AttrTypes) } func replicationSpecsKeepUnknownWhenChanged(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) []string { diff --git a/internal/service/advancedclustertpf/plan_modifier_test.go b/internal/service/advancedclustertpf/plan_modifier_test.go index 5f21bb010b..ec2d22f71a 100644 --- a/internal/service/advancedclustertpf/plan_modifier_test.go +++ b/internal/service/advancedclustertpf/plan_modifier_test.go @@ -10,12 +10,13 @@ import ( ) var ( - repSpec0 = tfjsonpath.New("replication_specs").AtSliceIndex(0) - repSpec1 = tfjsonpath.New("replication_specs").AtSliceIndex(1) - regionConfig0 = repSpec0.AtMapKey("region_configs").AtSliceIndex(0) - regionConfig1 = repSpec1.AtMapKey("region_configs").AtSliceIndex(0) - advConfig = tfjsonpath.New("advanced_configuration") - mockConfig = unit.MockConfigAdvancedClusterTPF + repSpec0 = tfjsonpath.New("replication_specs").AtSliceIndex(0) + repSpec1 = tfjsonpath.New("replication_specs").AtSliceIndex(1) + regionConfig0_0 = repSpec0.AtMapKey("region_configs").AtSliceIndex(0) + regionConfig1_0 = repSpec1.AtMapKey("region_configs").AtSliceIndex(0) + regionConfig1_1 = repSpec1.AtMapKey("region_configs").AtSliceIndex(1) + advConfig = tfjsonpath.New("advanced_configuration") + mockConfig = unit.MockConfigAdvancedClusterTPF ) func autoScalingKnownValue(computeEnabled, diskEnabled, scaleDown bool, minInstanceSize, maxInstanceSize string) knownvalue.Check { @@ -52,19 +53,19 @@ func TestPlanChecksClusterTwoRepSpecsWithAutoScalingAndSpecs(t *testing.T) { Checks: []plancheck.PlanCheck{ plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), // checks regionConfig0 - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M10", 2)), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("electable_specs"), specInstanceSizeNodeCount("M10", 5)), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("auto_scaling"), autoScalingEnabled), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("analytics_auto_scaling"), autoScalingEnabled), - plancheck.ExpectUnknownValue(resourceName, regionConfig0.AtMapKey("analytics_specs")), // analytics specs was defined in region_configs.0 but not in region_configs.1 + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M10", 2)), + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("electable_specs"), specInstanceSizeNodeCount("M10", 5)), + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("auto_scaling"), autoScalingEnabled), + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("analytics_auto_scaling"), autoScalingEnabled), + plancheck.ExpectUnknownValue(resourceName, regionConfig0_0.AtMapKey("analytics_specs")), // analytics specs was defined in region_configs.0 but not in region_configs.1 plancheck.ExpectUnknownValue(resourceName, repSpec0.AtMapKey("id")), // checks regionConfig1 - plancheck.ExpectKnownValue(resourceName, regionConfig1.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M20", 1)), - plancheck.ExpectKnownValue(resourceName, regionConfig1.AtMapKey("electable_specs"), specInstanceSizeNodeCount("M20", 3)), - plancheck.ExpectKnownValue(resourceName, regionConfig1.AtMapKey("auto_scaling"), autoScalingEnabled), - plancheck.ExpectKnownValue(resourceName, regionConfig1.AtMapKey("analytics_auto_scaling"), autoScalingEnabled), - plancheck.ExpectKnownValue(resourceName, regionConfig1.AtMapKey("analytics_specs"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M20", 1)), + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("electable_specs"), specInstanceSizeNodeCount("M20", 3)), + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("auto_scaling"), autoScalingEnabled), + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("analytics_auto_scaling"), autoScalingEnabled), + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("analytics_specs"), knownvalue.NotNull()), plancheck.ExpectUnknownValue(resourceName, repSpec1.AtMapKey("id")), }, }, @@ -93,7 +94,7 @@ func TestMockPlanChecks_ClusterReplicasetOneRegion(t *testing.T) { plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("id"), knownvalue.NotNull()), plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("zone_name"), knownvalue.NotNull()), plancheck.ExpectKnownValue(resourceName, repSpec0.AtMapKey("zone_id"), knownvalue.NotNull()), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("electable_specs").AtMapKey("ebs_volume_type"), knownvalue.NotNull()), + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("electable_specs").AtMapKey("ebs_volume_type"), knownvalue.NotNull()), }, }, { @@ -101,8 +102,8 @@ func TestMockPlanChecks_ClusterReplicasetOneRegion(t *testing.T) { Checks: []plancheck.PlanCheck{ plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), plancheck.ExpectUnknownValue(resourceName, tfjsonpath.New("disk_size_gb")), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("read_only_specs").AtMapKey("disk_size_gb"), knownvalue.Int64Exact(99)), - plancheck.ExpectKnownValue(resourceName, regionConfig0.AtMapKey("electable_specs").AtMapKey("disk_size_gb"), knownvalue.Int64Exact(99)), + plancheck.ExpectUnknownValue(resourceName, regionConfig0_0.AtMapKey("read_only_specs").AtMapKey("disk_size_gb")), // disk_size_gb is changed so always marked as unknown + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("electable_specs").AtMapKey("disk_size_gb"), knownvalue.Int64Exact(99)), }, }, { @@ -136,3 +137,26 @@ func TestMockPlanChecks_ClusterReplicasetOneRegion(t *testing.T) { ) unit.RunPlanCheckTests(t, baseConfig, testCases) } + +func TestPlanChecksClusterTwoRepSpecsMultipleRegions(t *testing.T) { + var ( + baseConfig = unit.NewMockPlanChecksConfig(t, &mockConfig, unit.ImportNameTwoRepSpecsMultipleRegions) + resourceName = baseConfig.ResourceName + testCases = []unit.PlanCheckTest{ + { + ConfigFilename: "main_specs_removed.tf", + Checks: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction(resourceName, plancheck.ResourceActionUpdate), + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M10", 2)), // copied from state + plancheck.ExpectKnownValue(resourceName, regionConfig0_0.AtMapKey("electable_specs"), specInstanceSizeNodeCount("M10", 5)), // copied from state + plancheck.ExpectKnownValue(resourceName, regionConfig1_0.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M20", 1)), // copied from plan in same region_config + plancheck.ExpectKnownValue(resourceName, regionConfig1_1.AtMapKey("read_only_specs"), specInstanceSizeNodeCount("M20", 2)), // copied from plan in different region_config + plancheck.ExpectUnknownValue(resourceName, regionConfig1_1.AtMapKey("read_only_specs").AtMapKey("disk_iops")), // auto_scaling.compute_enabled is used, so disk_iops should be unknown + plancheck.ExpectUnknownValue(resourceName, regionConfig1_1.AtMapKey("read_only_specs").AtMapKey("disk_size_gb")), // auto_scaling.disk_enabled is used, so disk_size_gb should be unknown + plancheck.ExpectUnknownValue(resourceName, regionConfig1_1.AtMapKey("electable_specs")), // node_count = 0, should not be copied + }, + }, + } + ) + unit.RunPlanCheckTests(t, baseConfig, testCases) +} diff --git a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion.tmpl.yaml b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion.tmpl.yaml index 7e26b2d059..f505bd89b0 100644 --- a/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion.tmpl.yaml +++ b/internal/service/advancedclustertpf/testdata/ClusterReplicasetOneRegion.tmpl.yaml @@ -29,6 +29,19 @@ steps: create = "6000s" } } + + 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 + depends_on = [mongodbatlas_advanced_cluster.test] + } + + data "mongodbatlas_advanced_clusters" "test" { + use_replication_spec_per_shard = true + project_id = mongodbatlas_advanced_cluster.test.project_id + depends_on = [mongodbatlas_advanced_cluster.test] + } diff_requests: [] request_responses: - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions.tmpl.yaml b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions.tmpl.yaml new file mode 100644 index 0000000000..cb066b6db6 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions.tmpl.yaml @@ -0,0 +1,139 @@ +variables: + clusterName: mocked-cluster + groupId: "111111111111111111111111" +steps: + - config: |- + resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 5 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + analytics_specs = { + instance_size = "M10" + node_count = 4 + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 1 + } + region_name = "US_WEST_2" + }, { + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + priority = 0 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] + } + diff_requests: [] + request_responses: + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 0 + status: 200 + text: "import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + version: '2023-02-01' + text: "" + responses: + - response_index: 0 + status: 200 + text: "import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json" + - path: /api/atlas/v2/groups/{groupId}/containers?providerName=AWS + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 0 + status: 200 + text: "import_GET__api_atlas_v2_groups_{groupId}_containers?providerName=AWS_2023-01-01.json" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2023-01-01' + text: "" + responses: + - response_index: 0 + status: 200 + text: "import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json" + - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs + method: GET + version: '2024-08-05' + text: "" + responses: + - response_index: 0 + status: 200 + text: "import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json" diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json new file mode 100644 index 0000000000..6e19139e18 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2023-02-01.json @@ -0,0 +1,212 @@ +{ + "advancedConfiguration": { + "customOpensslCipherConfigTls12": [], + "minimumEnabledTlsProtocol": "TLS1_2", + "tlsCipherConfigMode": "DEFAULT" + }, + "backupEnabled": false, + "biConnector": { + "enabled": false, + "readPreference": "secondary" + }, + "clusterType": "GEOSHARDED", + "configServerManagementMode": "ATLAS_MANAGED", + "configServerType": "DEDICATED", + "connectionStrings": { + "awsPrivateLinkSrv": {}, + "privateEndpoint": [], + "standard": "mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\u0026authSource=admin", + "standardSrv": "mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net" + }, + "createDate": "2025-03-27T09:20:30Z", + "diskSizeGB": 10, + "diskWarmingMode": "FULLY_WARMED", + "encryptionAtRestProvider": "NONE", + "globalClusterSelfManagedSharding": false, + "groupId": "{groupId}", + "id": "67e5185ec30ea008dc4672f9", + "labels": [], + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}", + "rel": "self" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs", + "rel": "https://cloud.mongodb.com/restoreJobs" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots", + "rel": "https://cloud.mongodb.com/snapshots" + } + ], + "mongoDBMajorVersion": "8.0", + "mongoDBVersion": "8.0.6", + "name": "{clusterName}", + "paused": false, + "pitEnabled": false, + "replicationSpecs": [ + { + "id": "67e5185dc30ea008dc4672e0", + "numShards": 1, + "regionConfigs": [ + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 5 + }, + "priority": 7, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 2 + }, + "regionName": "US_EAST_1" + } + ], + "zoneId": "67e5185dc30ea008dc4672de", + "zoneName": "Zone 1" + }, + { + "id": "67e5185dc30ea008dc4672e2", + "numShards": 1, + "regionConfigs": [ + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 4 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 3 + }, + "priority": 7, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 1 + }, + "regionName": "US_WEST_2" + }, + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "priority": 0, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 2 + }, + "regionName": "US_EAST_1" + } + ], + "zoneId": "67e5185dc30ea008dc4672df", + "zoneName": "Zone 2" + } + ], + "rootCertType": "ISRGROOTX1", + "stateName": "IDLE", + "tags": [], + "terminationProtectionEnabled": false, + "versionReleaseSystem": "LTS" +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json new file mode 100644 index 0000000000..c144dd9567 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_2024-08-05.json @@ -0,0 +1,220 @@ +{ + "advancedConfiguration": { + "customOpensslCipherConfigTls12": [], + "minimumEnabledTlsProtocol": "TLS1_2", + "tlsCipherConfigMode": "DEFAULT" + }, + "backupEnabled": false, + "biConnector": { + "enabled": false, + "readPreference": "secondary" + }, + "clusterType": "GEOSHARDED", + "configServerManagementMode": "ATLAS_MANAGED", + "configServerType": "DEDICATED", + "connectionStrings": { + "awsPrivateLinkSrv": {}, + "privateEndpoint": [], + "standard": "mongodb://test-acc-tf-c-118029537-shard-00-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-00-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-00.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-01.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-02.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-03.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-04.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-05.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-06.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-07.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-08.o3bju.mongodb-dev.net:27016,test-acc-tf-c-118029537-shard-01-09.o3bju.mongodb-dev.net:27016/?ssl=true\u0026authSource=admin", + "standardSrv": "mongodb+srv://test-acc-tf-c-118029537.o3bju.mongodb-dev.net" + }, + "createDate": "2025-03-27T09:20:30Z", + "diskWarmingMode": "FULLY_WARMED", + "encryptionAtRestProvider": "NONE", + "featureCompatibilityVersion": "8.0", + "globalClusterSelfManagedSharding": false, + "groupId": "{groupId}", + "id": "67e5185ec30ea008dc4672f9", + "labels": [], + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}", + "rel": "self" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs", + "rel": "https://cloud.mongodb.com/restoreJobs" + }, + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots", + "rel": "https://cloud.mongodb.com/snapshots" + } + ], + "mongoDBMajorVersion": "8.0", + "mongoDBVersion": "8.0.6", + "name": "{clusterName}", + "paused": false, + "pitEnabled": false, + "redactClientLogData": false, + "replicationSpecs": [ + { + "id": "67e5185dc30ea008dc4672e1", + "regionConfigs": [ + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 5 + }, + "priority": 7, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 2 + }, + "regionName": "US_EAST_1" + } + ], + "zoneId": "67e5185dc30ea008dc4672de", + "zoneName": "Zone 1" + }, + { + "id": "67e5185dc30ea008dc4672e3", + "regionConfigs": [ + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 4 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 3 + }, + "priority": 7, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 1 + }, + "regionName": "US_WEST_2" + }, + { + "analyticsAutoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "analyticsSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "autoScaling": { + "compute": { + "enabled": true, + "maxInstanceSize": "M30", + "minInstanceSize": "M10", + "predictiveEnabled": false, + "scaleDownEnabled": true + }, + "diskGB": { + "enabled": true + } + }, + "electableSpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 0 + }, + "priority": 0, + "providerName": "AWS", + "readOnlySpecs": { + "diskIOPS": 3000, + "diskSizeGB": 10, + "ebsVolumeType": "STANDARD", + "instanceSize": "M10", + "nodeCount": 2 + }, + "regionName": "US_EAST_1" + } + ], + "zoneId": "67e5185dc30ea008dc4672df", + "zoneName": "Zone 2" + } + ], + "rootCertType": "ISRGROOTX1", + "stateName": "IDLE", + "tags": [], + "terminationProtectionEnabled": false, + "versionReleaseSystem": "LTS" +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json new file mode 100644 index 0000000000..90acae41a2 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2023-01-01.json @@ -0,0 +1,19 @@ +{ + "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": null, + "chunkMigrationConcurrency": null, + "customOpensslCipherConfigTls12": [], + "defaultMaxTimeMS": null, + "defaultReadConcern": null, + "defaultWriteConcern": null, + "failIndexKeyTooLong": null, + "javascriptEnabled": true, + "minimumEnabledTlsProtocol": "TLS1_2", + "noTableScan": false, + "oplogMinRetentionHours": null, + "oplogSizeMB": null, + "queryStatsLogVerbosity": 1, + "sampleRefreshIntervalBIConnector": null, + "sampleSizeBIConnector": null, + "tlsCipherConfigMode": "DEFAULT", + "transactionLifetimeLimitSeconds": null +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json new file mode 100644 index 0000000000..25d92e3151 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_clusters_{clusterName}_processArgs_2024-08-05.json @@ -0,0 +1,17 @@ +{ + "changeStreamOptionsPreAndPostImagesExpireAfterSeconds": null, + "chunkMigrationConcurrency": null, + "customOpensslCipherConfigTls12": [], + "defaultMaxTimeMS": null, + "defaultWriteConcern": null, + "javascriptEnabled": true, + "minimumEnabledTlsProtocol": "TLS1_2", + "noTableScan": false, + "oplogMinRetentionHours": null, + "oplogSizeMB": null, + "queryStatsLogVerbosity": 1, + "sampleRefreshIntervalBIConnector": null, + "sampleSizeBIConnector": null, + "tlsCipherConfigMode": "DEFAULT", + "transactionLifetimeLimitSeconds": null +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_containers?providerName=AWS_2023-01-01.json b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_containers?providerName=AWS_2023-01-01.json new file mode 100644 index 0000000000..020e3355e8 --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/import_GET__api_atlas_v2_groups_{groupId}_containers?providerName=AWS_2023-01-01.json @@ -0,0 +1,27 @@ +{ + "links": [ + { + "href": "https://cloud-dev.mongodb.com/api/atlas/v2/groups/{groupId}/containers?includeCount=true\u0026providerName=AWS\u0026pageNum=1\u0026itemsPerPage=100", + "rel": "self" + } + ], + "results": [ + { + "atlasCidrBlock": "192.168.248.0/21", + "id": "67e5185ec30ea008dc4672f7", + "providerName": "AWS", + "provisioned": true, + "regionName": "US_EAST_1", + "vpcId": "vpc-0d8d5e2dcfc6b32a7" + }, + { + "atlasCidrBlock": "192.168.240.0/21", + "id": "67e5185ec30ea008dc4672f8", + "providerName": "AWS", + "provisioned": true, + "regionName": "US_WEST_2", + "vpcId": "vpc-01daec068f35507b2" + } + ], + "totalCount": 2 +} \ No newline at end of file diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main.tf b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main.tf new file mode 100644 index 0000000000..16a72a175e --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main.tf @@ -0,0 +1,92 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 5 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + analytics_specs = { + instance_size = "M10" + node_count = 4 + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + electable_specs = { + instance_size = "M10" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 1 + } + region_name = "US_WEST_2" + }, { + analytics_auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + auto_scaling = { + compute_enabled = true + compute_max_instance_size = "M30" + compute_min_instance_size = "M10" + compute_scale_down_enabled = true + disk_gb_enabled = true + } + priority = 0 + provider_name = "AWS" + read_only_specs = { + instance_size = "M10" + node_count = 2 + } + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] +} diff --git a/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main_specs_removed.tf b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main_specs_removed.tf new file mode 100644 index 0000000000..3bffdd655f --- /dev/null +++ b/internal/service/advancedclustertpf/testdata/TwoRepSpecsMultipleRegions/main_specs_removed.tf @@ -0,0 +1,30 @@ +resource "mongodbatlas_advanced_cluster" "test" { + project_id = "111111111111111111111111" + name = "mocked-cluster" + cluster_type = "GEOSHARDED" + + + replication_specs = [{ + region_configs = [{ + priority = 7 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 1" + }, { + region_configs = [{ + electable_specs = { + instance_size = "M20" + node_count = 3 + } + priority = 7 + provider_name = "AWS" + region_name = "US_WEST_2" + }, { + priority = 0 + provider_name = "AWS" + region_name = "US_EAST_1" + }] + zone_name = "Zone 2" + }] +} diff --git a/internal/testutil/unit/http_mocker_plan_checks.go b/internal/testutil/unit/http_mocker_plan_checks.go index 85e3b1dbbf..b05120c496 100644 --- a/internal/testutil/unit/http_mocker_plan_checks.go +++ b/internal/testutil/unit/http_mocker_plan_checks.go @@ -22,6 +22,7 @@ import ( const ( ImportNameClusterTwoRepSpecsWithAutoScalingAndSpecs = "ClusterTwoRepSpecsWithAutoScalingAndSpecs" ImportNameClusterReplicasetOneRegion = "ClusterReplicasetOneRegion" + ImportNameTwoRepSpecsMultipleRegions = "TwoRepSpecsMultipleRegions" MockedClusterName = "mocked-cluster" MockedProjectID = "111111111111111111111111" ) @@ -32,13 +33,15 @@ var ( planCheckTestCounter = 0 importIDMapping = map[string]string{ - ImportNameClusterTwoRepSpecsWithAutoScalingAndSpecs: fmt.Sprintf("%s-%s", MockedProjectID, MockedClusterName), + ImportNameClusterTwoRepSpecsWithAutoScalingAndSpecs: clusterImportID, ImportNameClusterReplicasetOneRegion: clusterImportID, + ImportNameTwoRepSpecsMultipleRegions: clusterImportID, } // later this could be inferred when reading the src main.tf importResourceNameMapping = map[string]string{ ImportNameClusterTwoRepSpecsWithAutoScalingAndSpecs: "mongodbatlas_advanced_cluster.test", ImportNameClusterReplicasetOneRegion: "mongodbatlas_advanced_cluster.test", + ImportNameTwoRepSpecsMultipleRegions: "mongodbatlas_advanced_cluster.test", } ) diff --git a/internal/testutil/unit/http_mocker_plan_checks_test.go b/internal/testutil/unit/http_mocker_plan_checks_test.go index 0d4c70eaa1..ae299ed746 100644 --- a/internal/testutil/unit/http_mocker_plan_checks_test.go +++ b/internal/testutil/unit/http_mocker_plan_checks_test.go @@ -51,6 +51,13 @@ func TestConvertMockableTests(t *testing.T) { SrcPackage: pkgAdvancedCluster, DestPackage: pkgAdvancedClusterTPF, }, + unit.ImportNameTwoRepSpecsMultipleRegions: { + TestName: "TestAccAdvancedCluster_removeBlocksFromConfig", + Step: 1, + VariableReplacments: clusterVariableReplacements, + SrcPackage: pkgAdvancedCluster, + DestPackage: pkgAdvancedClusterTPF, + }, } { srcTestdata := path.Join(unit.PackagePath(config.SrcPackage), "testdata") destTestdata := path.Join(unit.PackagePath(config.DestPackage), "testdata") From b90325314db65f0b3f9bf6def149b2666a7699f0 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 13:35:21 +0000 Subject: [PATCH 05/10] refactor: use existing req.Plan instead of resp.Plan --- internal/service/advancedclustertpf/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/advancedclustertpf/resource.go b/internal/service/advancedclustertpf/resource.go index da08061aa6..d62f129efd 100644 --- a/internal/service/advancedclustertpf/resource.go +++ b/internal/service/advancedclustertpf/resource.go @@ -98,7 +98,7 @@ type rs struct { // 1. UseStateForUnknown always copies the state for unknown values. However, that leads to `Error: Provider produced inconsistent result after apply` in some cases (see implementation below). // 2. Adding the different UseStateForUnknown is very verbose. func (r *rs) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - if req.State.Raw.IsNull() || req.Plan.Raw.IsNull() || resp.Plan.Raw.IsFullyKnown() { // Return early unless it is an Update + if req.State.Raw.IsNull() || req.Plan.Raw.IsNull() || req.Plan.Raw.IsFullyKnown() { // Return early unless it is an Update return } unknownReplacements(ctx, &req.State, &resp.Plan, &resp.Diagnostics) From e7e7a04f802dfad56cbcde9e06e8b810b2566379 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Thu, 27 Mar 2025 13:55:04 +0000 Subject: [PATCH 06/10] chore: increase unit test timeout --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9f58b5eac4..68c10e83c1 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ test: fmtcheck ## Run unit tests @$(eval export MONGODB_ATLAS_ORG_ID?=111111111111111111111111) @$(eval export MONGODB_ATLAS_PROJECT_ID?=111111111111111111111111) @$(eval export MONGODB_ATLAS_CLUSTER_NAME?=mocked-cluster) - go test ./... -timeout=120s -parallel=$(PARALLEL_GO_TEST) -race + go test ./... -timeout=180s -parallel=$(PARALLEL_GO_TEST) -race .PHONY: testmact testmact: ## Run MacT tests (mocked acc tests) From fb9e9f8603fdc858ada68026da4d376bd01b76c2 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Fri, 28 Mar 2025 10:57:05 +0000 Subject: [PATCH 07/10] doc: Add docstring for `AddReplacement` --- internal/common/customplanmodifier/unknown_replacement.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/common/customplanmodifier/unknown_replacement.go b/internal/common/customplanmodifier/unknown_replacement.go index c05e1839e6..1e168898c6 100644 --- a/internal/common/customplanmodifier/unknown_replacement.go +++ b/internal/common/customplanmodifier/unknown_replacement.go @@ -34,6 +34,7 @@ type UnknownReplacements[ResourceInfo any] struct { keepUnknownsExtraCalls []func(ctx context.Context, stateValue attr.Value, req *UnknownReplacementRequest[ResourceInfo]) []string } +// AddReplacement call will only be used if the attribute is Unknown in the plan. Only valid for `computed` attributes. func (u *UnknownReplacements[ResourceInfo]) AddReplacement(name string, call UnknownReplacementCall[ResourceInfo]) { // todo: Validate the name exists in the schema _, found := u.Replacements[name] From bc68416321385ef575913f6ed085cd51ba1e3529 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Tue, 1 Apr 2025 17:01:48 +0200 Subject: [PATCH 08/10] refactor: remove unused variable in plan_modifier_test.go --- .../model_to_ClusterDescription20240805.go | 2 +- .../advancedclustertpf/plan_modifier.go | 35 ++++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go index c090727906..476262c302 100644 --- a/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go +++ b/internal/service/advancedclustertpf/model_to_ClusterDescription20240805.go @@ -94,9 +94,9 @@ func newReplicationSpec20240805(ctx context.Context, input types.List, diags *di resp := make([]admin.ReplicationSpec20240805, len(input.Elements())) for i := range elements { item := &elements[i] + // Choosing to never send ZoneId in PATCH request. It is inferred by the backend. resp[i] = admin.ReplicationSpec20240805{ Id: conversion.NilForUnknownOrEmptyString(item.ExternalId), - ZoneId: conversion.NilForUnknownOrEmptyString(item.ZoneId), RegionConfigs: newCloudRegionConfig20240805(ctx, item.RegionConfigs, diags), ZoneName: conversion.StringPtr(resolveZoneNameOrUseDefault(item)), } diff --git a/internal/service/advancedclustertpf/plan_modifier.go b/internal/service/advancedclustertpf/plan_modifier.go index 07224b9117..8e252f9710 100644 --- a/internal/service/advancedclustertpf/plan_modifier.go +++ b/internal/service/advancedclustertpf/plan_modifier.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/customplanmodifier" ) @@ -55,10 +56,15 @@ func unknownReplacements(ctx context.Context, tfsdkState *tfsdk.State, tfsdkPlan } computedUsed, diskUsed := autoScalingUsed(ctx, diags, &state, &plan) shardingConfigUpgrade := isShardingConfigUpgrade(ctx, &state, &plan, diags) + isUsingNewShardingConfig := usingNewShardingConfig(ctx, plan.ReplicationSpecs, diags) + if diags.HasError() { + return + } info := PlanModifyResourceInfo{ AutoScalingComputedUsed: computedUsed, AutoScalingDiskUsed: diskUsed, - isShardingConfigUpgrade: shardingConfigUpgrade, + IsShardingConfigUpgrade: shardingConfigUpgrade, + UsingNewShardingConfig: isUsingNewShardingConfig, } unknownReplacements := customplanmodifier.NewUnknownReplacements(ctx, tfsdkState, tfsdkPlan, diags, ResourceSchema(ctx), info) for attrName, replacer := range attributePlanModifiers { @@ -79,7 +85,7 @@ func unknownReplacements(ctx context.Context, tfsdkState *tfsdk.State, tfsdkPlan func autoScalingReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { // don't use auto_scaling or analytics_auto_scaling from state if it's not enabled as it doesn't need to be present in Update request payload if req.Info.AutoScalingComputedUsed || req.Info.AutoScalingDiskUsed { - return state.(types.Object) + return state } return req.Unknown } @@ -87,23 +93,21 @@ func autoScalingReplaceUnknown(ctx context.Context, state attr.Value, req *custo type PlanModifyResourceInfo struct { AutoScalingComputedUsed bool AutoScalingDiskUsed bool - isShardingConfigUpgrade bool + IsShardingConfigUpgrade bool + UsingNewShardingConfig bool } -func parentRegionConfigs(ctx context.Context, path path.Path, differ *customplanmodifier.PlanModifyDiffer, diags *diag.Diagnostics) []TFRegionConfigsModel { - regionConfigsPath := conversion.AncestorPathNoIndex(path, "region_configs", diags) +func parentRegionConfigs(ctx context.Context, path path.Path, differ *customplanmodifier.PlanModifyDiffer) []TFRegionConfigsModel { + regionConfigsPath, diags := conversion.AncestorPathNoIndex(path, "region_configs") if diags.HasError() { + tflog.Error(ctx, conversion.FormatDiags(&diags)) return nil } - regionConfigs := customplanmodifier.ReadPlanStructValues[TFRegionConfigsModel](ctx, differ, regionConfigsPath, diags) - if diags.HasError() { - return nil - } - return regionConfigs + return customplanmodifier.ReadPlanStructValues[TFRegionConfigsModel](ctx, differ, regionConfigsPath) } func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { - if req.Info.isShardingConfigUpgrade { + if req.Info.IsShardingConfigUpgrade { return req.Unknown } stateParsed := conversion.TFModelObject[TFSpecsModel](ctx, state.(types.Object)) @@ -114,15 +118,12 @@ func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *custompl electable := customplanmodifier.ReadPlanStructValue[TFSpecsModel](ctx, req.Differ, electablePath) if electable == nil { electableState := customplanmodifier.ReadStateStructValue[TFSpecsModel](ctx, req.Differ, electablePath) - if electableState.NodeCount.ValueInt64() > 0 { + if electableState != nil && electableState.NodeCount.ValueInt64() > 0 { electable = electableState } } if electable == nil { - regionConfigs := parentRegionConfigs(ctx, req.Path, req.Differ, req.Diags) - if req.Diags.HasError() { - return req.Unknown - } + regionConfigs := parentRegionConfigs(ctx, req.Path, req.Differ) // ensures values are taken from a defined electable spec if not present in current region config electable = findDefinedElectableSpecInReplicationSpec(ctx, regionConfigs) } @@ -144,7 +145,7 @@ func readOnlyReplaceUnknown(ctx context.Context, state attr.Value, req *custompl } func analyticsAndElectableSpecsReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { - if req.Info.isShardingConfigUpgrade { + if req.Info.IsShardingConfigUpgrade { return req.Unknown } stateParsed := conversion.TFModelObject[TFSpecsModel](ctx, state.(types.Object)) From a191863fe5ef85e69710fd5029ba3fe1256fd766 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Tue, 1 Apr 2025 17:44:45 +0200 Subject: [PATCH 09/10] fix: Only copy auto_scaling if specific values are set --- internal/service/advancedclustertpf/plan_modifier.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/service/advancedclustertpf/plan_modifier.go b/internal/service/advancedclustertpf/plan_modifier.go index 8e252f9710..568414a7b5 100644 --- a/internal/service/advancedclustertpf/plan_modifier.go +++ b/internal/service/advancedclustertpf/plan_modifier.go @@ -84,7 +84,8 @@ func unknownReplacements(ctx context.Context, tfsdkState *tfsdk.State, tfsdkPlan func autoScalingReplaceUnknown(ctx context.Context, state attr.Value, req *customplanmodifier.UnknownReplacementRequest[PlanModifyResourceInfo]) attr.Value { // don't use auto_scaling or analytics_auto_scaling from state if it's not enabled as it doesn't need to be present in Update request payload - if req.Info.AutoScalingComputedUsed || req.Info.AutoScalingDiskUsed { + autoScalingModel := conversion.TFModelObject[TFAutoScalingModel](ctx, state.(types.Object)) + if autoScalingModel != nil && (autoScalingModel.ComputeEnabled.ValueBool() || autoScalingModel.DiskGBEnabled.ValueBool()) { return state } return req.Unknown From 9a800785a30bcc522b314f1a61c056ea1b8cda32 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Wed, 2 Apr 2025 09:30:10 +0200 Subject: [PATCH 10/10] refactor: remove unused state checks in advanced cluster test --- .../advancedcluster/resource_advanced_cluster_test.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster_test.go b/internal/service/advancedcluster/resource_advanced_cluster_test.go index 1f6d988f60..cf691e6c4c 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster_test.go +++ b/internal/service/advancedcluster/resource_advanced_cluster_test.go @@ -15,9 +15,6 @@ import ( "go.mongodb.org/atlas-sdk/v20250312001/admin" "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/hashicorp/terraform-plugin-testing/knownvalue" - "github.com/hashicorp/terraform-plugin-testing/statecheck" - "github.com/hashicorp/terraform-plugin-testing/tfjsonpath" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -1327,10 +1324,6 @@ func TestAccMockableAdvancedCluster_replicasetAdvConfigUpdate(t *testing.T) { { Config: configBasicReplicaset(t, projectID, clusterName, ""), Check: checks, - ConfigStateChecks: []statecheck.StateCheck{ - statecheck.ExpectKnownValue(resourceName, tfjsonpath.New("mongo_db_major_version"), knownvalue.StringRegexp(regexp.MustCompile(`8\.\d+`))), - statecheck.ExpectKnownValue(dataSourceName, tfjsonpath.New("mongo_db_major_version"), knownvalue.StringRegexp(regexp.MustCompile(`8\.\d+`))), - }, }, acc.TestStepImportCluster(resourceName), },