Skip to content

Commit 5b00e98

Browse files
authored
Merge branch 'master' into master
2 parents dcf8755 + db03453 commit 5b00e98

20 files changed

+805
-27
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22

33
FEATURES:
44

5+
* **New Resource**: `tencentcloud_image`
56
* **New Resource**: `tencentcloud_audit`
67
* **New Data Source**: `tencentcloud_audits`
78
* **New Data Source**: `tencentcloud_audit_cos_regions`
89
* **New Data Source**: `tencentcloud_audit_key_alias`
910

11+
ENHANCEMENTS:
12+
13+
* Resource: `tencentcloud_instance` add new argument `data_disk_snapshot_id` to support data disk with `SnapshotId`([#469](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/issues/469))
14+
* Data Source: `tencentcloud_instances` support filter by tags.
15+
16+
## 1.42.2 (September 14, 2020)
17+
18+
BUG FIXES:
19+
* Resource: `tencentcloud_instance` fix `key_name` update error([#515](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/issues/515)).
20+
1021
## 1.42.1 (September 10, 2020)
1122

1223
BUG FIXES:
24+
1325
* Resource: `tencentcloud_mongodb_instance` Fix the error of releasing associated resources when destroying mongodb postpaid instance.
1426
* Resource: `tencentcloud_mongodb_sharding_instance` Fix the error of releasing associated resources when destroying mongodb postpaid sharding instance.
1527
* Resource: `tencentcloud_mongodb_standby_instance` Fix the error of releasing associated resources when destroying mongodb postpaid standby instance.

examples/tencentcloud-image/main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
provider "tencentcloud" {
2+
region = "ap-guangzhou"
3+
}
4+
5+
resource "tencentcloud_image" "image_instance" {
6+
image_name = var.image_imstance_name
7+
instance_id = "ins-2ju245xg"
8+
data_disk_ids = ["disk-gii0vtwi"]
9+
force_poweroff = true
10+
sysprep = false
11+
image_description = "create image with instance"
12+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "image_imstance_name" {
2+
default = "image-instance-keep"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
terraform {
2+
required_version = ">= 0.12"
3+
}

tencentcloud/data_source_tc_instances.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ func dataSourceTencentCloudInstances() *schema.Resource {
5858
Optional: true,
5959
Description: "ID of a vpc subnetwork.",
6060
},
61+
"tags": {
62+
Type: schema.TypeMap,
63+
Optional: true,
64+
Description: "Tags of the instance.",
65+
},
6166
"result_output_file": {
6267
Type: schema.TypeString,
6368
Optional: true,
@@ -260,6 +265,11 @@ func dataSourceTencentCloudInstancesRead(d *schema.ResourceData, meta interface{
260265
if v, ok := d.GetOk("subnet_id"); ok {
261266
filter["subnet-id"] = v.(string)
262267
}
268+
if v, ok := d.GetOk("tags"); ok {
269+
for key, value := range v.(map[string]interface{}) {
270+
filter["tag:"+key] = value.(string)
271+
}
272+
}
263273

264274
var instances []*cvm.Instance
265275
var errRet error

tencentcloud/extension_images.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package tencentcloud
2+
3+
const (
4+
TRUE = "true"
5+
FALSE = "false"
6+
)

tencentcloud/extension_vpc.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ package tencentcloud
77
const GATE_WAY_TYPE_CVM = "CVM"
88
const GATE_WAY_TYPE_VPN = "VPN"
99
const GATE_WAY_TYPE_DIRECTCONNECT = "DIRECTCONNECT"
10+
const GATE_WAY_TYPE_PEERCONNECTION = "PEERCONNECTION"
1011
const GATE_WAY_TYPE_SSLVPN = "SSLVPN"
1112
const GATE_WAY_TYPE_NAT = "NAT"
1213
const GATE_WAY_TYPE_NORMAL_CVM = "NORMAL_CVM"
1314
const GATE_WAY_TYPE_EIP = "EIP"
1415
const GATE_WAY_TYPE_CCN = "CCN"
1516

16-
var ALL_GATE_WAY_TYPES = []string{GATE_WAY_TYPE_CVM,
17+
var ALL_GATE_WAY_TYPES = []string{
18+
GATE_WAY_TYPE_CVM,
1719
GATE_WAY_TYPE_VPN,
1820
GATE_WAY_TYPE_DIRECTCONNECT,
21+
GATE_WAY_TYPE_PEERCONNECTION,
1922
GATE_WAY_TYPE_SSLVPN,
2023
GATE_WAY_TYPE_NAT,
2124
GATE_WAY_TYPE_NORMAL_CVM,

tencentcloud/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ CVM
209209
tencentcloud_key_pair
210210
tencentcloud_placement_group
211211
tencentcloud_reserved_instance
212+
tencentcloud_image
212213
213214
Direct Connect(DC)
214215
Data Source
@@ -774,6 +775,7 @@ func Provider() terraform.ResourceProvider {
774775
"tencentcloud_ckafka_acl": resourceTencentCloudCkafkaAcl(),
775776
"tencentcloud_ckafka_topic": resourceTencentCloudCkafkaTopic(),
776777
"tencentcloud_audit": resourceTencentCloudAudit(),
778+
"tencentcloud_image": resourceTencentCloudImage(),
777779
},
778780

779781
ConfigureFunc: providerConfigure,

tencentcloud/resource_tc_cbs_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Example Usage
77
resource "tencentcloud_cbs_storage" "storage" {
88
storage_name = "mystorage"
99
storage_type = "CLOUD_SSD"
10-
storage_size = "50"
10+
storage_size = 100
1111
availability_zone = "ap-guangzhou-3"
1212
project_id = 0
1313
encrypt = false

0 commit comments

Comments
 (0)