Skip to content

Commit b9a28dd

Browse files
committed
Make "disk_size" required (it is) and move documentation to the right place
1 parent c8c982b commit b9a28dd

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

.web-docs/components/builder/cvm/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ a [communicator](/packer/docs/templates/legacy_json_templates/communicator) can
133133
disk settings, in such case, `disk_type` argument will be used as disk
134134
type for all data disks, and each data disk size will use the origin
135135
value in source image.
136-
The data disks allow for the following argument:
137-
- `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`.
138-
- `disk_size` - Size of the data disk.
139-
- `disk_snapshot_id` - Id of the snapshot for a data disk.
140136

141137
- `vpc_id` (string) - Specify vpc your cvm will be launched by.
142138

builder/tencentcloud/cvm/run_config.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ import (
1919
)
2020

2121
type TencentCloudDataDisk struct {
22-
DiskType string `mapstructure:"disk_type"`
23-
DiskSize int64 `mapstructure:"disk_size"`
22+
// The size of the data disk.
23+
DiskSize int64 `mapstructure:"disk_size" required:"true"`
24+
// The type of disk to use. See https://www.tencentcloud.com/document/api/213/15753#datadisk for valid values.
25+
DiskType string `mapstructure:"disk_type"`
26+
// The snapshot to use for the data disk.
2427
SnapshotId string `mapstructure:"disk_snapshot_id"`
2528
}
2629

@@ -56,10 +59,6 @@ type TencentCloudRunConfig struct {
5659
// disk settings, in such case, `disk_type` argument will be used as disk
5760
// type for all data disks, and each data disk size will use the origin
5861
// value in source image.
59-
// The data disks allow for the following argument:
60-
// - `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`.
61-
// - `disk_size` - Size of the data disk.
62-
// - `disk_snapshot_id` - Id of the snapshot for a data disk.
6362
DataDisks []TencentCloudDataDisk `mapstructure:"data_disks"`
6463
// Specify vpc your cvm will be launched by.
6564
VpcId string `mapstructure:"vpc_id" required:"false"`

builder/tencentcloud/cvm/run_config.hcl2spec.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- Code generated from the comments of the TencentCloudDataDisk struct in builder/tencentcloud/cvm/run_config.go; DO NOT EDIT MANUALLY -->
2+
3+
- `disk_size` (int64) - The size of the data disk.
4+
5+
<!-- End of code generated from the comments of the TencentCloudDataDisk struct in builder/tencentcloud/cvm/run_config.go; -->

docs-partials/builder/tencentcloud/cvm/TencentCloudRunConfig-not-required.mdx

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
disk settings, in such case, `disk_type` argument will be used as disk
2828
type for all data disks, and each data disk size will use the origin
2929
value in source image.
30-
The data disks allow for the following argument:
31-
- `disk_type` - Type of the data disk. Valid choices: `CLOUD_BASIC`, `CLOUD_PREMIUM` and `CLOUD_SSD`.
32-
- `disk_size` - Size of the data disk.
33-
- `disk_snapshot_id` - Id of the snapshot for a data disk.
3430

3531
- `vpc_id` (string) - Specify vpc your cvm will be launched by.
3632

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<!-- Code generated from the comments of the TencentCloudDataDisk struct in builder/tencentcloud/cvm/run_config.go; DO NOT EDIT MANUALLY -->
22

3-
- `disk_type` (string) - Disk Type
3+
- `disk_type` (string) - The type of disk to use. See https://www.tencentcloud.com/document/api/213/15753#datadisk for valid values.
44

5-
- `disk_size` (int64) - Disk Size
6-
7-
- `disk_snapshot_id` (string) - Snapshot Id
5+
- `disk_snapshot_id` (string) - The snapshot to use for the data disk.
86

97
<!-- End of code generated from the comments of the TencentCloudDataDisk struct in builder/tencentcloud/cvm/run_config.go; -->

0 commit comments

Comments
 (0)