Skip to content

Commit

Permalink
Merge branch 'master' into CLOUDP-288865_read_data_source
Browse files Browse the repository at this point in the history
* master:
  chore: Updates Atlas Go SDK (#2870)
  chore: Updates CHANGELOG.md for #2825
  feat: Adds new `advanced_configuration.0.default_max_time_ms` attribute to `mongodbatlas_advanced_cluster` resource and data sources (#2825)

# Conflicts:
#	internal/service/advancedcluster/resource_advanced_cluster_test.go
  • Loading branch information
lantoli committed Dec 10, 2024
2 parents 9b8776b + c9265d8 commit e47bcbf
Show file tree
Hide file tree
Showing 208 changed files with 387 additions and 251 deletions.
11 changes: 11 additions & 0 deletions .changelog/2825.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:note
resource/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute
```

```release-note:note
data-source/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute
```

```release-note:note
data-source/mongodbatlas_advanced_clusters: Adds new `advanced_configuration.0.default_max_time_ms` attribute
```
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## (Unreleased)

NOTES:

* data-source/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825))
* data-source/mongodbatlas_advanced_clusters: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825))
* resource/mongodbatlas_advanced_cluster: Adds new `advanced_configuration.0.default_max_time_ms` attribute ([#2825](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2825))

## 1.22.0 (November 26, 2024)

NOTES:
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/advanced_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
* `sample_size_bi_connector` - Number of documents per database to sample when gathering schema information. Defaults to 100. Available only for Atlas deployments in which BI Connector for Atlas is enabled.
* `sample_refresh_interval_bi_connector` - Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled.
* `transaction_lifetime_limit_seconds` - Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds.
* `default_max_time_ms` - Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above.
* `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off).

## Attributes Reference
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/advanced_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
* `oplog_min_retention_hours` - Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates.
* `sample_size_bi_connector` - Number of documents per database to sample when gathering schema information. Defaults to 100. Available only for Atlas deployments in which BI Connector for Atlas is enabled.
* `sample_refresh_interval_bi_connector` - Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled.
* `default_max_time_ms` - Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above.
* `transaction_lifetime_limit_seconds` - (Optional) Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds.
* `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This parameter is only supported for MongoDB version 6.0 and above. Defaults to `-1`(off).

Expand Down
1 change: 1 addition & 0 deletions docs/resources/advanced_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ Include **desired options** within advanced_configuration:
* `sample_refresh_interval_bi_connector` - (Optional) Interval in seconds at which the mongosqld process re-samples data to create its relational schema. The default value is 300. The specified value must be a positive integer. Available only for Atlas deployments in which BI Connector for Atlas is enabled.
* `transaction_lifetime_limit_seconds` - (Optional) Lifetime, in seconds, of multi-document transactions. Defaults to 60 seconds.
* `change_stream_options_pre_and_post_images_expire_after_seconds` - (Optional) The minimum pre- and post-image retention time in seconds. This option corresponds to the `changeStreamOptions.preAndPostImages.expireAfterSeconds` cluster parameter. Defaults to `-1`(off). This setting controls the retention policy of change stream pre- and post-images. Pre- and post-images are the versions of a document before and after document modification, respectively. `expireAfterSeconds` controls how long MongoDB retains pre- and post-images. When set to -1 (off), MongoDB uses the default retention policy: pre- and post-images are retained until the corresponding change stream events are removed from the oplog. To set the minimum pre- and post-image retention time, specify an integer value greater than zero. Setting this too low could increase the risk of interrupting Realm sync or triggers processing. This parameter is only supported for MongoDB version 6.0 and above.
* `default_max_time_ms` - (Optional) Default time limit in milliseconds for individual read operations to complete. This option corresponds to the [defaultMaxTimeMS(https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/) cluster parameter. This parameter is supported only for MongoDB version 8.0 and above.


### Tags
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/huandu/xstrings v1.5.0
github.com/jarcoal/httpmock v1.3.1
github.com/mongodb-forks/digest v1.1.0
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241204083927-b6a55910868f
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f
github.com/pb33f/libopenapi v0.18.7
github.com/sebdah/goldie/v2 v2.5.5
github.com/spf13/cast v1.6.0
Expand All @@ -32,7 +32,7 @@ require (
go.mongodb.org/atlas v0.37.0
go.mongodb.org/atlas-sdk/v20240530005 v20240530005.0.0
go.mongodb.org/atlas-sdk/v20240805005 v20240805005.0.0
go.mongodb.org/atlas-sdk/v20241113002 v20241113002.0.0
go.mongodb.org/atlas-sdk/v20241113003 v20241113003.0.0
go.mongodb.org/realm v0.1.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM=
github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKksrOoc=
github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241204083927-b6a55910868f h1:bP8UBPb6rz8nGrEs2CtB1+pVQZ7e1BncF+pvxBxMZXk=
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241204083927-b6a55910868f/go.mod h1:WzU2E+/RcJGnhjdnBzXpbGBqq/XbDhFDEaru0UNmbxc=
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f h1:hgZvdTynTl1ep9xWH+1K697K1wsjp6jgqYgMoz3ynxc=
github.com/mongodb/atlas-sdk-go v1.0.1-0.20241209122044-6b70e4ddd10f/go.mod h1:WzU2E+/RcJGnhjdnBzXpbGBqq/XbDhFDEaru0UNmbxc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
Expand Down Expand Up @@ -829,8 +829,8 @@ go.mongodb.org/atlas-sdk/v20240530005 v20240530005.0.0 h1:d/gbYJ+obR0EM/3DZf7+ZM
go.mongodb.org/atlas-sdk/v20240530005 v20240530005.0.0/go.mod h1:O47ZrMMfcWb31wznNIq2PQkkdoFoK0ea2GlmRqGJC2s=
go.mongodb.org/atlas-sdk/v20240805005 v20240805005.0.0 h1:EGTT54tKbDbkhhK+jH5AqINFQbHdvaOSpI0oeI5Tl1s=
go.mongodb.org/atlas-sdk/v20240805005 v20240805005.0.0/go.mod h1:UTNpAyiKm/7utu+Nl0FafgjgvS+ONNGEoxBT5g/40WM=
go.mongodb.org/atlas-sdk/v20241113002 v20241113002.0.0 h1:jvcAUlQ4V28HD7mfByrWHy/2H0aPBNDqU5VqN1LaoTc=
go.mongodb.org/atlas-sdk/v20241113002 v20241113002.0.0/go.mod h1:QSQSZK5IQQhraVlY1FvdALqH9vdTyAgihhlOI4TzfG8=
go.mongodb.org/atlas-sdk/v20241113003 v20241113003.0.0 h1:aH1LZIgSLxKhCuPm99OIwwzhVKVYpzHuJ9RjCOYlh0s=
go.mongodb.org/atlas-sdk/v20241113003 v20241113003.0.0/go.mod h1:bdVaUm4xI5Ns3+ie3VPPVravSfiGlnMfaAlVAiscA0U=
go.mongodb.org/realm v0.1.0 h1:zJiXyLaZrznQ+Pz947ziSrDKUep39DO4SfA0Fzx8M4M=
go.mongodb.org/realm v0.1.0/go.mod h1:4Vj6iy+Puo1TDERcoh4XZ+pjtwbOzPpzqy3Cwe8ZmDM=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
Expand Down
2 changes: 1 addition & 1 deletion internal/common/conversion/flatten_expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func FlattenLinks(links []admin.Link) []map[string]string {
Expand Down
2 changes: 1 addition & 1 deletion internal/common/conversion/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func NewResourceTags(ctx context.Context, tags types.Map) *[]admin.ResourceTag {
Expand Down
2 changes: 1 addition & 1 deletion internal/common/conversion/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
"github.com/stretchr/testify/assert"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func TestNewResourceTags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/common/update/patch_payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/update"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func TestPatchReplicationSpecs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
adminpreview "github.com/mongodb/atlas-sdk-go/admin"
admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
matlasClient "go.mongodb.org/atlas/mongodbatlas"
realmAuth "go.mongodb.org/realm/auth"
"go.mongodb.org/realm/realm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/config"

"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func PluralDataSource() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/config"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
)

func Resource() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"

admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
Expand Down
37 changes: 34 additions & 3 deletions internal/service/advancedcluster/model_advanced_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
Expand All @@ -25,6 +25,7 @@ import (
)

const minVersionForChangeStreamOptions = 6.0
const minVersionForDefaultMaxTimeMS = 8.0

var (
DSTagsSchema = schema.Schema{
Expand Down Expand Up @@ -117,6 +118,10 @@ func SchemaAdvancedConfigDS() *schema.Schema {
Type: schema.TypeInt,
Computed: true,
},
"default_max_time_ms": {
Type: schema.TypeInt,
Computed: true,
},
},
},
}
Expand Down Expand Up @@ -262,6 +267,10 @@ func SchemaAdvancedConfig() *schema.Schema {
Optional: true,
Default: -1,
},
"default_max_time_ms": {
Type: schema.TypeInt,
Optional: true,
},
},
},
}
Expand Down Expand Up @@ -511,7 +520,12 @@ func flattenProcessArgs(p20240530 *admin20240530.ClusterDescriptionProcessArgs,
} else {
flattenedProcessArgs[0]["change_stream_options_pre_and_post_images_expire_after_seconds"] = p.GetChangeStreamOptionsPreAndPostImagesExpireAfterSeconds()
}

if v := p.DefaultMaxTimeMS; v != nil {
flattenedProcessArgs[0]["default_max_time_ms"] = p.GetDefaultMaxTimeMS()
}
}

return flattenedProcessArgs
}

Expand Down Expand Up @@ -852,10 +866,19 @@ func expandProcessArgs(d *schema.ResourceData, p map[string]any, mongodbMajorVer

res.ChangeStreamOptionsPreAndPostImagesExpireAfterSeconds = conversion.IntPtr(tmpInt)
}

if _, ok := d.GetOkExists("advanced_configuration.0.default_max_time_ms"); ok {
if IsDefaultMaxTimeMinRequiredMajorVersion(mongodbMajorVersion) {
res.DefaultMaxTimeMS = conversion.Pointer(cast.ToInt(p["default_max_time_ms"]))
} else {
log.Print(ErrorDefaultMaxTimeMinVersion)
}
}

return res20240530, res
}

func IsChangeStreamOptionsMinRequiredMajorVersion(input *string) bool {
func isMinRequiredMajorVersion(input *string, minVersion float64) bool {
if input == nil || *input == "" {
return true
}
Expand All @@ -869,7 +892,15 @@ func IsChangeStreamOptionsMinRequiredMajorVersion(input *string) bool {
return false
}

return value >= minVersionForChangeStreamOptions
return value >= minVersion
}

func IsChangeStreamOptionsMinRequiredMajorVersion(input *string) bool {
return isMinRequiredMajorVersion(input, minVersionForChangeStreamOptions)
}

func IsDefaultMaxTimeMinRequiredMajorVersion(input *string) bool {
return isMinRequiredMajorVersion(input, minVersionForDefaultMaxTimeMS)
}

func expandLabelSliceFromSetSchema(d *schema.ResourceData) ([]admin20240805.ComponentLabel, diag.Diagnostics) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113002/mockadmin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"
"go.mongodb.org/atlas-sdk/v20241113003/mockadmin"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/stretchr/testify/assert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package advancedcluster
import (
admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
)
Expand Down
12 changes: 9 additions & 3 deletions internal/service/advancedcluster/resource_advanced_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

admin20240530 "go.mongodb.org/atlas-sdk/v20240530005/admin"
admin20240805 "go.mongodb.org/atlas-sdk/v20240805005/admin"
"go.mongodb.org/atlas-sdk/v20241113002/admin"
"go.mongodb.org/atlas-sdk/v20241113003/admin"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
Expand All @@ -40,6 +40,7 @@ const (
ErrorClusterAdvancedSetting = "error setting `%s` for MongoDB ClusterAdvanced (%s): %s"
ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s"
ErrorOperationNotPermitted = "error operation not permitted"
ErrorDefaultMaxTimeMinVersion = "default_max_time_ms can not be set for mongo_db_major_version lower than 8.0"
ignoreLabel = "Infrastructure Tool"
DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details at https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown"
)
Expand Down Expand Up @@ -472,12 +473,17 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.
params.ConfigServerManagementMode = conversion.StringPtr(v.(string))
}

// Validate oplog_size_mb to show the error before the cluster is created.
// Validate advanced configuration params to show the error before the cluster is created.
if oplogSizeMB, ok := d.GetOkExists("advanced_configuration.0.oplog_size_mb"); ok {
if cast.ToInt64(oplogSizeMB) < 0 {
return diag.FromErr(fmt.Errorf("`advanced_configuration.oplog_size_mb` cannot be < 0"))
}
}
if _, ok := d.GetOkExists("advanced_configuration.0.default_max_time_ms"); ok {
if !IsDefaultMaxTimeMinRequiredMajorVersion(params.MongoDBMajorVersion) {
return diag.FromErr(errors.New(ErrorDefaultMaxTimeMinVersion))
}
}

if err := CheckRegionConfigsPriorityOrder(params.GetReplicationSpecs()); err != nil {
return diag.FromErr(err)
Expand All @@ -498,7 +504,7 @@ func resourceCreate(ctx context.Context, d *schema.ResourceData, meta any) diag.
if ac, ok := d.GetOk("advanced_configuration"); ok {
if aclist, ok := ac.([]any); ok && len(aclist) > 0 {
params20240530, params := expandProcessArgs(d, aclist[0].(map[string]any), params.MongoDBMajorVersion)
_, _, err := connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.GetName(), &params20240530).Execute()
_, _, err = connV220240530.ClustersApi.UpdateClusterAdvancedConfiguration(ctx, projectID, cluster.GetName(), &params20240530).Execute()
if err != nil {
return diag.FromErr(fmt.Errorf(errorConfigUpdate, cluster.GetName(), err))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestMigAdvancedCluster_geoShardedMigrationFromOldToNewSchema(t *testing.T)

func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) {
acc.SkipIfAdvancedClusterV2Schema(t) // This test is specific to the legacy schema
mig.SkipIfVersionBelow(t, "1.19.0") // version where change_stream_options_pre_and_post_images_expire_after_seconds was introduced
mig.SkipIfVersionBelow(t, "1.22.1") // version where default_max_time_ms was introduced
var (
projectID = acc.ProjectIDExecution(t)
clusterName = acc.RandomClusterName()
Expand Down Expand Up @@ -184,7 +184,8 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) {
no_table_scan = false
default_read_concern = "available"
sample_size_bi_connector = 110
sample_refresh_interval_bi_connector = 310
sample_refresh_interval_bi_connector = 310
default_max_time_ms = 65
}
bi_connector_config {
Expand Down Expand Up @@ -224,6 +225,7 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.no_table_scan", "false"),
resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_refresh_interval_bi_connector", "310"),
resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.sample_size_bi_connector", "110"),
resource.TestCheckResourceAttr(resourceName, "advanced_configuration.0.default_max_time_ms", "65"),
resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "bi_connector_config.0.read_preference", "secondary"),
),
Expand Down
Loading

0 comments on commit e47bcbf

Please sign in to comment.