From c2cb8ee1b96dc17c504cc3af1ba2ed4aafc20655 Mon Sep 17 00:00:00 2001 From: Aastha Mahendru Date: Sun, 14 Jul 2024 15:27:30 +0100 Subject: [PATCH 1/5] add deprecation messages, changelog entries, update documentation --- .changelog/2420.txt | 64 +++++++++++++++++++ internal/common/constant/deprecation.go | 1 + .../data_source_advanced_cluster.go | 17 +++-- .../data_source_advanced_clusters.go | 15 +++-- .../advancedcluster/model_advanced_cluster.go | 24 ++++--- .../resource_advanced_cluster.go | 17 +++-- website/docs/d/advanced_cluster.html.markdown | 8 +-- .../docs/d/advanced_clusters.html.markdown | 8 +-- website/docs/r/advanced_cluster.html.markdown | 8 +-- 9 files changed, 122 insertions(+), 40 deletions(-) create mode 100644 .changelog/2420.txt diff --git a/.changelog/2420.txt b/.changelog/2420.txt new file mode 100644 index 0000000000..2224b7b9dd --- /dev/null +++ b/.changelog/2420.txt @@ -0,0 +1,64 @@ +```release-note:note +resource/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.id` attribute +``` + +```release-note:note +resource/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.num_shards` attribute +``` + +```release-note:note +resource/mongodbatlas_advanced_cluster: Deprecates `disk_size_gb` attribute +``` + +```release-note:note +resource/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.default_read_concern` attribute +``` + +```release-note:note +resource/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.id` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.num_shards` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_cluster: Deprecates `disk_size_gb` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.default_read_concern` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_clusters: Deprecates `replication_specs.#.id` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_clusters: Deprecates `replication_specs.#.num_shards` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_clusters: Deprecates `disk_size_gb` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_clusters: Deprecates `advanced_configuration.0.default_read_concern` attribute +``` + +```release-note:note +data-source/mongodbatlas_advanced_clusters: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute +``` + + + + + diff --git a/internal/common/constant/deprecation.go b/internal/common/constant/deprecation.go index 11c4a0650f..c62a766037 100644 --- a/internal/common/constant/deprecation.go +++ b/internal/common/constant/deprecation.go @@ -1,6 +1,7 @@ package constant const ( + DeprecationParam = "This parameter is deprecated." DeprecationParamByDate = "This parameter is deprecated and will be removed by %s." DeprecationParamByDateWithReplacement = "This parameter is deprecated and will be removed by %s. Please transition to %s." DeprecationParamByVersion = "This parameter is deprecated and will be removed in version %s." diff --git a/internal/service/advancedcluster/data_source_advanced_cluster.go b/internal/service/advancedcluster/data_source_advanced_cluster.go index 64cd26cdec..d21256cfb3 100644 --- a/internal/service/advancedcluster/data_source_advanced_cluster.go +++ b/internal/service/advancedcluster/data_source_advanced_cluster.go @@ -16,6 +16,8 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) +// replication_specs.id, num_shards, disk_size_gb, default_read_concern, and fail_index_key_too_long + func DataSource() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceRead, @@ -61,8 +63,9 @@ func DataSource() *schema.Resource { Computed: true, }, "disk_size_gb": { - Type: schema.TypeFloat, - Computed: true, + Type: schema.TypeFloat, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "encryption_at_rest_provider": { Type: schema.TypeString, @@ -113,8 +116,9 @@ func DataSource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "zone_id": { Type: schema.TypeString, @@ -125,8 +129,9 @@ func DataSource() *schema.Resource { Computed: true, }, "num_shards": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "region_configs": { Type: schema.TypeList, diff --git a/internal/service/advancedcluster/data_source_advanced_clusters.go b/internal/service/advancedcluster/data_source_advanced_clusters.go index 51682add26..a845a0fd24 100644 --- a/internal/service/advancedcluster/data_source_advanced_clusters.go +++ b/internal/service/advancedcluster/data_source_advanced_clusters.go @@ -64,8 +64,9 @@ func PluralDataSource() *schema.Resource { Computed: true, }, "disk_size_gb": { - Type: schema.TypeFloat, - Computed: true, + Type: schema.TypeFloat, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "encryption_at_rest_provider": { Type: schema.TypeString, @@ -116,12 +117,14 @@ func PluralDataSource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "num_shards": { - Type: schema.TypeInt, - Computed: true, + Type: schema.TypeInt, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "region_configs": { Type: schema.TypeList, diff --git a/internal/service/advancedcluster/model_advanced_cluster.go b/internal/service/advancedcluster/model_advanced_cluster.go index 69ba3d95f5..c9d7f6480b 100644 --- a/internal/service/advancedcluster/model_advanced_cluster.go +++ b/internal/service/advancedcluster/model_advanced_cluster.go @@ -63,16 +63,18 @@ func SchemaAdvancedConfigDS() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "default_read_concern": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "default_write_concern": { Type: schema.TypeString, Computed: true, }, "fail_index_key_too_long": { - Type: schema.TypeBool, - Computed: true, + Type: schema.TypeBool, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "javascript_enabled": { Type: schema.TypeBool, @@ -191,9 +193,10 @@ func SchemaAdvancedConfig() *schema.Schema { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "default_read_concern": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "default_write_concern": { Type: schema.TypeString, @@ -201,9 +204,10 @@ func SchemaAdvancedConfig() *schema.Schema { Computed: true, }, "fail_index_key_too_long": { - Type: schema.TypeBool, - Optional: true, - Computed: true, + Type: schema.TypeBool, + Optional: true, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "javascript_enabled": { Type: schema.TypeBool, diff --git a/internal/service/advancedcluster/resource_advanced_cluster.go b/internal/service/advancedcluster/resource_advanced_cluster.go index 87fd235805..e062637818 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster.go +++ b/internal/service/advancedcluster/resource_advanced_cluster.go @@ -40,11 +40,13 @@ const ( ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" ErrorOperationNotPermitted = "error operation not permitted" ignoreLabel = "Infrastructure Tool" + DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details" ) type acCtxKey string var upgradeRequestCtxKey acCtxKey = "upgradeRequest" +var DeprecationMsgOldSchema = fmt.Sprintf("%s %s", constant.DeprecationParam, DeprecationOldSchemaAction) func Resource() *schema.Resource { return &schema.Resource{ @@ -113,9 +115,10 @@ func Resource() *schema.Resource { Computed: true, }, "disk_size_gb": { - Type: schema.TypeFloat, - Optional: true, - Computed: true, + Type: schema.TypeFloat, + Optional: true, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "encryption_at_rest_provider": { Type: schema.TypeString, @@ -172,8 +175,9 @@ func Resource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "id": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Computed: true, + Deprecated: DeprecationMsgOldSchema, }, "zone_id": { Type: schema.TypeString, @@ -188,6 +192,7 @@ func Resource() *schema.Resource { Optional: true, Default: 1, ValidateFunc: validation.IntBetween(1, 50), + Deprecated: DeprecationMsgOldSchema, }, "region_configs": { Type: schema.TypeList, @@ -855,7 +860,7 @@ func isUpdateAllowed(d *schema.ResourceData) (bool, error) { if specMap, ok := specRaw.(map[string]any); ok && specMap != nil { numShards, _ := specMap["num_shards"].(int) if numShards > 1 && isNewSchemaCompatible { - return false, fmt.Errorf("cannot increase num_shards to > 1 under the current configuration. New shards can be defined by adding new replication spec objects; please refer to our examples, documentation, and 1.18.0 migration guide for more details") + return false, fmt.Errorf("cannot increase num_shards to > 1 under the current configuration. New shards can be defined by adding new replication spec objects; %s", DeprecationOldSchemaAction) } } } diff --git a/website/docs/d/advanced_cluster.html.markdown b/website/docs/d/advanced_cluster.html.markdown index 994b8a6720..e75317d32c 100644 --- a/website/docs/d/advanced_cluster.html.markdown +++ b/website/docs/d/advanced_cluster.html.markdown @@ -55,7 +55,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The cluster ID. * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. +* `disk_size_gb` - **(DEPRECATED)** Capacity, in gigabytes, of the host's root volume. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -98,7 +98,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. +* `num_shards` - **(DEPRECATED)** Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `container_id` - A key-value map of the Network Peering Container ID(s) for the configuration specified in `region_configs`. The Container ID is the id of the container either created programmatically by the user before any clusters existed in a project or when the first cluster in the region (AWS/Azure) or project (GCP) was created. The syntax is `"providerName:regionName" = "containerId"`. Example `AWS:US_EAST_1" = "61e0797dde08fb498ca11a71`. * `zone_name` - Name for the zone in a Global Cluster. @@ -142,9 +142,9 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `compute_max_instance_size` - Maximum instance size to which your cluster can automatically scale (such as M40). #### Advanced Configuration -* `default_read_concern` - [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - **(DEPRECATED)** When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: diff --git a/website/docs/d/advanced_clusters.html.markdown b/website/docs/d/advanced_clusters.html.markdown index 83d2d99c98..825fcca91c 100644 --- a/website/docs/d/advanced_clusters.html.markdown +++ b/website/docs/d/advanced_clusters.html.markdown @@ -57,7 +57,7 @@ In addition to all arguments above, the following attributes are exported: * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. +* `disk_size_gb` - **(DEPRECATED)** Capacity, in gigabytes, of the host's root volume. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). @@ -100,7 +100,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. +* `num_shards` - **(DEPRECATED)** Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `container_id` - A key-value map of the Network Peering Container ID(s) for the configuration specified in `region_configs`. The Container ID is the id of the container either created programmatically by the user before any clusters existed in a project or when the first cluster in the region (AWS/Azure) or project (GCP) was created. The syntax is `"providerName:regionName" = "containerId"`. Example `AWS:US_EAST_1" = "61e0797dde08fb498ca11a71`. * `zone_name` - Name for the zone in a Global Cluster. @@ -145,9 +145,9 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le #### Advanced Configuration -* `default_read_concern` - [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - **(DEPRECATED)** When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: diff --git a/website/docs/r/advanced_cluster.html.markdown b/website/docs/r/advanced_cluster.html.markdown index 8da32009f5..65546e801a 100644 --- a/website/docs/r/advanced_cluster.html.markdown +++ b/website/docs/r/advanced_cluster.html.markdown @@ -385,7 +385,7 @@ This parameter defaults to false. - `SHARDED` Sharded cluster - `GEOSHARDED` Global Cluster -* `disk_size_gb` - (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. +* `disk_size_gb` - **(DEPRECATED)** (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. * `encryption_at_rest_provider` - (Optional) Possible values are AWS, GCP, AZURE or NONE. Only needed if you desire to manage the keys, see [Encryption at Rest using Customer Key Management](https://docs.atlas.mongodb.com/security-kms-encryption/) for complete documentation. You must configure encryption at rest for the Atlas project before enabling it on any cluster in the project. For Documentation, see [AWS](https://docs.atlas.mongodb.com/security-aws-kms/), [GCP](https://docs.atlas.mongodb.com/security-kms-encryption/) and [Azure](https://docs.atlas.mongodb.com/security-azure-kms/#std-label-security-azure-kms). Requirements are if `replication_specs.#.region_configs.#.Specs.instance_size` is M10 or greater and `backup_enabled` is false or omitted. * `tags` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -446,9 +446,9 @@ Include **desired options** within advanced_configuration: } ``` -* `default_read_concern` - (Optional) [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - **(DEPRECATED)** (Optional) [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - (Optional) [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - (Optional) When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - **(DEPRECATED)** (Optional) When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. * `javascript_enabled` - (Optional) When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - (Optional) Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: @@ -538,7 +538,7 @@ replication_specs { } ``` -* `num_shards` - (Optional) Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. Omit this value if you selected a `cluster_type` of REPLICASET. This API resource accepts 1 through 50, inclusive. This parameter defaults to 1. If you specify a `num_shards` value of 1 and a `cluster_type` of SHARDED, Atlas deploys a single-shard [sharded cluster](https://docs.atlas.mongodb.com/reference/glossary/#std-term-sharded-cluster). Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. +* `num_shards` - **(DEPRECATED)** (Optional) Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. Omit this value if you selected a `cluster_type` of REPLICASET. This API resource accepts 1 through 50, inclusive. This parameter defaults to 1. If you specify a `num_shards` value of 1 and a `cluster_type` of SHARDED, Atlas deploys a single-shard [sharded cluster](https://docs.atlas.mongodb.com/reference/glossary/#std-term-sharded-cluster). Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards. To learn more, see [Convert a replica set to a sharded cluster documentation](https://www.mongodb.com/docs/atlas/scale-cluster/#convert-a-replica-set-to-a-sharded-cluster) and [Convert a replica set to a sharded cluster tutorial](https://www.mongodb.com/docs/upcoming/tutorial/convert-replica-set-to-replicated-shard-cluster). * `region_configs` - (Optional) Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `zone_name` - (Optional) Name for the zone in a Global Cluster. From 474e324d6a47d964e476cbf27776a7af85a67297 Mon Sep 17 00:00:00 2001 From: Aastha Mahendru Date: Sun, 14 Jul 2024 15:32:48 +0100 Subject: [PATCH 2/5] minor --- .../service/advancedcluster/data_source_advanced_cluster.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/service/advancedcluster/data_source_advanced_cluster.go b/internal/service/advancedcluster/data_source_advanced_cluster.go index d21256cfb3..3c2f3f7306 100644 --- a/internal/service/advancedcluster/data_source_advanced_cluster.go +++ b/internal/service/advancedcluster/data_source_advanced_cluster.go @@ -16,8 +16,6 @@ import ( "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) -// replication_specs.id, num_shards, disk_size_gb, default_read_concern, and fail_index_key_too_long - func DataSource() *schema.Resource { return &schema.Resource{ ReadContext: dataSourceRead, From d1d53bd91a6eed4a60038fa1bb114becdd72ce82 Mon Sep 17 00:00:00 2001 From: Aastha Mahendru Date: Mon, 15 Jul 2024 21:10:11 +0100 Subject: [PATCH 3/5] address PR comments --- website/docs/d/advanced_cluster.html.markdown | 4 ++-- website/docs/d/advanced_clusters.html.markdown | 4 ++-- website/docs/r/advanced_cluster.html.markdown | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/d/advanced_cluster.html.markdown b/website/docs/d/advanced_cluster.html.markdown index e75317d32c..dd9422a6e6 100644 --- a/website/docs/d/advanced_cluster.html.markdown +++ b/website/docs/d/advanced_cluster.html.markdown @@ -55,7 +55,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The cluster ID. * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - **(DEPRECATED)** Capacity, in gigabytes, of the host's root volume. +* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -144,7 +144,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - **(DEPRECATED)** When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: diff --git a/website/docs/d/advanced_clusters.html.markdown b/website/docs/d/advanced_clusters.html.markdown index 825fcca91c..e46c2eac97 100644 --- a/website/docs/d/advanced_clusters.html.markdown +++ b/website/docs/d/advanced_clusters.html.markdown @@ -57,7 +57,7 @@ In addition to all arguments above, the following attributes are exported: * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - **(DEPRECATED)** Capacity, in gigabytes, of the host's root volume. +* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). @@ -147,7 +147,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - **(DEPRECATED)** When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: diff --git a/website/docs/r/advanced_cluster.html.markdown b/website/docs/r/advanced_cluster.html.markdown index 65546e801a..878ae19e11 100644 --- a/website/docs/r/advanced_cluster.html.markdown +++ b/website/docs/r/advanced_cluster.html.markdown @@ -385,7 +385,7 @@ This parameter defaults to false. - `SHARDED` Sharded cluster - `GEOSHARDED` Global Cluster -* `disk_size_gb` - **(DEPRECATED)** (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. +* `disk_size_gb` - (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. * `encryption_at_rest_provider` - (Optional) Possible values are AWS, GCP, AZURE or NONE. Only needed if you desire to manage the keys, see [Encryption at Rest using Customer Key Management](https://docs.atlas.mongodb.com/security-kms-encryption/) for complete documentation. You must configure encryption at rest for the Atlas project before enabling it on any cluster in the project. For Documentation, see [AWS](https://docs.atlas.mongodb.com/security-aws-kms/), [GCP](https://docs.atlas.mongodb.com/security-kms-encryption/) and [Azure](https://docs.atlas.mongodb.com/security-azure-kms/#std-label-security-azure-kms). Requirements are if `replication_specs.#.region_configs.#.Specs.instance_size` is M10 or greater and `backup_enabled` is false or omitted. * `tags` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -448,7 +448,7 @@ Include **desired options** within advanced_configuration: * `default_read_concern` - **(DEPRECATED)** (Optional) [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). * `default_write_concern` - (Optional) [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). -* `fail_index_key_too_long` - **(DEPRECATED)** (Optional) When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. +* `fail_index_key_too_long` - (Optional) When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - (Optional) When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. * `minimum_enabled_tls_protocol` - (Optional) Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections.Valid values are: From adbded839d2c5e6b53445132fa6c425fd26e43bb Mon Sep 17 00:00:00 2001 From: Aastha Mahendru Date: Wed, 17 Jul 2024 13:56:51 +0100 Subject: [PATCH 4/5] address PR comments --- .changelog/2420.txt | 59 +------------------ website/docs/d/advanced_cluster.html.markdown | 6 +- .../docs/d/advanced_clusters.html.markdown | 6 +- website/docs/r/advanced_cluster.html.markdown | 10 ++-- 4 files changed, 15 insertions(+), 66 deletions(-) diff --git a/.changelog/2420.txt b/.changelog/2420.txt index 2224b7b9dd..8e4833f2bd 100644 --- a/.changelog/2420.txt +++ b/.changelog/2420.txt @@ -1,64 +1,11 @@ ```release-note:note -resource/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.id` attribute +resource/mongodbatlas_advanced_cluster: Deprecates following attributes - `replication_specs.#.id`, `replication_specs.#.num_shards`, `disk_size_gb`, `advanced_configuration.0.default_read_concern`, and `advanced_configuration.0.fail_index_key_too_long`. ``` ```release-note:note -resource/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.num_shards` attribute +data-source/mongodbatlas_advanced_cluster: Deprecates following attributes - `replication_specs.#.id`, `replication_specs.#.num_shards`, `disk_size_gb`, `advanced_configuration.0.default_read_concern`, and `advanced_configuration.0.fail_index_key_too_long`. ``` ```release-note:note -resource/mongodbatlas_advanced_cluster: Deprecates `disk_size_gb` attribute +data-source/mongodbatlas_advanced_clusters:Deprecates following attributes - `replication_specs.#.id`, `replication_specs.#.num_shards`, `disk_size_gb`, `advanced_configuration.0.default_read_concern`, and `advanced_configuration.0.fail_index_key_too_long`. ``` - -```release-note:note -resource/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.default_read_concern` attribute -``` - -```release-note:note -resource/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.id` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_cluster: Deprecates `replication_specs.#.num_shards` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_cluster: Deprecates `disk_size_gb` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.default_read_concern` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_cluster: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_clusters: Deprecates `replication_specs.#.id` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_clusters: Deprecates `replication_specs.#.num_shards` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_clusters: Deprecates `disk_size_gb` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_clusters: Deprecates `advanced_configuration.0.default_read_concern` attribute -``` - -```release-note:note -data-source/mongodbatlas_advanced_clusters: Deprecates `advanced_configuration.0.fail_index_key_too_long` attribute -``` - - - - - diff --git a/website/docs/d/advanced_cluster.html.markdown b/website/docs/d/advanced_cluster.html.markdown index dd9422a6e6..481f739c3a 100644 --- a/website/docs/d/advanced_cluster.html.markdown +++ b/website/docs/d/advanced_cluster.html.markdown @@ -55,7 +55,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The cluster ID. * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. +* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -98,7 +98,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `num_shards` - **(DEPRECATED)** Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. +* `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. **(DEPRECATED)** Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `container_id` - A key-value map of the Network Peering Container ID(s) for the configuration specified in `region_configs`. The Container ID is the id of the container either created programmatically by the user before any clusters existed in a project or when the first cluster in the region (AWS/Azure) or project (GCP) was created. The syntax is `"providerName:regionName" = "containerId"`. Example `AWS:US_EAST_1" = "61e0797dde08fb498ca11a71`. * `zone_name` - Name for the zone in a Global Cluster. @@ -142,7 +142,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le * `compute_max_instance_size` - Maximum instance size to which your cluster can automatically scale (such as M40). #### Advanced Configuration -* `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). **(DEPRECATED)** MongoDB 5.0 and later clusters default to `local`. To use a custom read concern level, please refer to your driver documentation. * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). * `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. diff --git a/website/docs/d/advanced_clusters.html.markdown b/website/docs/d/advanced_clusters.html.markdown index e46c2eac97..78b6170ce9 100644 --- a/website/docs/d/advanced_clusters.html.markdown +++ b/website/docs/d/advanced_clusters.html.markdown @@ -57,7 +57,7 @@ In addition to all arguments above, the following attributes are exported: * `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). **NOTE** Prior version of provider had parameter as `bi_connector` * `cluster_type` - Type of the cluster that you want to create. -* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. +* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE. * `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). @@ -100,7 +100,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le ### replication_specs -* `num_shards` - **(DEPRECATED)** Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. +* `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. **(DEPRECATED)** Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `region_configs` - Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `container_id` - A key-value map of the Network Peering Container ID(s) for the configuration specified in `region_configs`. The Container ID is the id of the container either created programmatically by the user before any clusters existed in a project or when the first cluster in the region (AWS/Azure) or project (GCP) was created. The syntax is `"providerName:regionName" = "containerId"`. Example `AWS:US_EAST_1" = "61e0797dde08fb498ca11a71`. * `zone_name` - Name for the zone in a Global Cluster. @@ -145,7 +145,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le #### Advanced Configuration -* `default_read_concern` - **(DEPRECATED)** [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). **(DEPRECATED)** MongoDB 5.0 and later clusters default to `local`. To use a custom read concern level, please refer to your driver documentation. * `default_write_concern` - [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). * `fail_index_key_too_long` - When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. diff --git a/website/docs/r/advanced_cluster.html.markdown b/website/docs/r/advanced_cluster.html.markdown index 878ae19e11..ee313e0f53 100644 --- a/website/docs/r/advanced_cluster.html.markdown +++ b/website/docs/r/advanced_cluster.html.markdown @@ -385,7 +385,7 @@ This parameter defaults to false. - `SHARDED` Sharded cluster - `GEOSHARDED` Global Cluster -* `disk_size_gb` - (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. +* `disk_size_gb` - (Optional) Capacity, in gigabytes, of the host's root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive number. You can't set this value with clusters with local [NVMe SSDs](https://docs.atlas.mongodb.com/cluster-tier/#std-label-nvme-storage). The minimum disk size for dedicated clusters is 10 GB for AWS and GCP. If you specify diskSizeGB with a lower disk size, Atlas defaults to the minimum disk size value. If your cluster includes Azure nodes, this value must correspond to an existing Azure disk type (8, 16, 32, 64, 128, 256, 512, 1024, 2048, or 4095)Atlas calculates storage charges differently depending on whether you choose the default value or a custom value. The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require additional storage space beyond this limitation, consider [upgrading your cluster](https://docs.atlas.mongodb.com/scale-cluster/#std-label-scale-cluster-instance) to a higher tier. If your cluster spans cloud service providers, this value defaults to the minimum default of the providers involved. **(DEPRECATED)** Use `replication_specs.#.region_config.#.(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `encryption_at_rest_provider` - (Optional) Possible values are AWS, GCP, AZURE or NONE. Only needed if you desire to manage the keys, see [Encryption at Rest using Customer Key Management](https://docs.atlas.mongodb.com/security-kms-encryption/) for complete documentation. You must configure encryption at rest for the Atlas project before enabling it on any cluster in the project. For Documentation, see [AWS](https://docs.atlas.mongodb.com/security-aws-kms/), [GCP](https://docs.atlas.mongodb.com/security-kms-encryption/) and [Azure](https://docs.atlas.mongodb.com/security-azure-kms/#std-label-security-azure-kms). Requirements are if `replication_specs.#.region_configs.#.Specs.instance_size` is M10 or greater and `backup_enabled` is false or omitted. * `tags` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags). * `labels` - (Optional) Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels). **DEPRECATED** Use `tags` instead. @@ -446,7 +446,7 @@ Include **desired options** within advanced_configuration: } ``` -* `default_read_concern` - **(DEPRECATED)** (Optional) [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). +* `default_read_concern` - (Optional) [Default level of acknowledgment requested from MongoDB for read operations](https://docs.mongodb.com/manual/reference/read-concern/) set for this cluster. MongoDB 4.4 clusters default to [available](https://docs.mongodb.com/manual/reference/read-concern-available/). **(DEPRECATED)** MongoDB 5.0 and later clusters default to `local`. To use a custom read concern level, please refer to your driver documentation. * `default_write_concern` - (Optional) [Default level of acknowledgment requested from MongoDB for write operations](https://docs.mongodb.com/manual/reference/write-concern/) set for this cluster. MongoDB 4.4 clusters default to [1](https://docs.mongodb.com/manual/reference/write-concern/). * `fail_index_key_too_long` - (Optional) When true, documents can only be updated or inserted if, for all indexed fields on the target collection, the corresponding index entries do not exceed 1024 bytes. When false, mongod writes documents that exceed the limit but does not index them. **(DEPRECATED)** This parameter has been removed as of [MongoDB 4.4](https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.failIndexKeyTooLong). * `javascript_enabled` - (Optional) When true, the cluster allows execution of operations that perform server-side executions of JavaScript. When false, the cluster disables execution of those operations. @@ -537,9 +537,11 @@ replication_specs { } } ``` +https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown -* `num_shards` - **(DEPRECATED)** (Optional) Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. Omit this value if you selected a `cluster_type` of REPLICASET. This API resource accepts 1 through 50, inclusive. This parameter defaults to 1. If you specify a `num_shards` value of 1 and a `cluster_type` of SHARDED, Atlas deploys a single-shard [sharded cluster](https://docs.atlas.mongodb.com/reference/glossary/#std-term-sharded-cluster). Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. -If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards. To learn more, see [Convert a replica set to a sharded cluster documentation](https://www.mongodb.com/docs/atlas/scale-cluster/#convert-a-replica-set-to-a-sharded-cluster) and [Convert a replica set to a sharded cluster tutorial](https://www.mongodb.com/docs/upcoming/tutorial/convert-replica-set-to-replicated-shard-cluster). + +* `num_shards` - (Optional) Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. Omit this value if you selected a `cluster_type` of REPLICASET. This API resource accepts 1 through 50, inclusive. This parameter defaults to 1. If you specify a `num_shards` value of 1 and a `cluster_type` of SHARDED, Atlas deploys a single-shard [sharded cluster](https://docs.atlas.mongodb.com/reference/glossary/#std-term-sharded-cluster). Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. +If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards. To learn more, see [Convert a replica set to a sharded cluster documentation](https://www.mongodb.com/docs/atlas/scale-cluster/#convert-a-replica-set-to-a-sharded-cluster) and [Convert a replica set to a sharded cluster tutorial](https://www.mongodb.com/docs/upcoming/tutorial/convert-replica-set-to-replicated-shard-cluster). **(DEPRECATED)** Please refer [1.18.0 upgrade guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/1.18.0-upgrade-guide.html.markdown) for more details. * `region_configs` - (Optional) Configuration for the hardware specifications for nodes set for a given regionEach `region_configs` object describes the region's priority in elections and the number and type of MongoDB nodes that Atlas deploys to the region. Each `region_configs` object must have either an `analytics_specs` object, `electable_specs` object, or `read_only_specs` object. See [below](#region_configs) * `zone_name` - (Optional) Name for the zone in a Global Cluster. From 3dda6609118108c3254de86e2e45f307926f530e Mon Sep 17 00:00:00 2001 From: Aastha Mahendru Date: Wed, 17 Jul 2024 14:11:43 +0100 Subject: [PATCH 5/5] add migration guide link to depreation message --- internal/service/advancedcluster/resource_advanced_cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/advancedcluster/resource_advanced_cluster.go b/internal/service/advancedcluster/resource_advanced_cluster.go index e062637818..e683a4f97d 100644 --- a/internal/service/advancedcluster/resource_advanced_cluster.go +++ b/internal/service/advancedcluster/resource_advanced_cluster.go @@ -40,7 +40,7 @@ const ( ErrorAdvancedClusterListStatus = "error awaiting MongoDB ClusterAdvanced List IDLE: %s" ErrorOperationNotPermitted = "error operation not permitted" ignoreLabel = "Infrastructure Tool" - DeprecationOldSchemaAction = "Please refer to our examples, documentation, and 1.18.0 migration guide for more details" + 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" ) type acCtxKey string