@@ -35,6 +35,7 @@ import (
3535
3636 "github.com/hashicorp/terraform-plugin-sdk/helper/resource"
3737 "github.com/hashicorp/terraform-plugin-sdk/helper/schema"
38+ sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
3839 cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
3940 "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
4041)
@@ -138,22 +139,22 @@ func resourceTencentCloudCdhInstance() *schema.Resource {
138139 "memory_total_size" : {
139140 Type : schema .TypeFloat ,
140141 Computed : true ,
141- Description : "Instance memory total capacity, unit in GiB ." ,
142+ Description : "Instance memory total capacity, unit in GB ." ,
142143 },
143144 "memory_available_size" : {
144145 Type : schema .TypeFloat ,
145146 Computed : true ,
146- Description : "Instance memory available capacity, unit in GiB ." ,
147+ Description : "Instance memory available capacity, unit in GB ." ,
147148 },
148149 "disk_total_size" : {
149150 Type : schema .TypeInt ,
150151 Computed : true ,
151- Description : "Instance disk total capacity, unit in GiB ." ,
152+ Description : "Instance disk total capacity, unit in GB ." ,
152153 },
153154 "disk_available_size" : {
154155 Type : schema .TypeInt ,
155156 Computed : true ,
156- Description : "Instance disk available capacity, unit in GiB ." ,
157+ Description : "Instance disk available capacity, unit in GB ." ,
157158 },
158159 "disk_type" : {
159160 Type : schema .TypeString ,
@@ -202,6 +203,9 @@ func resourceTencentCloudCdhInstanceCreate(d *schema.ResourceData, meta interfac
202203 outErr = resource .Retry (writeRetryTimeout , func () * resource.RetryError {
203204 hostId , inErr = cdhService .CreateCdhInstance (ctx , & placement , & hostChargePrepaid , chargeType , hostType )
204205 if inErr != nil {
206+ if sdkErr , ok := inErr .(* sdkErrors.TencentCloudSDKError ); ok && sdkErr .Code == CDH_ZONE_SOLD_OUT_FOR_SPECIFIED_INSTANCE_ERROR {
207+ return resource .NonRetryableError (inErr )
208+ }
205209 return retryError (inErr )
206210 }
207211 return nil
0 commit comments