Skip to content

Commit bfc6058

Browse files
committed
add
1 parent 2e64396 commit bfc6058

10 files changed

+271
-33
lines changed

website/docs/d/eips.html.markdown

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,46 @@ Use this data source to query eip instances.
1313

1414
## Example Usage
1515

16+
### Query all eip instances
17+
18+
```hcl
19+
data "tencentcloud_eips" "example" {}
20+
```
21+
22+
### Query eip instances by eip ID
23+
1624
```hcl
17-
data "tencentcloud_eips" "foo" {
25+
data "tencentcloud_eips" "example" {
1826
eip_id = "eip-ry9h95hg"
1927
}
2028
```
2129

30+
### Query eip instances by eip name
31+
32+
```hcl
33+
data "tencentcloud_eips" "example" {
34+
eip_name = "tf-example"
35+
}
36+
```
37+
38+
### Query eip instances by public ip
39+
40+
```hcl
41+
data "tencentcloud_eips" "example" {
42+
public_ip = "1.12.62.3"
43+
}
44+
```
45+
46+
### Query eip instances by tags
47+
48+
```hcl
49+
data "tencentcloud_eips" "example" {
50+
tags = {
51+
"test" = "test"
52+
}
53+
}
54+
```
55+
2256
## Argument Reference
2357

2458
The following arguments are supported:

website/docs/d/image.html.markdown

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,46 @@ description: |-
1111

1212
Provides an available image for the user.
1313

14-
The Images data source fetch proper image, which could be one of the private images of the user and images of system resources provided by TencentCloud, as well as other public images and those available on the image market.
14+
The Images data source fetch proper image, which could be one of the private images of the user and images of system
15+
resources provided by TencentCloud, as well as other public images and those available on the image market.
1516

1617
~> **NOTE:** This data source will be deprecated, please use `tencentcloud_images` instead.
1718

1819
## Example Usage
1920

21+
### Query image
22+
2023
```hcl
21-
data "tencentcloud_image" "my_favorate_image" {
22-
os_name = "centos"
24+
data "tencentcloud_image" "example" {}
25+
```
26+
27+
### Query image by filter
2328

29+
```hcl
30+
data "tencentcloud_image" "example" {
2431
filter {
2532
name = "image-type"
2633
values = ["PUBLIC_IMAGE"]
2734
}
2835
}
2936
```
3037

38+
### Query image by os name
39+
40+
```hcl
41+
data "tencentcloud_image" "example" {
42+
os_name = "centos"
43+
}
44+
```
45+
46+
### Query image by image name regex
47+
48+
```hcl
49+
data "tencentcloud_image" "example" {
50+
image_name_regex = "^Windows\\s.*$"
51+
}
52+
```
53+
3154
## Argument Reference
3255

3356
The following arguments are supported:

website/docs/d/images.html.markdown

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,49 @@ Use this data source to query images.
1313

1414
## Example Usage
1515

16+
### Query all images
17+
1618
```hcl
17-
data "tencentcloud_images" "foo" {
19+
data "tencentcloud_images" "example" {}
20+
```
21+
22+
### Query images by image ID
23+
24+
```hcl
25+
data "tencentcloud_images" "example" {
26+
image_id = "img-9qrfy1xt"
27+
}
28+
```
29+
30+
### Query images by os name
31+
32+
```hcl
33+
data "tencentcloud_images" "example" {
34+
os_name = "TencentOS Server 3.2 (Final)"
35+
}
36+
```
37+
38+
### Query images by image name regex
39+
40+
```hcl
41+
data "tencentcloud_images" "example" {
42+
image_name_regex = "^TencentOS"
43+
}
44+
```
45+
46+
### Query images by image type
47+
48+
```hcl
49+
data "tencentcloud_images" "example" {
1850
image_type = ["PUBLIC_IMAGE"]
19-
os_name = "centos 7.5"
51+
}
52+
```
53+
54+
### Query images by instance type
55+
56+
```hcl
57+
data "tencentcloud_images" "example" {
58+
instance_type = "S1.SMALL1"
2059
}
2160
```
2261

website/docs/d/instance_types.html.markdown

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,29 @@ Use this data source to query instances type.
1414
## Example Usage
1515

1616
```hcl
17-
data "tencentcloud_instance_types" "foo" {
18-
availability_zone = "ap-guangzhou-2"
19-
cpu_core_count = 2
20-
memory_size = 4
17+
data "tencentcloud_instance_types" "example" {
18+
availability_zone = "ap-guangzhou-6"
19+
cpu_core_count = 4
20+
memory_size = 8
2121
}
22+
```
23+
24+
### Complete Example
2225

23-
data tencentcloud_instance_types "t1c1g" {
24-
cpu_core_count = 1
25-
memory_size = 1
26+
```hcl
27+
data "tencentcloud_instance_types" "example" {
28+
cpu_core_count = 4
29+
memory_size = 8
2630
exclude_sold_out = true
31+
2732
filter {
28-
name = "instance-charge-type"
29-
values = ["POSTPAID_BY_HOUR"]
33+
name = "instance-family"
34+
values = ["SA2"]
3035
}
36+
3137
filter {
3238
name = "zone"
33-
values = ["ap-shanghai-2"]
39+
values = ["ap-guangzhou-6"]
3440
}
3541
}
3642
```

website/docs/d/instances.html.markdown

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,34 @@ Use this data source to query cvm instances.
1313

1414
## Example Usage
1515

16+
### Query all cvm instances
17+
18+
```hcl
19+
data "tencentcloud_instances" "example" {}
20+
```
21+
22+
### Query cvm instances by filters
23+
24+
```hcl
25+
data "tencentcloud_instances" "example" {
26+
instance_id = "ins-a81rnm8c"
27+
instance_name = "tf_example"
28+
availability_zone = "ap-guangzhou-6"
29+
project_id = 0
30+
vpc_id = "vpc-l040hycv"
31+
subnet_id = "subnet-1to7t9au"
32+
33+
tags = {
34+
tagKey = "tagValue"
35+
}
36+
}
37+
```
38+
39+
### Or by instance set id list
40+
1641
```hcl
17-
data "tencentcloud_instances" "foo" {
18-
instance_id = "ins-da412f5a"
42+
data "tencentcloud_instances" "example" {
43+
instance_set_ids = ["ins-a81rnm8c"]
1944
}
2045
```
2146

website/docs/d/instances_set.html.markdown

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ Use this data source to query cvm instances in parallel.
1414
## Example Usage
1515

1616
```hcl
17-
data "tencentcloud_instances_set" "foo" {
18-
vpc_id = "vpc-4owdpnwr"
17+
data "tencentcloud_instances_set" "example" {
18+
instance_id = "ins-a81rnm8c"
19+
instance_name = "tf_example"
20+
availability_zone = "ap-guangzhou-6"
21+
project_id = 0
22+
vpc_id = "vpc-l040hycv"
23+
subnet_id = "subnet-1to7t9au"
24+
25+
tags = {
26+
tagKey = "tagValue"
27+
}
1928
}
2029
```
2130

website/docs/d/key_pairs.html.markdown

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ Use this data source to query key pairs.
1313

1414
## Example Usage
1515

16+
### Query key pairs by key ID
17+
1618
```hcl
17-
data "tencentcloud_key_pairs" "foo" {
19+
data "tencentcloud_key_pairs" "key_id" {
1820
key_id = "skey-ie97i3ml"
1921
}
22+
```
2023

21-
data "tencentcloud_key_pairs" "name" {
24+
### Query key pairs by key name
25+
26+
```hcl
27+
data "tencentcloud_key_pairs" "key_name" {
2228
key_name = "^test$"
2329
}
2430
```

website/docs/d/placement_groups.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Use this data source to query placement groups.
1414
## Example Usage
1515

1616
```hcl
17-
data "tencentcloud_placement_groups" "foo" {
18-
placement_group_id = "ps-21q9ibvr"
19-
name = "test"
17+
data "tencentcloud_placement_groups" "example" {
18+
placement_group_id = "ps-bwvst92h"
19+
name = "tf_example"
2020
}
2121
```
2222

website/docs/r/cvm_renew_instance.html.markdown

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,58 @@ Provides a resource to create a cvm renew_instance
1414
## Example Usage
1515

1616
```hcl
17-
resource "tencentcloud_cvm_renew_instance" "renew_instance" {
18-
instance_id = "ins-f9jr4bd2"
17+
# create vpc
18+
resource "tencentcloud_vpc" "vpc" {
19+
name = "vpc"
20+
cidr_block = "10.0.0.0/16"
21+
}
22+
23+
# create vpc subnet
24+
resource "tencentcloud_subnet" "subnet" {
25+
name = "subnet"
26+
vpc_id = tencentcloud_vpc.vpc.id
27+
availability_zone = "ap-guangzhou-6"
28+
cidr_block = "10.0.20.0/28"
29+
is_multicast = false
30+
}
31+
32+
# create cvm
33+
resource "tencentcloud_instance" "example" {
34+
instance_name = "tf_example"
35+
availability_zone = "ap-guangzhou-6"
36+
image_id = "img-9qrfy1xt"
37+
instance_type = "SA3.MEDIUM4"
38+
system_disk_type = "CLOUD_HSSD"
39+
system_disk_size = 100
40+
hostname = "example"
41+
project_id = 0
42+
vpc_id = tencentcloud_vpc.vpc.id
43+
subnet_id = tencentcloud_subnet.subnet.id
44+
force_delete = true
45+
instance_charge_type = "PREPAID"
46+
instance_charge_type_prepaid_period = 1
47+
instance_charge_type_prepaid_renew_flag = "NOTIFY_AND_MANUAL_RENEW"
48+
49+
data_disks {
50+
data_disk_type = "CLOUD_HSSD"
51+
data_disk_size = 50
52+
encrypt = false
53+
}
54+
55+
tags = {
56+
tagKey = "tagValue"
57+
}
58+
}
59+
60+
# renew instance
61+
resource "tencentcloud_cvm_renew_instance" "example" {
62+
instance_id = tencentcloud_instance.example.id
63+
renew_portable_data_disk = true
64+
1965
instance_charge_prepaid {
2066
period = 1
21-
renew_flag = "NOTIFY_AND_AUTO_RENEW"
67+
renew_flag = "NOTIFY_AND_MANUAL_RENEW"
2268
}
23-
renew_portable_data_disk = true
2469
}
2570
```
2671

0 commit comments

Comments
 (0)