Skip to content

Commit 37cd720

Browse files
authored
instances set check count (#1131)
1 parent def70da commit 37cd720

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

tencentcloud/resource_tc_cbs_storage_set.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func resourceTencentCloudCbsStorageSet() *schema.Resource {
5656
"disk_count": {
5757
Type: schema.TypeInt,
5858
Optional: true,
59+
ForceNew: true,
5960
Description: "The number of disks to be purchased. Default 1.",
6061
},
6162
"charge_type": {
@@ -188,7 +189,7 @@ func resourceTencentCloudCbsStorageSetCreate(d *schema.ResourceData, meta interf
188189
return err
189190
}
190191

191-
d.Set("disk_ids", storageIds)
192+
_ = d.Set("disk_ids", storageIds)
192193
d.SetId(helper.StrListToStr(storageIds))
193194

194195
return nil
@@ -220,6 +221,7 @@ func resourceTencentCloudCbsStorageSetRead(d *schema.ResourceData, meta interfac
220221

221222
storage := storageSet[0]
222223

224+
_ = d.Set("disk_count", len(storageSet))
223225
_ = d.Set("storage_type", storage.DiskType)
224226
_ = d.Set("storage_size", storage.DiskSize)
225227
_ = d.Set("availability_zone", storage.Placement.Zone)

tencentcloud/resource_tc_instance_set.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func resourceTencentCloudInstanceSet() *schema.Resource {
110110
"instance_count": {
111111
Type: schema.TypeInt,
112112
Optional: true,
113+
ForceNew: true,
113114
Description: "The number of instances to be purchased. Value range:[1,100]; default value: 1.",
114115
},
115116
"instance_name": {
@@ -578,6 +579,7 @@ func doResourceTencentCloudInstanceSetRead(d *schema.ResourceData, meta interfac
578579

579580
instance := instanceSet[0]
580581

582+
_ = d.Set("instance_count", len(instanceSet))
581583
_ = d.Set("image_id", instance.ImageId)
582584
_ = d.Set("availability_zone", instance.Placement.Zone)
583585
_ = d.Set("instance_name", d.Get("instance_name"))

website/docs/r/cbs_storage_set.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following arguments are supported:
3434
* `storage_size` - (Required) Volume of CBS, and unit is GB. If storage type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].
3535
* `storage_type` - (Required, ForceNew) Type of CBS medium. Valid values: CLOUD_PREMIUM, CLOUD_SSD, CLOUD_TSSD and CLOUD_HSSD.
3636
* `charge_type` - (Optional) The charge type of CBS instance. Only support `POSTPAID_BY_HOUR`.
37-
* `disk_count` - (Optional) The number of disks to be purchased. Default 1.
37+
* `disk_count` - (Optional, ForceNew) The number of disks to be purchased. Default 1.
3838
* `encrypt` - (Optional, ForceNew) Indicates whether CBS is encrypted.
3939
* `project_id` - (Optional) ID of the project to which the instance belongs.
4040
* `snapshot_id` - (Optional) ID of the snapshot. If specified, created the CBS by this snapshot.

website/docs/r/instance_set.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The following arguments are supported:
8686
* `disable_security_service` - (Optional) Disable enhance service for security, it is enabled by default. When this options is set, security agent won't be installed. Modifying will cause the instance reset.
8787
* `hostname` - (Optional) The hostname of the instance. Windows instance: The name should be a combination of 2 to 15 characters comprised of letters (case insensitive), numbers, and hyphens (-). Period (.) is not supported, and the name cannot be a string of pure numbers. Other types (such as Linux) of instances: The name should be a combination of 2 to 60 characters, supporting multiple periods (.). The piece between two periods is composed of letters (case insensitive), numbers, and hyphens (-). Modifying will cause the instance reset.
8888
* `instance_charge_type` - (Optional) The charge type of instance. Only support `POSTPAID_BY_HOUR`.
89-
* `instance_count` - (Optional) The number of instances to be purchased. Value range:[1,100]; default value: 1.
89+
* `instance_count` - (Optional, ForceNew) The number of instances to be purchased. Value range:[1,100]; default value: 1.
9090
* `instance_name` - (Optional) The name of the instance. The max length of instance_name is 60, and default value is `Terraform-CVM-Instance`.
9191
* `instance_type` - (Optional) The type of the instance.
9292
* `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.

0 commit comments

Comments
 (0)