From ec5072fd48988e190c3bae0e4c27140c3375f73b Mon Sep 17 00:00:00 2001 From: tongyiming <1290863722@qq.com> Date: Wed, 18 Dec 2024 22:10:09 +0800 Subject: [PATCH] fix(mongodb): [121272265] remove RequiredWith on availability_zone_list and hidden_zone (#3025) * remove RequiredWith on availability_zone_list and hidden_zone * add changelog --------- Co-authored-by: mikatong --- .changelog/3025.txt | 7 +++++++ .../services/mongodb/resource_tc_mongodb_instance.go | 10 ++++------ .../mongodb/resource_tc_mongodb_sharding_instance.go | 10 ++++------ website/docs/r/mongodb_instance.html.markdown | 2 +- website/docs/r/mongodb_sharding_instance.html.markdown | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 .changelog/3025.txt diff --git a/.changelog/3025.txt b/.changelog/3025.txt new file mode 100644 index 0000000000..8bd0e399a3 --- /dev/null +++ b/.changelog/3025.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/tencentcloud_mongodb_instance: remove RequiredWith on `availability_zone_list` and `hidden_zone` +``` + +```release-note:enhancement +resource/tencentcloud_mongodb_sharding_instance: remove RequiredWith on `availability_zone_list` and `hidden_zone` +``` \ No newline at end of file diff --git a/tencentcloud/services/mongodb/resource_tc_mongodb_instance.go b/tencentcloud/services/mongodb/resource_tc_mongodb_instance.go index 8711779d43..f81b832f86 100644 --- a/tencentcloud/services/mongodb/resource_tc_mongodb_instance.go +++ b/tencentcloud/services/mongodb/resource_tc_mongodb_instance.go @@ -109,7 +109,6 @@ func ResourceTencentCloudMongodbInstance() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, - RequiredWith: []string{"hidden_zone"}, Description: `A list of nodes deployed in multiple availability zones. For more information, please use the API DescribeSpecInfo. - Multi-availability zone deployment nodes can only be deployed in 3 different availability zones. It is not supported to deploy most nodes of the cluster in the same availability zone. For example, a 3-node cluster does not support the deployment of 2 nodes in the same zone. - Version 4.2 and above are not supported. @@ -117,11 +116,10 @@ func ResourceTencentCloudMongodbInstance() *schema.Resource { - Basic network cannot be selected.`, }, "hidden_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - RequiredWith: []string{"availability_zone_list"}, - Description: "The availability zone to which the Hidden node belongs. This parameter must be configured to deploy instances across availability zones.", + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The availability zone to which the Hidden node belongs. This parameter is required in cross-AZ instance deployment.", }, "maintenance_start": { Type: schema.TypeString, diff --git a/tencentcloud/services/mongodb/resource_tc_mongodb_sharding_instance.go b/tencentcloud/services/mongodb/resource_tc_mongodb_sharding_instance.go index 869e731b63..7ae88cd452 100644 --- a/tencentcloud/services/mongodb/resource_tc_mongodb_sharding_instance.go +++ b/tencentcloud/services/mongodb/resource_tc_mongodb_sharding_instance.go @@ -42,7 +42,6 @@ func ResourceTencentCloudMongodbShardingInstance() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, - RequiredWith: []string{"hidden_zone"}, Description: `A list of nodes deployed in multiple availability zones. For more information, please use the API DescribeSpecInfo. - Multi-availability zone deployment nodes can only be deployed in 3 different availability zones. It is not supported to deploy most nodes of the cluster in the same availability zone. For example, a 3-node cluster does not support the deployment of 2 nodes in the same zone. - Version 4.2 and above are not supported. @@ -50,11 +49,10 @@ func ResourceTencentCloudMongodbShardingInstance() *schema.Resource { - Basic network cannot be selected.`, }, "hidden_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - RequiredWith: []string{"availability_zone_list"}, - Description: "The availability zone to which the Hidden node belongs. This parameter must be configured to deploy instances across availability zones.", + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "The availability zone to which the Hidden node belongs. This parameter is required in cross-AZ instance deployment.", }, } basic := TencentMongodbBasicInfo() diff --git a/website/docs/r/mongodb_instance.html.markdown b/website/docs/r/mongodb_instance.html.markdown index 91a9d7d75b..f1ea1e64b2 100644 --- a/website/docs/r/mongodb_instance.html.markdown +++ b/website/docs/r/mongodb_instance.html.markdown @@ -46,7 +46,7 @@ The following arguments are supported: - Read-only disaster recovery instances are not supported. - Basic network cannot be selected. * `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. Default value is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. Caution that update operation on this field will delete old instances and create new one with new charge type. -* `hidden_zone` - (Optional, String) The availability zone to which the Hidden node belongs. This parameter must be configured to deploy instances across availability zones. +* `hidden_zone` - (Optional, String) The availability zone to which the Hidden node belongs. This parameter is required in cross-AZ instance deployment. * `maintenance_end` - (Optional, String) Maintenance window end time. - The value range is any full point or half point from `00:00-23:00`, and the maintenance time duration is at least 30 minutes and at most 3 hours. - The end time must be based on the start time backwards. diff --git a/website/docs/r/mongodb_sharding_instance.html.markdown b/website/docs/r/mongodb_sharding_instance.html.markdown index 91532ec882..131b58d2c6 100644 --- a/website/docs/r/mongodb_sharding_instance.html.markdown +++ b/website/docs/r/mongodb_sharding_instance.html.markdown @@ -52,7 +52,7 @@ The following arguments are supported: - Read-only disaster recovery instances are not supported. - Basic network cannot be selected. * `charge_type` - (Optional, String, ForceNew) The charge type of instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. Default value is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. Caution that update operation on this field will delete old instances and create new one with new charge type. -* `hidden_zone` - (Optional, String) The availability zone to which the Hidden node belongs. This parameter must be configured to deploy instances across availability zones. +* `hidden_zone` - (Optional, String) The availability zone to which the Hidden node belongs. This parameter is required in cross-AZ instance deployment. * `mongos_cpu` - (Optional, Int) Number of mongos cpu. * `mongos_memory` - (Optional, Int) Mongos memory size in GB. * `mongos_node_num` - (Optional, Int) Number of mongos.