Skip to content

Commit d455e48

Browse files
authored
Merge pull request #492 from oliverpei/master
fix cvm internet_charge_type inconsistency
2 parents 12f87c5 + 0746e55 commit d455e48

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ BUG FIXES:
88

99
* Resource: `tencentcloud_vpn_gateway` fix creation of instance when `vpc_id` is specified.
1010
* Resource: `tencentcloud_vpn_connection` fix creation of instance when `vpc_id` is specified.
11+
* Resource: `tencentcloud_instance` fix `internet_charge_type` inconsistency when public ip is not allocated.
1112

1213
## 1.40.2 (August 08, 2020)
1314

tencentcloud/resource_tc_instance.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,17 @@ func resourceTencentCloudInstance() *schema.Resource {
191191
"internet_charge_type": {
192192
Type: schema.TypeString,
193193
Optional: true,
194-
Default: CVM_INTERNET_CHARGE_TYPE_TRAFFIC_POSTPAID,
194+
Computed: true,
195195
ForceNew: true,
196196
ValidateFunc: validateAllowedStringValue(CVM_INTERNET_CHARGE_TYPE),
197-
Description: "Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. The default is `TRAFFIC_POSTPAID_BY_HOUR`.",
197+
Description: "Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. This value does not need to be set when `allocate_public_ip` is false.",
198198
},
199199
"internet_max_bandwidth_out": {
200200
Type: schema.TypeInt,
201201
Optional: true,
202-
Default: 0,
202+
Computed: true,
203203
ForceNew: true,
204-
Description: "Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). If this value is not specified, then automatically sets it to 0 Mbps.",
204+
Description: "Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). This value does not need to be set when `allocate_public_ip` is false.",
205205
},
206206
"allocate_public_ip": {
207207
Type: schema.TypeBool,

website/docs/r/instance.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ The following arguments are supported:
9191
* `instance_charge_type` - (Optional, ForceNew) The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR` and `SPOTPAID`, The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time.
9292
* `instance_name` - (Optional) The name of the CVM. The max length of instance_name is 60, and default value is `Terraform-CVM-Instance`.
9393
* `instance_type` - (Optional) The type of instance to start.
94-
* `internet_charge_type` - (Optional, ForceNew) Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. The default is `TRAFFIC_POSTPAID_BY_HOUR`.
95-
* `internet_max_bandwidth_out` - (Optional, ForceNew) Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). If this value is not specified, then automatically sets it to 0 Mbps.
94+
* `internet_charge_type` - (Optional, ForceNew) Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. This value does not need to be set when `allocate_public_ip` is false.
95+
* `internet_max_bandwidth_out` - (Optional, ForceNew) Maximum outgoing bandwidth to the public network, measured in Mbps (Mega bit per second). This value does not need to be set when `allocate_public_ip` is false.
9696
* `key_name` - (Optional) The key pair to use for the instance, it looks like skey-16jig7tx.
9797
* `password` - (Optional) Password to an instance. In order to take effect new password, the instance will be restarted after modifying the password.
9898
* `placement_group_id` - (Optional, ForceNew) The id of a placement group.

0 commit comments

Comments
 (0)