Skip to content

Commit

Permalink
remove!: Removes deprecated attributes targeting 1.18.0 (#2499)
Browse files Browse the repository at this point in the history
* removing scheme from third_party_integration

* remove page_num and items_per_page in federated_settings_identity_providers

* changes in id of mongodbatlas_cloud_backupsnapshot_export_bucket

* changes in id of mongodbatlas_cloud_backupsnapshot_export_job

* created_at attribute in cloud_backup_snapshot_restore_job

* remove job_id attribute from cloud_backup_snapshot_restore data source

* service attachment name removal in privatelink endpoint service

* adjust test of federated settings identity provider

* remove id argument in cloud backup snapshot export bucket

* Rephrase to positive statement
  • Loading branch information
AgustinBettati authored Aug 14, 2024
1 parent ff9dbd7 commit 240bd44
Show file tree
Hide file tree
Showing 23 changed files with 73 additions and 106 deletions.
47 changes: 47 additions & 0 deletions .changelog/2499.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
```release-note:breaking-change
resource/mongodbatlas_third_party_integration: Removes `scheme` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_third_party_integration: Removes `scheme` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_third_party_integrations: Removes `scheme` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_federated_settings_identity_providers: Removes `page_num` and `items_per_page` attributes
```

```release-note:breaking-change
data-source/mongodbatlas_cloud_backup_snapshot_export_bucket: Changes `id` attribute from optional to computed only
```

```release-note:breaking-change
data-source/mongodbatlas_cloud_backup_snapshot_export_job: Changes `id` attribute from optional to computed only
```

```release-note:breaking-change
resource/mongodbatlas_cloud_backup_snapshot_restore_job: Removes `created_at` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_cloud_backup_snapshot_restore_job: Removes `created_at` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_cloud_backup_snapshot_restore_jobs: Removes `created_at` attribute
```

```release-note:breaking-change
data-source/mongodbatlas_cloud_backup_snapshot_restore_job: Removes `job_id` attribute and defines `snapshot_restore_job_id` attribute as required
```

```release-note:breaking-change
data-source/mongodbatlas_privatelink_endpoint_service: Removes `endpoints.*.service_attachment_name` attribute
```

```release-note:breaking-change
resource/mongodbatlas_privatelink_endpoint_service: Removes `endpoints.*.service_attachment_name` attribute
```
9 changes: 4 additions & 5 deletions docs/data-sources/cloud_backup_snapshot_restore_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@ resource "mongodbatlas_cloud_backup_snapshot_restore_job" "test" {
}
data "mongodbatlas_cloud_backup_snapshot_restore_job" "test" {
project_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.project_id
project_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.project_id
cluster_name = mongodbatlas_cloud_backup_snapshot_restore_job.test.cluster_name
job_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.id
snapshot_restore_job_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.snapshot_restore_job_id
}
```

## Argument Reference

* `project_id` - (Required) The unique identifier of the project for the Atlas cluster.
* `cluster_name` - (Required) The name of the Atlas cluster for which you want to retrieve the restore job.
* `job_id` - (Optional) A base64-encoded ID of `project_id`, `cluster_name`, and `job_id` of this resource. **Note**: This attribute is deprecated, use `snapshot_restore_job_id` instead.
* `snapshot_restore_job_id` - (Optional) The unique identifier of the restore job to retrieve. Required for versions 1.18.0 and later.
* `snapshot_restore_job_id` - (Required) The unique identifier of the restore job to retrieve.

## Attributes Reference

Expand All @@ -60,4 +59,4 @@ In addition to all arguments above, the following attributes are exported:
* `oplogInc` - Oplog operation number from which to you want to restore this snapshot.
* `pointInTimeUTCSeconds` - Timestamp in the number of seconds that have elapsed since the UNIX epoch.

For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/get-one-restore-job/)
For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/get-one-restore-job/)
4 changes: 2 additions & 2 deletions docs/data-sources/federated_settings_identity_providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

`mongodbatlas_federated_settings_identity_providers` provides an Federated Settings Identity Providers datasource. Atlas Cloud Federated Settings Identity Providers provides federated settings outputs for the configured Identity Providers.

Note: This implementation returns a maximum of 100 results.

## Example Usage

```terraform
Expand All @@ -24,8 +26,6 @@ data "mongodbatlas_federated_settings_identity_providers" "identitty_provider" {
## Argument Reference

* `federation_settings_id` - (Required) Unique 24-hexadecimal digit string that identifies the federated authentication configuration.
* `page_num` - (Optional) The page to return. Defaults to `1`. **Note**: This attribute is deprecated and not being used.
* `items_per_page` - (Optional) Number of items to return per page, up to a maximum of 500. Defaults to `100`. **Note**: This attribute is deprecated and not being used. The implementation is currently limited to returning a maximum of 100 results.
* `protocols` - (Optional) The protocols of the target identity providers. Valid values are `SAML` and `OIDC`.
* `idp_types` - (Optional) The types of the target identity providers. Valid values are `WORKFORCE` and `WORKLOAD`.

Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/privatelink_endpoint_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,5 @@ In addition to all arguments above, the following attributes are exported:
* `endpoint_name` - Forwarding rule that corresponds to the endpoint you created in GCP.
* `ip_address` - Private IP address of the network endpoint group you created in GCP.
* `status` - Status of the endpoint. Atlas returns one of the [values shown above](https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-create-one/#std-label-ref-status-field).
* `service_attachment_name` - Unique alphanumeric and special character strings that identify the service attachment associated with the endpoint.

See [MongoDB Atlas API](https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-get-one/) Documentation for more information.
1 change: 0 additions & 1 deletion docs/data-sources/third_party_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ Additional values based on Type
* `user_name` - Your Prometheus username.
* `password` - Your Prometheus password.
* `service_discovery` - Indicates which service discovery method is used, either file or http.
* `scheme` - Your Prometheus protocol scheme configured for requests. **Note** This attribute is deprecated as it is not being used.
* `enabled` - Whether your cluster has Prometheus enabled.

See [MongoDB Atlas API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Third-Party-Integrations/operation/createThirdPartyIntegration) Documentation for more information.
1 change: 0 additions & 1 deletion docs/data-sources/third_party_integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Additional values based on Type
* `PROMETHEUS`
* `user_name` - Your Prometheus username.
* `service_discovery` - Indicates which service discovery method is used, either file or http.
* `scheme` - Your Prometheus protocol scheme configured for requests. **Note** This attribute is deprecated as it is not being used.
* `enabled` - Whether your cluster has Prometheus enabled.

See [MongoDB Atlas API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Third-Party-Integrations/operation/createThirdPartyIntegration) Documentation for more information.
11 changes: 10 additions & 1 deletion docs/guides/1.18.0-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The Terraform MongoDB Atlas Provider version 1.18.0 has a number of new and exci
- The cloud backup schedule for a cluster can now be used to configure copy settings by zone instead of replication object in each zone with the `mongodbatlas_cloud_backup_schedule` resource and data sources. This feature also enables you to reference cluster zones using independent shard scaling, which no longer supports `replication_spec.*.id`.
- `copy_settings.*.zone_id`: Users should update their configurations to use this attribute instead of `copy_settings.*.replication_spec_id`. To learn more, [see below](#transition-cloud-backup-schedules-for-clusters-to-use-zones).

**Deprecations:**
**Deprecations and removals:**

- Deprecations in `mongodbatlas_advanced_cluster` resource and data sources:
- `replication_specs.*.num_shards`: The `replication_specs` list now supports defining an object for each inidividual shard. Use this new schema instead of the `num_shards` attribute. To learn more, see the [Migration Guide](advanced-cluster-new-sharding-schema).
Expand All @@ -31,6 +31,15 @@ The Terraform MongoDB Atlas Provider version 1.18.0 has a number of new and exci
- In `mongodbatlas_cloud_backup_schedule` data source, users will also need to set `use_zone_id_for_copy_settings = 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`.


- Attribute `scheme` removed from `mongodbatlas_third_party_integration` resource and data sources.
- Attributes `page_num` and `items_per_page` removed from `federated_settings_identity_providers` data source.
- Attribute `id` changed from optional to computed only in `mongodbatlas_cloud_backupsnapshot_export_bucket` data source.
- Attribute `id` changed from optional to computed only in `mongodbatlas_cloud_backupsnapshot_export_job` data source.
- Attribute `created_at` removed from `mongodbatlas_cloud_backup_snapshot_restore_job` resource and data sources.
- Attribute `job_id` removed from `mongodbatlas_cloud_backup_snapshot_restore_job` in favour of `snapshot_restore_job_id`.
- Attribute `endpoints.*.service_attachment_name` removed from `mongodbatlas_privatelink_endpoint_service` resource and data source.


## Transition Cloud Backup Schedules for Clusters to use zones

### Update `mongodbatlas_cloud_backup_schedule` resource:
Expand Down
1 change: 0 additions & 1 deletion docs/resources/privatelink_endpoint_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ In addition to all arguments above, the following attributes are exported:
* `endpoint_group_name` - (Optional) Unique identifier of the endpoint group. The endpoint group encompasses all of the endpoints that you created in GCP.
* `endpoints` - Collection of individual private endpoints that comprise your network endpoint group.
* `status` - Status of the endpoint. Atlas returns one of the [values shown above](https://docs.atlas.mongodb.com/reference/api/private-endpoints-endpoint-create-one/#std-label-ref-status-field).
* `service_attachment_name` - Unique alphanumeric and special character strings that identify the service attachment associated with the endpoint.

## Import
Private Endpoint Link Connection can be imported using project ID and username, in the format `{project_id}--{private_link_id}--{endpoint_service_id}--{provider_name}`, e.g.
Expand Down
1 change: 0 additions & 1 deletion docs/resources/third_party_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ resource "mongodbatlas_third_party_integration" "test_datadog" {
* `user_name` - Your Prometheus username.
* `password` - Your Prometheus password.
* `service_discovery` - Indicates which service discovery method is used, either file or http.
* `scheme` - Your Prometheus protocol scheme configured for requests. **Note:** This attribute is deprecated as it is not being used.
* `enabled` - Whether your cluster has Prometheus enabled.

## Attributes Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/config"
)

Expand All @@ -15,10 +14,8 @@ func DataSource() *schema.Resource {
ReadContext: datasourceRead,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0") + " Will not be an input parameter, only computed.",
Type: schema.TypeString,
Computed: true,
},
"export_bucket_id": {
Type: schema.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ func configAWSBasic(projectID, bucketName, policyName, roleName string) string {
data "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
project_id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.project_id
export_bucket_id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.export_bucket_id
id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.export_bucket_id
}
data "mongodbatlas_cloud_backup_snapshot_export_buckets" "test" {
Expand Down Expand Up @@ -298,7 +297,6 @@ func configAzureBasic(projectID, atlasAzureAppID, servicePrincipalID, tenantID,
data "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
project_id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.project_id
export_bucket_id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.export_bucket_id
id = mongodbatlas_cloud_backup_snapshot_export_bucket.test.export_bucket_id
}
data "mongodbatlas_cloud_backup_snapshot_export_buckets" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ func DataSource() *schema.Resource {
ReadContext: dataSourceMongoDBAtlasCloudBackupSnapshotsExportJobRead,
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0") + " Will not be an input parameter, only computed.",
Type: schema.TypeString,
Computed: true,
},
"export_job_id": {
Type: schema.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +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"
)

Expand All @@ -17,7 +15,7 @@ func DataSource() *schema.Resource {
Schema: map[string]*schema.Schema{
"snapshot_restore_job_id": {
Type: schema.TypeString,
Optional: true,
Required: true,
},
"project_id": {
Type: schema.TypeString,
Expand All @@ -29,22 +27,10 @@ func DataSource() *schema.Resource {
Required: true,
ForceNew: true,
},
"job_id": {
Type: schema.TypeString,
ForceNew: true,
Optional: true,
// When deprecating, change snapshot_restore_job_id to Required: true and implementation below
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0") + " Use snapshot_restore_job_id instead.",
},
"cancelled": {
Type: schema.TypeBool,
Computed: true,
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
"delivery_type": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -103,17 +89,7 @@ func DataSource() *schema.Resource {
func dataSourceRead(ctx context.Context, d *schema.ResourceData, meta any) diag.Diagnostics {
conn := meta.(*config.MongoDBClient).AtlasV2

var restoreID string
restoreIDRaw, restoreIDInField := d.GetOk("snapshot_restore_job_id")
if restoreIDInField {
restoreID = restoreIDRaw.(string)
} else {
idEncoded, restoreIDInField := d.GetOk("job_id")
if !restoreIDInField {
return diag.Errorf("either snapshot_restore_job_id or job_id must be set")
}
restoreID = conversion.GetEncodedID(idEncoded.(string), "snapshot_restore_job_id")
}
restoreID := d.Get("snapshot_restore_job_id").(string)
projectID := d.Get("project_id").(string)
clusterName := d.Get("cluster_name").(string)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"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/v20240805001/admin"
Expand Down Expand Up @@ -46,11 +45,6 @@ func PluralDataSource() *schema.Resource {
Type: schema.TypeBool,
Computed: true,
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
"delivery_type": {
Type: schema.TypeString,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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/v20240805001/admin"
Expand Down Expand Up @@ -101,11 +100,6 @@ func Resource() *schema.Resource {
Type: schema.TypeBool,
Computed: true,
},
"created_at": {
Type: schema.TypeString,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
"expired": {
Type: schema.TypeBool,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func configBasic(terraformStr, clusterResourceName, description, retentionInDays
data "mongodbatlas_cloud_backup_snapshot_restore_job" "test" {
project_id = mongodbatlas_cloud_backup_snapshot.test.project_id
cluster_name = mongodbatlas_cloud_backup_snapshot.test.cluster_name
job_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.id # remove after 1.18.0
snapshot_restore_job_id = mongodbatlas_cloud_backup_snapshot_restore_job.test.snapshot_restore_job_id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,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"
)
Expand All @@ -37,16 +36,6 @@ func PluralDataSource() *schema.Resource {
},
Optional: true,
},
"page_num": {
Type: schema.TypeInt,
Optional: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
"items_per_page": {
Type: schema.TypeInt,
Optional: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
"results": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -290,6 +279,7 @@ func dataSourcePluralRead(ctx context.Context, d *schema.ResourceData, meta any)
IdpType: &idpTypes,
}

// iterating all results to be implemented as part of CLOUDP-227485
providers, _, err := connV2.FederatedAuthenticationApi.ListIdentityProvidersWithParams(ctx, params).Execute()
if err != nil {
return diag.Errorf("error getting federatedSettings Identity Providers assigned (%s): %s", federationSettingsID, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func configPluralDS(federatedSettingsID string, idpType *string, protocols []str
return fmt.Sprintf(`
data "mongodbatlas_federated_settings_identity_providers" "test" {
federation_settings_id = "%[1]s"
page_num = 1
items_per_page = 100
%[2]s
%[3]s
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ func DataSource() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"service_attachment_name": {
Type: schema.TypeString,
Computed: true,
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
"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"
"github.com/mongodb/terraform-provider-mongodbatlas/internal/service/advancedcluster"
Expand Down Expand Up @@ -120,11 +119,6 @@ func Resource() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"service_attachment_name": {
Type: schema.TypeString,
Computed: true,
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.18.0"),
},
},
},
},
Expand Down
Loading

0 comments on commit 240bd44

Please sign in to comment.