Skip to content

Commit 4f0b9a2

Browse files
committed
merge upstream
1 parent 9e88aa0 commit 4f0b9a2

20 files changed

+532
-45
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
## 1.40.3 (Unreleased)
1+
## 1.40.4 (Unreleased)
22

33
FEATURES:
44

55
* **New Data Source**: `tencentcloud_vpc_acls`
66
* **New Resource**: `tencentcloud_vpc_acl`
77
* **New Resource**: `tencentcloud_vpc_acl_attachment`
88

9+
## 1.40.3 (August 11, 2020)
10+
11+
ENHANCEMENTS:
12+
13+
* Data Source: `tencentcloud_kubernetes_clusters`add new attributes `cluster_as_enabled`,`node_name_type`,`cluster_extra_args`,`network_type`,`is_non_static_ip_mode`,`kube_proxy_mode`,`service_cidr`,`eni_subnet_ids`,`claim_expired_seconds` and `deletion_protection`.
14+
15+
BUG FIXES:
16+
17+
* Resource: `tencentcloud_vpn_gateway` fix creation of instance when `vpc_id` is specified.
18+
* Resource: `tencentcloud_vpn_connection` fix creation of instance when `vpc_id` is specified.
19+
* Resource: `tencentcloud_instance` fix `internet_charge_type` inconsistency when public ip is not allocated.
20+
921
## 1.40.2 (August 08, 2020)
1022

1123
BUG FIXES:

examples/tencentcloud-tke/main.tf

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,59 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
4141
}
4242
}
4343

44+
#examples for MANAGED_CLUSTER VPC-CNI network type cluster with customized master params
45+
resource "tencentcloud_kubernetes_cluster" "managed_vpc_cni_cluster" {
46+
cluster_version = "1.14.3"
47+
vpc_id = var.vpc
48+
cluster_max_pod_num = 32
49+
cluster_name = "testvpccni"
50+
cluster_desc = "test vpc-cni cluster desc"
51+
cluster_max_service_num = 32
52+
service_cidr = "192.168.128.0/24"
53+
eni_subnet_ids = ["subnet-hmmlszs7", "subnet-4o0v4e7j"]
54+
claim_expired_seconds = 300
55+
network_type = "VPC-CNI"
56+
is_non_static_ip_mode = true
57+
cluster_extra_args {
58+
kube_apiserver = ["max-requests-inflight=450"]
59+
kube_controller_manager = ["kube-api-burst=500", "kube-api-qps=200"]
60+
kube_scheduler = ["kube-api-burst=500", "kube-api-qps=200"]
61+
}
62+
63+
worker_config {
64+
count = 2
65+
availability_zone = var.availability_zone
66+
instance_type = var.default_instance_type
67+
system_disk_type = "CLOUD_SSD"
68+
system_disk_size = 60
69+
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
70+
internet_max_bandwidth_out = 100
71+
public_ip_assigned = true
72+
subnet_id = var.subnet
73+
74+
data_disk {
75+
disk_type = "CLOUD_PREMIUM"
76+
disk_size = 50
77+
}
78+
79+
enhanced_security_service = false
80+
enhanced_monitor_service = false
81+
user_data = "dGVzdA=="
82+
password = "ZZXXccvv1212"
83+
}
84+
85+
cluster_deploy_type = "MANAGED_CLUSTER"
86+
87+
tags = {
88+
"test" = "test"
89+
}
90+
91+
labels = {
92+
"test1" = "test1",
93+
"test2" = "test2",
94+
}
95+
}
96+
4497
#examples for INDEPENDENT_CLUSTER cluster
4598
resource "tencentcloud_kubernetes_cluster" "independing_cluster" {
4699
vpc_id = var.vpc

examples/tencentcloud-vpc/main.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@ data "tencentcloud_vpc_instances" "tags_instances" {
1111
name = tencentcloud_vpc.main.name
1212
tags = tencentcloud_vpc.main.tags
1313
}
14+
15+
data "tencentcloud_vpc_instances" "default" {}
16+
17+
resource "tencentcloud_vpc_acl" "foo" {
18+
vpc_id = data.tencentcloud_vpc_instances.default.instance_list.0.vpc_id
19+
name = "test_acl_update"
20+
ingress = ["ACCEPT#192.168.1.0/24#800#TCP", "ACCEPT#192.168.1.0/24#800-900#TCP",]
21+
egress = ["ACCEPT#192.168.1.0/24#800#TCP", "ACCEPT#192.168.1.0/24#800-900#TCP",]
22+
}
23+
24+
resource "tencentcloud_vpc_acl_attachment" "attachment" {
25+
acl_id = tencentcloud_vpc_acl.foo.id
26+
subnet_ids = data.tencentcloud_vpc_instances.default.instance_list[0].subnet_ids
27+
}
28+
29+
data "tencentcloud_vpc_acls" "foo" {
30+
name = "test_acl"
31+
}

examples/tencentcloud-vpn/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ data "tencentcloud_vpn_connections" "example" {
6868
# vpn tunnel in the usual way.
6969
resource tencentcloud_vpn_gateway ccn_vpngw_example {
7070
name = "ccn-vpngw-example"
71-
vpc_id = ""
7271
bandwidth = 5
7372
zone = var.availability_zone
7473
type = "CCN"

tencentcloud/data_source_tc_kubernetes_clusters.go

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,79 @@ func tkeClusterInfo() map[string]*schema.Schema {
9292
Computed: true,
9393
Description: "The maximum number of services in the cluster.",
9494
},
95+
"cluster_as_enabled": {
96+
Type: schema.TypeBool,
97+
Computed: true,
98+
Description: "Indicates whether to enable cluster node auto scaler.",
99+
},
100+
"node_name_type": {
101+
Type: schema.TypeString,
102+
Computed: true,
103+
Description: "Node name type of Cluster.",
104+
},
105+
"cluster_extra_args": {
106+
Type: schema.TypeList,
107+
Computed: true,
108+
Elem: &schema.Resource{
109+
Schema: map[string]*schema.Schema{
110+
"kube_apiserver": {
111+
Type: schema.TypeList,
112+
Computed: true,
113+
Elem: &schema.Schema{Type: schema.TypeString},
114+
Description: "The customized parameters for kube-apiserver.",
115+
},
116+
"kube_controller_manager": {
117+
Type: schema.TypeList,
118+
Computed: true,
119+
Elem: &schema.Schema{Type: schema.TypeString},
120+
Description: "The customized parameters for kube-controller-manager.",
121+
},
122+
"kube_scheduler": {
123+
Type: schema.TypeList,
124+
Computed: true,
125+
Elem: &schema.Schema{Type: schema.TypeString},
126+
Description: "The customized parameters for kube-scheduler.",
127+
},
128+
},
129+
},
130+
Description: "Customized parameters for master component.",
131+
},
132+
"network_type": {
133+
Type: schema.TypeString,
134+
Computed: true,
135+
Description: "Cluster network type.",
136+
},
137+
"is_non_static_ip_mode": {
138+
Type: schema.TypeBool,
139+
Computed: true,
140+
Description: "Indicates whether static ip mode is enabled.",
141+
},
142+
"kube_proxy_mode": {
143+
Type: schema.TypeString,
144+
Computed: true,
145+
Description: "Cluster kube-proxy mode.",
146+
},
147+
"service_cidr": {
148+
Type: schema.TypeString,
149+
Computed: true,
150+
Description: "The network address block of the cluster.",
151+
},
152+
"eni_subnet_ids": {
153+
Type: schema.TypeList,
154+
Computed: true,
155+
Elem: &schema.Schema{Type: schema.TypeString},
156+
Description: "Subnet Ids for cluster with VPC-CNI network mode.",
157+
},
158+
"claim_expired_seconds": {
159+
Type: schema.TypeInt,
160+
Computed: true,
161+
Description: "The expired seconds to recycle ENI.",
162+
},
163+
"deletion_protection": {
164+
Type: schema.TypeBool,
165+
Computed: true,
166+
Description: "Indicates whether cluster deletion protection is enabled.",
167+
},
95168
"cluster_node_num": {
96169
Type: schema.TypeInt,
97170
Computed: true,
@@ -225,12 +298,27 @@ LOOP:
225298
infoMap["cluster_deploy_type"] = info.DeployType
226299
infoMap["cluster_version"] = info.ClusterVersion
227300
infoMap["cluster_ipvs"] = info.Ipvs
301+
infoMap["cluster_as_enabled"] = info.AsEnabled
302+
infoMap["node_name_type"] = info.NodeNameType
303+
304+
infoMap["cluster_extra_args"] = []map[string]interface{}{{
305+
"kube_apiserver": info.ExtraArgs.KubeAPIServer,
306+
"kube_controller_manager": info.ExtraArgs.KubeControllerManager,
307+
"kube_scheduler": info.ExtraArgs.KubeScheduler,
308+
}}
309+
infoMap["network_type"] = info.NetworkType
310+
infoMap["is_non_static_ip_mode"] = info.IsNonStaticIpMode
311+
infoMap["deletion_protection"] = info.DeletionProtection
312+
infoMap["kube_proxy_mode"] = info.KubeProxyMode
228313
infoMap["vpc_id"] = info.VpcId
229314
infoMap["project_id"] = info.ProjectId
230315
infoMap["cluster_cidr"] = info.ClusterCidr
231316
infoMap["ignore_cluster_cidr_conflict"] = info.IgnoreClusterCidrConflict
232-
infoMap["cluster_max_pod_num"] = info.MaxClusterServiceNum
317+
infoMap["cluster_max_pod_num"] = info.MaxNodePodNum
233318
infoMap["cluster_max_service_num"] = info.MaxClusterServiceNum
319+
infoMap["service_cidr"] = info.ServiceCIDR
320+
infoMap["eni_subnet_ids"] = info.EniSubnetIds
321+
infoMap["claim_expired_seconds"] = info.ClaimExpiredSeconds
234322
infoMap["cluster_node_num"] = info.ClusterNodeNum
235323
infoMap["tags"] = info.Tags
236324

tencentcloud/data_source_tc_vpc_acls.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Example Usage
77
data "tencentcloud_vpc_instances" "foo" {
88
}
99
10-
resource "tencentcloud_vpc_acls" "main" {
10+
data "tencentcloud_vpc_acls" "foo" {
1111
vpc_id = data.tencentcloud_vpc_instances.foo.instance_list.0.vpc_id
1212
}
1313
14-
resource "tencentcloud_vpc_acls" "main" {
14+
data "tencentcloud_vpc_acls" "foo" {
1515
name = "test_acl"
1616
}
1717

tencentcloud/data_source_tc_vpc_acls_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@ resource "tencentcloud_vpc_acl" "foo" {
3939
4040
data "tencentcloud_vpc_acls" "default" {
4141
name = "test_acl"
42-
result_output_file="data_source_tc_vpc_acls.txt"
4342
}
4443
`

tencentcloud/extension_tke.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,23 @@ const (
6161
TkeInternetStatusDeletedFailed = "DeletedFailed"
6262
TkeInternetStatusNotfound = "NotFound"
6363
)
64+
65+
const (
66+
TKE_CLUSTER_NETWORK_TYPE_GR = "GR"
67+
TKE_CLUSTER_NETWORK_TYPE_VPC_CNI = "VPC-CNI"
68+
)
69+
70+
var TKE_CLUSTER_NETWORK_TYPE = []string{TKE_CLUSTER_NETWORK_TYPE_GR, TKE_CLUSTER_NETWORK_TYPE_VPC_CNI}
71+
72+
const (
73+
TKE_CLUSTER_NODE_NAME_TYPE_LAN_IP = "lan-ip"
74+
TKE_CLUSTER_NODE_NAME_TYPE_HOSTNAME = "hostname"
75+
)
76+
77+
var TKE_CLUSTER_NODE_NAME_TYPE = []string{TKE_CLUSTER_NODE_NAME_TYPE_LAN_IP, TKE_CLUSTER_NODE_NAME_TYPE_HOSTNAME}
78+
79+
const (
80+
TKE_CLUSTER_KUBE_PROXY_MODE_BPF = "kube-proxy-bpf"
81+
)
82+
83+
var TKE_CLUSTER_KUBE_PROXY_MODE = []string{TKE_CLUSTER_KUBE_PROXY_MODE_BPF}

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,

0 commit comments

Comments
 (0)