@@ -20,42 +20,41 @@ func TestAccTencentCloudEKSCluster_basic(t *testing.T) {
2020 {
2121 Config : testAccEksCluster ,
2222 Check : resource .ComposeTestCheckFunc (
23- testAccTencentCloudEKSClusterExists ("resource_eks_cluster.foo" ),
24- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "cluster_name" , "tf-ci-test" ),
25- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "k8s_version" , "1.12.8" ),
26- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "cluster_desc" , "test eks cluster created by terraform" ),
27- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "dns_servers.#" , "1" ),
28- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "dns_servers.0.domain" , "example2.org" ),
29- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "dns_servers.0.servers.#" , "2" ),
30- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "dns_servers.0.servers.0" , "10.0.0.1:80" ),
31- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "dns_servers.0.servers.1" , "10.0.0.1:81" ),
32- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "enable_vpc_core_dns" , "true" ),
33- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "need_delete_cbs" , "true" ),
34- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "tags.hello" , "world" ),
35- resource .TestCheckResourceAttr ("resource_eks_cluster.foo" , "subnet_ids.#" , "1" ),
36- resource .TestCheckResourceAttrSet ("resource_eks_cluster.foo" , "subnet_ids.0" ),
37- resource .TestCheckResourceAttrSet ("resource_eks_cluster.foo" , "vpc_id" ),
38- resource .TestCheckResourceAttrSet ("resource_eks_cluster.foo" , "service_subnet_id" ),
23+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "cluster_name" , "tf-eks-test" ),
24+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "k8s_version" , "1.18.4" ),
25+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "cluster_desc" , "test eks cluster created by terraform" ),
26+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "dns_servers.#" , "1" ),
27+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "dns_servers.0.domain" , "example2.org" ),
28+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "dns_servers.0.servers.#" , "2" ),
29+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "dns_servers.0.servers.0" , "10.0.0.1:80" ),
30+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "dns_servers.0.servers.1" , "10.0.0.1:81" ),
31+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "enable_vpc_core_dns" , "true" ),
32+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "need_delete_cbs" , "true" ),
33+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "tags.test" , "tf" ),
34+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster.foo" , "subnet_ids.#" , "1" ),
35+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster.foo" , "subnet_ids.0" ),
36+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster.foo" , "vpc_id" ),
37+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster.foo" , "service_subnet_id" ),
3938 ),
4039 },
4140 {
4241 Config : testAccEksClusterUpdate ,
4342 Check : resource .ComposeTestCheckFunc (
44- testAccTencentCloudEKSClusterExists ("resource_eks_cluster .foo" ),
45- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "cluster_name" , "tf-ci-test " ),
46- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "k8s_version" , "1.12.8 " ),
47- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "cluster_desc" , "test eks cluster updated by terraform" ),
48- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "dns_servers.0.domain" , "example1.org" ),
49- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "dns_servers.0.servers.#" , "2" ),
50- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "dns_servers.0.servers.0" , "10.0.0.1:82" ),
51- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "dns_servers.0.servers.1" , "10.0.0.1:83" ),
52- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "enable_vpc_core_dns" , "false" ),
53- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "need_delete_cbs" , "false" ),
54- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "tags.hello " , "world " ),
55- resource .TestCheckResourceAttr ("resource_eks_cluster .foo" , "subnet_ids.#" , "1" ),
56- resource .TestCheckResourceAttrSet ("resource_eks_cluster .foo" , "subnet_ids.0" ),
57- resource .TestCheckResourceAttrSet ("resource_eks_cluster .foo" , "vpc_id" ),
58- resource .TestCheckResourceAttrSet ("resource_eks_cluster .foo" , "service_subnet_id" ),
43+ testAccTencentCloudEKSClusterExists ("tencentcloud_eks_cluster .foo" ),
44+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "cluster_name" , "tf-eks-test2 " ),
45+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "k8s_version" , "1.18.4 " ),
46+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "cluster_desc" , "test eks cluster updated by terraform" ),
47+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "dns_servers.0.domain" , "example1.org" ),
48+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "dns_servers.0.servers.#" , "2" ),
49+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "dns_servers.0.servers.0" , "10.0.0.1:82" ),
50+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "dns_servers.0.servers.1" , "10.0.0.1:83" ),
51+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "enable_vpc_core_dns" , "false" ),
52+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "need_delete_cbs" , "false" ),
53+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "tags.test " , "tf " ),
54+ resource .TestCheckResourceAttr ("tencentcloud_eks_cluster .foo" , "subnet_ids.#" , "1" ),
55+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster .foo" , "subnet_ids.0" ),
56+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster .foo" , "vpc_id" ),
57+ resource .TestCheckResourceAttrSet ("tencentcloud_eks_cluster .foo" , "service_subnet_id" ),
5958 ),
6059 },
6160 {
@@ -74,7 +73,7 @@ func testAccTencentCloudEKSClusterExists(n string) resource.TestCheckFunc {
7473
7574 rs , ok := s .RootModule ().Resources [n ]
7675 if ! ok {
77- return fmt .Errorf ("eks cluster %s is not found" , n )
76+ return fmt .Errorf ("resource: eks_cluster %s is not found" , n )
7877 }
7978 if rs .Primary .ID == "" {
8079 return fmt .Errorf ("eks cluster id is not set" )
@@ -168,7 +167,7 @@ resource "tencentcloud_eks_cluster" "foo" {
168167
169168const testAccEksClusterUpdate = defaultVpcVariable + `
170169resource "tencentcloud_eks_cluster" "foo" {
171- cluster_name = "tf-eks-test "
170+ cluster_name = "tf-eks-test2 "
172171 k8s_version = "1.18.4"
173172 vpc_id = var.vpc_id
174173 subnet_ids = [
0 commit comments