Skip to content

Commit 6b91e35

Browse files
authored
chore: Adds deprecation notice for tenant_id attribute in mongodbatlas_cloud_backup_snapshot_export_bucket and remove deprecation on attribute to avoid warnings (#2938)
* chore: Add deprecation notice for `tenant_id` attribute in `mongodbatlas_cloud_backup_snapshot_export_bucket` * chore: Remove deprecation notice for data sources of `tenant_id` attribute in cloud backup snapshot export bucket documentation * chore: Update deprecation notice for `tenant_id` in cloud backup snapshot export bucket documentation and schema * chore: Remove deprecation notice for `tenant_id` in resource to avoid warnings when used as an attribute * chore: Clean up formatting for `tenant_id` attribute in cloud backup snapshot export bucket schema * chore: Update comment for `tenant_id` attribute to clarify its computed usage and potential breaking change
1 parent 6be7488 commit 6b91e35

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

.changelog/2932.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
resource/mongodbatlas_cloud_backup_snapshot_export_bucket: Deprecates `tenant_id` argument as the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead
3+
```

docs/data-sources/cloud_backup_snapshot_export_bucket.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In addition to all arguments above, the following attributes are exported:
3535
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket.
3636
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container.
3737
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account.
38-
* `tenant_id` - (Deprecated) This field is ignored; the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead. UUID that identifies the Azure Active Directory Tenant ID.
38+
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID.
3939

4040

4141

docs/data-sources/cloud_backup_snapshot_export_buckets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ In addition to all arguments above, the following attributes are exported:
4444
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket.
4545
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container.
4646
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account.
47-
* `tenant_id` - (Deprecated) This field is ignored; the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead. UUID that identifies the Azure Active Directory Tenant ID.
47+
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID.
4848

4949

5050
For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/create-one-export-bucket/)

docs/resources/cloud_backup_snapshot_export_bucket.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
3939
* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket. Required if `cloud_provider` is set to `AWS`.
4040
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container. Required if `cloud_provider` is set to `AZURE`.
4141
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account. Required if `cloud_provider` is set to `AZURE`.
42-
* `tenant_id` - (Deprecated) This field is ignored; the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead. UUID that identifies the Azure Active Directory Tenant ID.
42+
* `tenant_id` - (Deprecated) This field is ignored; the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead and returned as an attribute. UUID that identifies the Azure Active Directory Tenant ID.
4343

4444
## Attributes Reference
4545

4646
In addition to all arguments above, the following attributes are exported:
4747

4848
* `export_bucket_id` - Unique identifier of the snapshot export bucket.
49+
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID.
4950

5051
## Import
5152

internal/service/cloudbackupsnapshotexportbucket/resource_cloud_backup_snapshot_export_bucket.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry"
1616
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1717

18-
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/constant"
1918
"github.com/mongodb/terraform-provider-mongodbatlas/internal/common/conversion"
2019
"github.com/mongodb/terraform-provider-mongodbatlas/internal/config"
2120
)
@@ -73,10 +72,9 @@ func Schema() map[string]*schema.Schema {
7372
ForceNew: true,
7473
},
7574
"tenant_id": {
76-
Deprecated: fmt.Sprintf(constant.DeprecationParamByVersion, "1.27.0") + " This field is ignored; the `mongodbatlas_cloud_provider_access_authorization.azure.tenant_id` is used instead.",
77-
Type: schema.TypeString,
78-
Optional: true,
79-
Computed: true,
75+
Type: schema.TypeString,
76+
Optional: true, // attribute is only used as a computed, this is called out in docs and configuration of optional argument can be eventually removed implying a breaking change. To be removed in https://jira.mongodb.org/browse/CLOUDP-293142
77+
Computed: true,
8078
},
8179
}
8280
}

internal/service/cloudbackupsnapshotexportbucket/resource_cloud_backup_snapshot_export_bucket_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func basicAzureTestCase(t *testing.T) *resource.TestCase {
9191
"project_id": projectID,
9292
"bucket_name": bucketName,
9393
"service_url": serviceURL,
94+
"tenant_id": tenantID,
9495
"cloud_provider": "AZURE",
9596
}
9697
pluralAttrMapCheck = map[string]string{
@@ -99,6 +100,7 @@ func basicAzureTestCase(t *testing.T) *resource.TestCase {
99100
"results.0.bucket_name": bucketName,
100101
"results.0.service_url": serviceURL,
101102
"results.0.cloud_provider": "AZURE",
103+
"results.0.tenant_id": tenantID,
102104
}
103105
attrsSet = []string{
104106
"role_id",

0 commit comments

Comments
 (0)