Skip to content

Commit c41eb56

Browse files
authored
doc: Updates guides & examples for removal of mongodbatlas_advanced_cluster deprecated params (#3634)
1 parent 6515a26 commit c41eb56

File tree

12 files changed

+134
-97
lines changed

12 files changed

+134
-97
lines changed

.github/workflows/code-health.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191
secrets: inherit
9292
uses: ./.github/workflows/acceptance-tests.yml
9393
with:
94-
reduced_tests: false
94+
reduced_tests: true

docs/data-sources/advanced_cluster.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ resource "mongodbatlas_advanced_cluster" "example" {
9292
data "mongodbatlas_advanced_cluster" "example" {
9393
project_id = mongodbatlas_advanced_cluster.example.project_id
9494
name = mongodbatlas_advanced_cluster.example.name
95-
use_replication_spec_per_shard = true
9695
}
9796
```
9897

@@ -128,23 +127,20 @@ data "mongodbatlas_advanced_cluster" "example" {
128127

129128
* `project_id` - (Required) The unique ID for the project to create the cluster.
130129
* `name` - (Required) Name of the cluster as it appears in Atlas. Once the cluster is created, its name cannot be changed.
131-
* `use_replication_spec_per_shard` - (Optional) Set this field to true to allow the data source to use the latest schema representing each shard with an individual `replication_specs` object. This enables representing clusters with independent shard scaling.
132130

133131
## Attributes Reference
134132

135133
In addition to all arguments above, the following attributes are exported:
136134

137-
* `id` - The cluster ID.
138135
* `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). In prior versions of the MongoDB Atlas Terraform Provider, this parameter was named `bi_connector`.
139136
* `cluster_type` - Type of the cluster that you want to create.
140-
* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs[#].region_configs[#].(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide).
141137
* `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE.
142138
* `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags).
143139
* `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.
144140
* `mongo_db_major_version` - Version of the cluster to deploy.
145141
* `pinned_fcv` - The pinned Feature Compatibility Version (FCV) with its associated expiration date. See [below](#pinned_fcv).
146142
* `pit_enabled` - Flag that indicates if the cluster uses Continuous Cloud Backup.
147-
* `replication_specs` - List of settings that configure your cluster regions. If `use_replication_spec_per_shard = true`, this array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. See [below](#replication_specs).
143+
* `replication_specs` - List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. See [below](#replication_specs).
148144
* `root_cert_type` - Certificate Authority that MongoDB Atlas clusters use.
149145
* `termination_protection_enabled` - Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
150146
* `version_release_system` - Release cadence that Atlas uses for this cluster.
@@ -183,9 +179,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
183179

184180
### replication_specs
185181

186-
* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. This value is not populated (empty string) when a sharded cluster has independently scaled shards.
187-
* `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI. When using old sharding configuration (replication spec with `num_shards` greater than 1) this value is not populated.
188-
* `num_shards` - Provide this value if you set a `cluster_type` of `SHARDED` or `GEOSHARDED`. **(DEPRECATED)** To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide).
182+
* `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI.
189183
* `region_configs` - Configuration for the hardware specifications for nodes set for a given region. Each `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).
190184
* `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`.
191185
* `zone_name` - Name for the zone in a Global Cluster.
@@ -231,9 +225,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
231225
* `compute_max_instance_size` - Maximum instance size to which your cluster can automatically scale (such as M40).
232226
#### Advanced Configuration
233227

234-
* `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. **(DEPRECATED)** MongoDB 6.0 and later clusters default to `local`. To use a custom read concern level, please refer to your driver documentation.
235228
* `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 6.0 clusters default to [majority](https://docs.mongodb.com/manual/reference/write-concern/).
236-
* `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.
237229
* `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.
238230
* `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections. Valid values are:
239231
- TLS1_0
@@ -261,7 +253,6 @@ In addition to all arguments above, the following attributes are exported:
261253

262254
* `cluster_id` - The cluster ID.
263255
* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format.
264-
* `id` - The Terraform's unique identifier used internally for state management.
265256
* `connection_strings` - Set of connection strings that your applications use to connect to this cluster. More information in [Connection-strings](https://docs.mongodb.com/manual/reference/connection-string/). Use the parameters in this object to connect your applications to this cluster. To learn more about the formats of connection strings, see [Connection String Options](https://docs.atlas.mongodb.com/reference/faq/connection-changes/). NOTE: Atlas returns the contents of this object after the cluster is operational, not while it builds the cluster.
266257

267258
**NOTE** Connection strings must be returned as a list, therefore to refer to a specific attribute value add index notation. Example: mongodbatlas_advanced_cluster.cluster-test.connection_strings.0.standard_srv

docs/data-sources/advanced_clusters.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ resource "mongodbatlas_advanced_cluster" "example" {
8989
data "mongodbatlas_advanced_cluster" "example-asym" {
9090
project_id = mongodbatlas_advanced_cluster.example.project_id
9191
name = mongodbatlas_advanced_cluster.example.name
92-
use_replication_spec_per_shard = true
9392
}
9493
```
9594

@@ -119,27 +118,24 @@ data "mongodbatlas_advanced_clusters" "example" {
119118
## Argument Reference
120119

121120
* `project_id` - (Required) The unique ID for the project to get the clusters.
122-
* `use_replication_spec_per_shard` - (Optional) Set this field to true to allow the data source to use the latest schema representing each shard with an individual `replication_specs` object. This enables representing clusters with independent shard scaling. **Note:** If not set to true, this data source return all clusters except clusters with asymmetric shards.
123121

124122
## Attributes Reference
125123

126124
In addition to all arguments above, the following attributes are exported:
127125

128-
* `id` - The cluster ID.
129126
* `results` - A list where each represents a Cluster. See below for more details.
130127

131128
### Advanced Cluster
132129

133130
* `bi_connector_config` - Configuration settings applied to BI Connector for Atlas on this cluster. See [below](#bi_connector_config). In prior versions of the MongoDB Atlas Terraform Provider, this parameter was named `bi_connector`.
134131
* `cluster_type` - Type of the cluster that you want to create.
135-
* `disk_size_gb` - Capacity, in gigabytes, of the host's root volume. **(DEPRECATED)** Use `replication_specs[#].region_configs[#].(analytics_specs|electable_specs|read_only_specs).disk_size_gb` instead. To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide) for more details.
136132
* `encryption_at_rest_provider` - Possible values are AWS, GCP, AZURE or NONE.
137133
* `tags` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#tags).
138134
* `labels` - Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See [below](#labels).
139135
* `mongo_db_major_version` - Version of the cluster to deploy.
140136
* `pinned_fcv` - The pinned Feature Compatibility Version (FCV) with its associated expiration date. See [below](#pinned_fcv).
141137
* `pit_enabled` - Flag that indicates if the cluster uses Continuous Cloud Backup.
142-
* `replication_specs` - List of settings that configure your cluster regions. If `use_replication_spec_per_shard = true`, this array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. See [below](#replication_specs)
138+
* `replication_specs` - List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. See [below](#replication_specs)
143139
* `root_cert_type` - Certificate Authority that MongoDB Atlas clusters use.
144140
* `termination_protection_enabled` - Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
145141
* `version_release_system` - Release cadence that Atlas uses for this cluster.
@@ -178,9 +174,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
178174

179175
### replication_specs
180176

181-
* `id` - **(DEPRECATED)** Unique identifer of the replication document for a zone in a Global Cluster. This value corresponds to the legacy sharding schema (no independent shard scaling) and is different from the Shard ID you may see in the Atlas UI. This value is not populated (empty string) when a sharded cluster has independently scaled shards.
182-
* `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI. When using old sharding configuration (replication spec with `num_shards` greater than 1) this value is not populated.
183-
* `num_shards` - Provide this value if you set a `cluster_type` of SHARDED or GEOSHARDED. **(DEPRECATED)** To learn more, see the [Migration Guide](../guides/1.18.0-upgrade-guide) for more details.
177+
* `external_id` - Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. This value corresponds to Shard ID displayed in the UI.
184178
* `region_configs` - Configuration for the hardware specifications for nodes set for a given region. Each `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).
185179
* `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`.
186180
* `zone_name` - Name for the zone in a Global Cluster.
@@ -227,9 +221,7 @@ Key-value pairs that categorize the cluster. Each key and value has a maximum le
227221

228222
#### Advanced Configuration
229223

230-
* `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. **(DEPRECATED)** MongoDB 6.0 and later clusters default to `local`. To use a custom read concern level, please refer to your driver documentation.
231224
* `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 6.0 clusters default to [majority](https://docs.mongodb.com/manual/reference/write-concern/).
232-
* `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.
233225
* `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.
234226
* `minimum_enabled_tls_protocol` - Sets the minimum Transport Layer Security (TLS) version the cluster accepts for incoming connections. Valid values are:
235227
- TLS1_0
@@ -258,7 +250,6 @@ In addition to all arguments above, the following attributes are exported:
258250

259251
* `cluster_id` - The cluster ID.
260252
* `mongo_db_version` - Version of MongoDB the cluster runs, in `major-version`.`minor-version` format.
261-
* `id` - The Terraform's unique identifier used internally for state management.
262253
* `connection_strings` - Set of connection strings that your applications use to connect to this cluster. More information in [Connection-strings](https://docs.mongodb.com/manual/reference/connection-string/). Use the parameters in this object to connect your applications to this cluster. To learn more about the formats of connection strings, see [Connection String Options](https://docs.atlas.mongodb.com/reference/faq/connection-changes/). NOTE: Atlas returns the contents of this object after the cluster is operational, not while it builds the cluster.
263254

264255
**NOTE** Connection strings must be returned as a list, therefore to refer to a specific attribute value add index notation. Example: mongodbatlas_advanced_cluster.cluster-test.connection_strings.0.standard_srv

docs/guides/2.0.0-upgrade-guide.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ New user and team management resources that replace deprecated invitation-based
4040

4141
## Breaking Changes
4242

43+
### `mongodbatlas_advanced_cluster`
44+
Resource:
45+
- The following attributes have been removed: `id`, `disk_size_gb`, `replication_specs.#.num_shards`, `replication_specs.#.id`, `advanced_configuration.default_read_concern`, `advanced_configuration.fail_index_key_too_long`.
46+
- Several block elements are now attributes requiring syntax changes in existing configurations such as `replication_specs`, `region_configs`, `advanced_configuration`, etc.
47+
- Only the new sharding configuration (one `replication_spec` for each shard) that allows scaling shards independently is supported.
48+
- For details, see [Migration Guide: Advanced Cluster (v1.x → v2.0.0)](migrate-to-advanced-cluster-2.0.md).
49+
50+
Data source:
51+
- The following attributes have been removed: `id`, `disk_size_gb`, `replication_specs.#.num_shards`, `replication_specs.#.id`, `advanced_configuration.default_read_concern`, `advanced_configuration.fail_index_key_too_long`, `use_replication_spec_per_shard`.
52+
- The data sources will now return only the new sharding configuration (one `replication_spec` for each shard) of the clusters that allows scaling shards independently.
53+
- For details, see [Migration Guide: Advanced Cluster (v1.x → v2.0.0)](migrate-to-advanced-cluster-2.0.md).
54+
4355
### `mongodbatlas_cloud_backup_schedule`
4456
Resource:
4557
- `export` and `auto_export_enabled` are now optional only arguments. This facilitates tracking changes in their configurations.

0 commit comments

Comments
 (0)