From 054478084fb7b00f553b04aaf2fe74dbf2e9ec24 Mon Sep 17 00:00:00 2001 From: Espen Albert Date: Fri, 20 Sep 2024 12:09:20 +0100 Subject: [PATCH] chore: Removes 1.20 deprecations (#2617) * chore: Removes `err_msg` from cloud_backup_snapshot_export_job * chore: add changelog entry * doc: Add attribute removal to upgrade-guide * chore: Removes `cluster_id` from `mongodbatlas_federated_database_instance` * chore: add attribute removal to migration guide and changelog entry * chore: fix changelog entry --- .changelog/2617.txt | 23 +++++++++++++++++++ .../cloud_backup_snapshot_export_job.md | 1 - .../cloud_backup_snapshot_export_jobs.md | 1 - .../federated_database_instance.md | 1 - .../federated_database_instances.md | 1 - docs/guides/1.20.0-upgrade-guide.md | 4 ++++ .../cloud_backup_snapshot_export_job.md | 1 - docs/resources/federated_database_instance.md | 1 - ...source_cloud_backup_snapshot_export_job.go | 7 ------ ...ource_cloud_backup_snapshot_export_jobs.go | 8 ------- ...source_cloud_backup_snapshot_export_job.go | 10 -------- ...data_source_federated_database_instance.go | 5 ---- .../resource_federated_database_instance.go | 7 ------ 13 files changed, 27 insertions(+), 43 deletions(-) create mode 100644 .changelog/2617.txt diff --git a/.changelog/2617.txt b/.changelog/2617.txt new file mode 100644 index 0000000000..3348739e45 --- /dev/null +++ b/.changelog/2617.txt @@ -0,0 +1,23 @@ +```release-note:breaking-change +resource/mongodbatlas_cloud_backup_snapshot_export_job: Removes `err_msg` attribute +``` + +```release-note:breaking-change +data-source/mongodbatlas_cloud_backup_snapshot_export_job: Removes `err_msg` attribute +``` + +```release-note:breaking-change +data-source/mongodbatlas_cloud_backup_snapshot_export_jobs: Removes `err_msg` attribute +``` + +```release-note:breaking-change +resource/mongodbatlas_federated_database_instance: Removes `storage_stores.#.cluster_id` attribute +``` + +```release-note:breaking-change +data-source/mongodbatlas_federated_database_instance: Removes `storage_stores.#.cluster_id` attribute +``` + +```release-note:breaking-change +data-source/mongodbatlas_federated_database_instances: Removes `storage_stores.#.cluster_id` attribute +``` diff --git a/docs/data-sources/cloud_backup_snapshot_export_job.md b/docs/data-sources/cloud_backup_snapshot_export_job.md index b7af5446f7..c967aa22cf 100644 --- a/docs/data-sources/cloud_backup_snapshot_export_job.md +++ b/docs/data-sources/cloud_backup_snapshot_export_job.md @@ -49,7 +49,6 @@ In addition to all arguments above, the following attributes are exported: * `custom_data` - Custom data to include in the metadata file named `.complete` that Atlas uploads to the bucket when the export job finishes. Custom data can be specified as key and value pairs. * `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster. * `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created. -* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used. * `export_status` - _Returned for replica set only._ Status of the export job. * `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes. * `export_job_id` - Unique identifier of the export job. diff --git a/docs/data-sources/cloud_backup_snapshot_export_jobs.md b/docs/data-sources/cloud_backup_snapshot_export_jobs.md index c4fb5bad89..afaeb44459 100644 --- a/docs/data-sources/cloud_backup_snapshot_export_jobs.md +++ b/docs/data-sources/cloud_backup_snapshot_export_jobs.md @@ -58,7 +58,6 @@ In addition to all arguments above, the following attributes are exported: * `custom_data` - Custom data to include in the metadata file named `.complete` that Atlas uploads to the bucket when the export job finishes. Custom data can be specified as key and value pairs. * `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster. * `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created. -* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used. * `export_status` - _Returned for replica set only._ Status of the export job. * `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes. * `export_job_id` - Unique identifier of the export job. diff --git a/docs/data-sources/federated_database_instance.md b/docs/data-sources/federated_database_instance.md index 99cd27f463..c156fa6893 100644 --- a/docs/data-sources/federated_database_instance.md +++ b/docs/data-sources/federated_database_instance.md @@ -73,7 +73,6 @@ In addition to all arguments above, the following attributes are exported: * `storage_stores.#.delimiter` - The delimiter that separates `storage_databases.#.collections.#.data_sources.#.path` segments in the data store. * `storage_stores.#.include_tags` - Determines whether or not to use S3 tags on the files in the given path as additional partition attributes. * `storage_stores.#.cluster_name` - Human-readable label of the MongoDB Cloud cluster on which the store is based. - * `storage_stores.#.cluster_id` - ID of the Cluster the Online Archive belongs to. * `storage_stores.#.allow_insecure` - Flag that validates the scheme in the specified URLs. * `storage_stores.#.public` - Flag that indicates whether the bucket is public. * `storage_stores.#.default_format` - Default format that Data Lake assumes if it encounters a file without an extension while searching the storeName. diff --git a/docs/data-sources/federated_database_instances.md b/docs/data-sources/federated_database_instances.md index 841709b844..cd41290bf9 100644 --- a/docs/data-sources/federated_database_instances.md +++ b/docs/data-sources/federated_database_instances.md @@ -63,7 +63,6 @@ In addition to all arguments above, the following attributes are exported: * `storage_stores.#.delimiter` - The delimiter that separates `storage_databases.#.collections.#.data_sources.#.path` segments in the data store. * `storage_stores.#.include_tags` - Determines whether or not to use S3 tags on the files in the given path as additional partition attributes. * `storage_stores.#.cluster_name` - Human-readable label of the MongoDB Cloud cluster on which the store is based. - * `storage_stores.#.cluster_id` - ID of the Cluster the Online Archive belongs to. * `storage_stores.#.allow_insecure` - Flag that validates the scheme in the specified URLs. * `storage_stores.#.public` - Flag that indicates whether the bucket is public. * `storage_stores.#.default_format` - Default format that Data Lake assumes if it encounters a file without an extension while searching the storeName. diff --git a/docs/guides/1.20.0-upgrade-guide.md b/docs/guides/1.20.0-upgrade-guide.md index 08d0e94174..3a3cd783aa 100644 --- a/docs/guides/1.20.0-upgrade-guide.md +++ b/docs/guides/1.20.0-upgrade-guide.md @@ -19,7 +19,11 @@ The Terraform MongoDB Atlas Provider version 1.20.0 has a number of new and exci - data-source/mongodbatlas_data_lake_pipeline_run - data-source/mongodbatlas_data_lake_pipeline_runs +- Attribute `err_msg` removed from `mongodbatlas_cloud_backup_snapshot_export_job` resource and data sources. +- Attribute `storage_stores.#.cluster_id` removed from `mongodbatlas_federated_database_instance` resource and data sources. + **Breaking Changes:** + - `mongodbatlas_alert_configuration` resource attribute `notification.#.integration_id` may have a computed value due to recent updates in the Atlas API [Alert Configuration](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/getAlertConfiguration). Due to this, MongoDB Atlas Provider versions **1.16.0 to 1.19.0** may experience non-empty plans if you are using this resource with an integration set for the notifications without an explicitly set `integration_id`. For more details, see [#2603](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2603). These users should either: diff --git a/docs/resources/cloud_backup_snapshot_export_job.md b/docs/resources/cloud_backup_snapshot_export_job.md index 2eb9c404df..471315df90 100644 --- a/docs/resources/cloud_backup_snapshot_export_job.md +++ b/docs/resources/cloud_backup_snapshot_export_job.md @@ -101,7 +101,6 @@ In addition to all arguments above, the following attributes are exported: * `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster. * `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created. -* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used. * `export_status` - _Returned for replica set only._ Status of the export job. * `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes. * `export_job_id` - Unique identifier of the export job. diff --git a/docs/resources/federated_database_instance.md b/docs/resources/federated_database_instance.md index b69cad0a9d..647c12ec1c 100644 --- a/docs/resources/federated_database_instance.md +++ b/docs/resources/federated_database_instance.md @@ -139,7 +139,6 @@ resource "mongodbatlas_federated_database_instance" "test" { * `storage_stores.#.delimiter` - The delimiter that separates `storage_databases.#.collections.#.data_sources.#.path` segments in the data store. * `storage_stores.#.include_tags` - Determines whether or not to use S3 tags on the files in the given path as additional partition attributes. * `storage_stores.#.cluster_name` - Human-readable label of the MongoDB Cloud cluster on which the store is based. - * `storage_stores.#.cluster_id` - ID of the Cluster the Online Archive belongs to. * `storage_stores.#.allow_insecure` - Flag that validates the scheme in the specified URLs. * `storage_stores.#.public` - Flag that indicates whether the bucket is public. * `storage_stores.#.default_format` - Default format that Data Lake assumes if it encounters a file without an extension while searching the storeName. diff --git a/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_job.go b/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_job.go index 6418155b6d..dd14c83d03 100644 --- a/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_job.go +++ b/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_job.go @@ -2,11 +2,9 @@ package cloudbackupsnapshotexportjob import ( "context" - "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" ) func DataSource() *schema.Resource { @@ -68,11 +66,6 @@ func DataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "err_msg": { - Type: schema.TypeString, - Computed: true, - Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.20.0"), - }, "export_bucket_id": { Type: schema.TypeString, Computed: true, diff --git a/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_jobs.go b/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_jobs.go index 11ced68abb..1b41bd997e 100644 --- a/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_jobs.go +++ b/internal/service/cloudbackupsnapshotexportjob/data_source_cloud_backup_snapshot_export_jobs.go @@ -2,12 +2,10 @@ package cloudbackupsnapshotexportjob import ( "context" - "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/id" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "go.mongodb.org/atlas-sdk/v20240805004/admin" @@ -81,11 +79,6 @@ func PluralDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "err_msg": { - Type: schema.TypeString, - Computed: true, - Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.20.0"), - }, "export_bucket_id": { Type: schema.TypeString, Computed: true, @@ -163,7 +156,6 @@ func flattenCloudBackupSnapshotExportJobs(jobs []admin.DiskBackupExportJob) []ma "components": flattenExportJobsComponents(job.GetComponents()), "custom_data": flattenExportJobsCustomData(job.GetCustomData()), "export_bucket_id": job.GetExportBucketId(), - "err_msg": "", "export_status_exported_collections": job.ExportStatus.GetExportedCollections(), "export_status_total_collections": job.ExportStatus.GetTotalCollections(), "finished_at": conversion.TimePtrToStringPtr(job.FinishedAt), diff --git a/internal/service/cloudbackupsnapshotexportjob/resource_cloud_backup_snapshot_export_job.go b/internal/service/cloudbackupsnapshotexportjob/resource_cloud_backup_snapshot_export_job.go index 26945fad80..bc3e75700e 100644 --- a/internal/service/cloudbackupsnapshotexportjob/resource_cloud_backup_snapshot_export_job.go +++ b/internal/service/cloudbackupsnapshotexportjob/resource_cloud_backup_snapshot_export_job.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" "go.mongodb.org/atlas-sdk/v20240805004/admin" @@ -94,11 +93,6 @@ func returnCloudBackupSnapshotExportJobSchema() map[string]*schema.Schema { Type: schema.TypeString, Computed: true, }, - "err_msg": { - Type: schema.TypeString, - Computed: true, - Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.20.0"), - }, "export_status_exported_collections": { Type: schema.TypeInt, Computed: true, @@ -185,10 +179,6 @@ func setExportJobFields(d *schema.ResourceData, exportJob *admin.DiskBackupExpor return diag.Errorf("error setting `created_at` for snapshot export job (%s): %s", d.Id(), err) } - if err := d.Set("err_msg", ""); err != nil { - return diag.Errorf("error setting `created_at` for snapshot export job (%s): %s", d.Id(), err) - } - if err := d.Set("export_bucket_id", exportJob.GetExportBucketId()); err != nil { return diag.Errorf("error setting `created_at` for snapshot export job (%s): %s", d.Id(), err) } diff --git a/internal/service/federateddatabaseinstance/data_source_federated_database_instance.go b/internal/service/federateddatabaseinstance/data_source_federated_database_instance.go index 630443434e..89fe877339 100644 --- a/internal/service/federateddatabaseinstance/data_source_federated_database_instance.go +++ b/internal/service/federateddatabaseinstance/data_source_federated_database_instance.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) @@ -229,10 +228,6 @@ func schemaFederatedDatabaseInstanceStoresDataSource() *schema.Schema { Type: schema.TypeString, Computed: true, }, - "cluster_id": { - Type: schema.TypeString, - Computed: true, - Deprecated: fmt.Sprintf(constant.DeprecationParamByDate, "September 2024")}, "project_id": { Type: schema.TypeString, Computed: true, diff --git a/internal/service/federateddatabaseinstance/resource_federated_database_instance.go b/internal/service/federateddatabaseinstance/resource_federated_database_instance.go index 2053c1e6b2..217f58c731 100644 --- a/internal/service/federateddatabaseinstance/resource_federated_database_instance.go +++ b/internal/service/federateddatabaseinstance/resource_federated_database_instance.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant" "github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion" "github.com/mongodb/terraform-provider-mongodbatlas/internal/config" ) @@ -271,12 +270,6 @@ func schemaFederatedDatabaseInstanceStores() *schema.Schema { Computed: true, Optional: true, }, - "cluster_id": { - Type: schema.TypeString, - Computed: true, - Optional: true, - Deprecated: fmt.Sprintf(constant.DeprecationParamByDate, "September 2024"), - }, "project_id": { Type: schema.TypeString, Computed: true,