Skip to content

Commit 601bab7

Browse files
authored
remove: Removes cloud_backup_schedule deprecated params (#3560)
1 parent d39b3c1 commit 601bab7

29 files changed

+148
-625
lines changed

.changelog/3560.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:breaking-change
2+
resource/mongodbatlas_cloud_backup_schedule: Removes the deprecated `copy_settings.#.replication_spec_id` attribute in favor of `zone_id`
3+
```
4+
5+
```release-note:breaking-change
6+
data-source/mongodbatlas_cloud_backup_schedule: Removes the deprecated `copy_settings.#.replication_spec_id` and `use_zone_id_for_copy_settings` attribute in favor of `zone_id`
7+
```

.changelog/3562.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:breaking-change
2+
resource/mongodbatlas_global_cluster_config: Removes the deprecated `custom_zone_mapping` attribute in favor of `custom_zone_mapping_zone_id`
3+
```
4+
5+
```release-note:breaking-change
6+
data-source/mongodbatlas_global_cluster_config: Removes the deprecated `custom_zone_mapping` attribute in favor of `custom_zone_mapping_zone_id`
7+
```

.github/workflows/acceptance-tests-runner.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ jobs:
536536
env:
537537
MONGODB_ATLAS_PROJECT_OWNER_ID: ${{ inputs.mongodb_atlas_project_owner_id }}
538538
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
539+
MONGODB_ATLAS_LAST_1X_VERSION: ${{ inputs.mongodb_atlas_last_1x_version }}
539540
AWS_REGION: ${{ vars.AWS_REGION_LOWERCASE }}
540541
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
541542
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
@@ -545,6 +546,7 @@ jobs:
545546
AZURE_ATLAS_APP_ID: ${{ inputs.azure_atlas_app_id }}
546547
AZURE_SERVICE_PRINCIPAL_ID: ${{ inputs.azure_service_principal_id }}
547548
AZURE_TENANT_ID: ${{ inputs.azure_tenant_id }}
549+
MONGODB_ATLAS_PREVIEW_PROVIDER_V2_ADVANCED_CLUSTER: 'true' # required for migration tests that use provider version < 2.0.0
548550
ACCTEST_PACKAGES: |
549551
./internal/service/cloudbackupschedule
550552
./internal/service/cloudbackupsnapshot

docs/data-sources/cloud_backup_schedule.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ resource "mongodbatlas_cloud_backup_schedule" "test" {
5959
data "mongodbatlas_cloud_backup_schedule" "test" {
6060
project_id = mongodbatlas_cloud_backup_schedule.test.project_id
6161
cluster_name = mongodbatlas_cloud_backup_schedule.test.cluster_name
62-
use_zone_id_for_copy_settings = true
6362
}
6463
```
6564

6665
## Argument Reference
6766

6867
* `project_id` - (Required) The unique identifier of the project for the Atlas cluster.
6968
* `cluster_name` - (Required) The name of the Atlas cluster that contains the snapshots backup policy you want to retrieve.
70-
* `use_zone_id_for_copy_settings` - Set this field to `true` to allow the data source to use the latest schema that populates `copy_settings.#.zone_id` instead of the deprecated `copy_settings.#.replication_spec_id`. These fields also enable you to reference cluster zones using independent shard scaling, which no longer supports `replication_spec.*.id`. To learn more, see the [1.18.0 upgrade guide](../guides/1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones).
7169

7270

7371
## Attributes Reference
@@ -139,7 +137,6 @@ In addition to all arguments above, the following attributes are exported:
139137
* `frequencies` - List that describes which types of snapshots to copy. i.e. "HOURLY" "DAILY" "WEEKLY" "MONTHLY" "YEARLY" "ON_DEMAND"
140138
* `region_name` - Target region to copy snapshots belonging to replicationSpecId to. Please supply the 'Atlas Region' which can be found under https://www.mongodb.com/docs/atlas/reference/cloud-providers/ 'regions' link
141139
* `zone_id` - Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster.
142-
* `replication_spec_id` - Unique 24-hexadecimal digit string that identifies the replication object for a zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Replication Spec Id, consult the replicationSpecs array returned from [Return One Multi-Cloud Cluster in One Project](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getcluster). **(DEPRECATED)** Use `zone_id` instead. To learn more, see the [1.18.0 upgrade guide](../guides/1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones).
143140
* `should_copy_oplogs` - Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores.
144141

145142
**Note** The parameter deleteCopiedBackups is not supported in terraform please leverage Atlas Admin API or AtlasCLI instead to manage the lifecycle of backup snaphot copies.

docs/data-sources/global_cluster_config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ In addition to all arguments above, the following attributes are exported:
105105

106106
* `id` - The Terraform's unique identifier used internally for state management.
107107
* `custom_zone_mapping_zone_id` - A map of all custom zone mappings defined for the Global Cluster to `replication_specs.*.zone_id`. Atlas automatically maps each location code to the closest geographical zone. Custom zone mappings allow administrators to override these automatic mappings. If your Global Cluster does not have any custom zone mappings, this document is empty.
108-
* `custom_zone_mapping` - (Deprecated) A map of all custom zone mappings defined for the Global Cluster to `replication_specs.*.id`. This attribute is deprecated, use `custom_zone_mapping_zone_id` instead. This attribute is not set when a cluster uses independent shard scaling. To learn more, see the [Sharding Configuration guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/cluster-to-advanced-cluster-migration-guide).
109108
* `managed_namespaces` - Add a managed namespaces to a Global Cluster. For more information about managed namespaces, see [Global Clusters](https://docs.atlas.mongodb.com/reference/api/global-clusters/). See [Managed Namespace](#managed-namespace) below for more details.
110109

111110
### Managed Namespace

docs/guides/2.0.0-upgrade-guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ The Terraform MongoDB Atlas Provider version 2.0.0 has the following new feature
2929

3030
- `export` and `auto_export_enabled` are now optional only arguments in `mongodbatlas_cloud_backup_schedule `. This facilitates tracking changes in their configurations.
3131

32+
- `copy_settings.#.replication_spec_id` attribute has been removed from `mongodbatlas_cloud_backup_schedule`. Use `copy_settings.#.zone_id` instead. To learn more, see the [1.18.0 upgrade guide](../guides/1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones).
33+
34+
- `copy_settings.#.replication_spec_id` and `use_zone_id_for_copy_settings` attributes have been removed from `data.mongodbatlas_cloud_backup_schedule`. Remove any usage of `use_zone_id_for_copy_settings` & replace any references to `copy_settings.#.replication_spec_id` in your configurations with `copy_settings.#.zone_id`. To learn more, see the [1.18.0 upgrade guide](../guides/1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones).
35+
3236
- `hour_of_day` is now defined as required for `mongodbatlas_maintenance_window`resources. This clarification prevents errors when creating new resources.
3337

3438
- `actions` now is set as `TypeSet` in `mongodbatlas_custom_db_role`. This prevents plan diffs when reordering the `actions` in `mongodbatlas_custom_db_role` resource.
3539

40+
- `custom_zone_mapping` attribute has been removed from the `mongodbatlas_global_cluster_config` resource and data source. Use `custom_zone_mapping_zone_id` instead. To learn more, see the [Sharding Configuration guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/advanced-cluster-new-sharding-schema).
3641

3742
2.0.0 also includes general improvements, bug fixes, and several key documentation updates. See the [CHANGELOG](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/CHANGELOG.md) for more specific information.
3843

docs/guides/advanced-cluster-new-sharding-schema.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ Name | Changes | Transition Guide
435435
`mongodbatlas_advanced_cluster` | Data source must use the `use_replication_spec_per_shard` attribute. | -
436436
`mongodbatlas_advanced_cluster` | Use `replication_specs.#.zone_id` instead of `replication_specs.#.id`. | -
437437
`mongodbatlas_cluster` | Resource and data source will not work. API error code `ASYMMETRIC_SHARD_UNSUPPORTED`. | [cluster-to-advanced-cluster-migration-guide](cluster-to-advanced-cluster-migration-guide.md)
438-
`mongodbatlas_cloud_backup_schedule` | Use `copy_settings.#.zone_id` instead of `copy_settings.#.replication_spec_id` | [1.18.0 Migration Guide](1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones)
439-
`mongodbatlas_global_cluster_config` | `custom_zone_mapping` is no longer populated, `custom_zone_mapping_zone_id` must be used instead. | -
438+
`mongodbatlas_cloud_backup_schedule` | Use `copy_settings.#.zone_id` instead of `copy_settings.#.replication_spec_id` | [1.18.0 Migration Guide](1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones)| -
440439

441440
### Data Source Transition for Asymmetric Clusters
442441

docs/resources/cloud_backup_schedule.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ resource "mongodbatlas_cloud_backup_schedule" "test" {
281281
* `frequencies` - (Required) List that describes which types of snapshots to copy. i.e. "HOURLY" "DAILY" "WEEKLY" "MONTHLY" "ON_DEMAND"
282282
* `region_name` - (Required) Target region to copy snapshots belonging to replicationSpecId to. Please supply the 'Atlas Region' which can be found under https://www.mongodb.com/docs/atlas/reference/cloud-providers/ 'regions' link
283283
* `zone_id` - Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find appropriate value for `zone_id`, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array [Return One Cluster From One Project](#operation/getCluster). Alternately, use `mongodbatlas_advanced_cluster` data source or resource and reference `replication_specs.#.zone_id`.
284-
* `replication_spec_id` - Unique 24-hexadecimal digit string that identifies the replication object for a zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Replication Spec Id, consult the replicationSpecs array returned from [Return One Multi-Cloud Cluster in One Project](https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-getcluster). **(DEPRECATED)** Use `zone_id` instead. To learn more, see the [1.18.0 upgrade guide](../guides/1.18.0-upgrade-guide.md#transition-cloud-backup-schedules-for-clusters-to-use-zones).
285284
* `should_copy_oplogs` - (Required) Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores.
286285

287286
## Attributes Reference

docs/resources/global_cluster_config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ In addition to all arguments above, the following attributes are exported:
9393

9494
* `id` - The Terraform's unique identifier used internally for state management.
9595
* `custom_zone_mapping_zone_id` - A map of all custom zone mappings defined for the Global Cluster to `replication_specs.*.zone_id`. Atlas automatically maps each location code to the closest geographical zone. Custom zone mappings allow administrators to override these automatic mappings. If your Global Cluster does not have any custom zone mappings, this document is empty.
96-
* `custom_zone_mapping` - (Deprecated) A map of all custom zone mappings defined for the Global Cluster to `replication_specs.*.id`. This attribute is deprecated, use `custom_zone_mapping_zone_id` instead. This attribute is not set when a cluster uses independent shard scaling. To learn more, see the [Sharding Configuration guide](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/cluster-to-advanced-cluster-migration-guide).
9796

9897
## Import
9998

internal/service/backupcompliancepolicy/resource_backup_compliance_policy_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1212
"github.com/hashicorp/terraform-plugin-testing/terraform"
13+
1314
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
1415
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc"
1516
)
@@ -68,7 +69,7 @@ func TestAccBackupCompliancePolicy_overwriteBackupPolicies(t *testing.T) {
6869
acc.ClusterAdvConfigOplogMinRetentionHours: 8,
6970
},
7071
ProjectID: projectIDTerraform,
71-
MongoDBMajorVersion: "6.0",
72+
MongoDBMajorVersion: "8.0",
7273
CloudBackup: true,
7374
DiskSizeGb: 12,
7475
RetainBackupsEnabled: true,
@@ -387,7 +388,7 @@ func configOverwriteIncompatibleBackupPoliciesError(projectName, orgID, projectO
387388
cloud_provider = "AWS"
388389
frequencies = ["DAILY"]
389390
region_name = "US_WEST_1"
390-
replication_spec_id = one(%[2]s.replication_specs).id
391+
zone_id = %[2]s.replication_specs.*.zone_id[0]
391392
should_copy_oplogs = false
392393
}
393394
}
@@ -431,7 +432,7 @@ func configClusterWithBackupSchedule(projectName, orgID, projectOwnerID string,
431432
cloud_provider = "AWS"
432433
frequencies = ["DAILY"]
433434
region_name = "US_WEST_1"
434-
replication_spec_id = one(%[2]s.replication_specs).id
435+
zone_id = %[2]s.replication_specs.*.zone_id[0]
435436
should_copy_oplogs = false
436437
}
437438
}

0 commit comments

Comments
 (0)