@@ -22,10 +22,9 @@ func TestAccTencentCloudEmrClusterResource(t *testing.T) {
2222 testAccCheckEmrExists (testTkeClusterResourceKey ),
2323 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "product_id" , "4" ),
2424 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "display_strategy" , "clusterList" ),
25- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "vpc_settings.vpc_id" , "vpc-fuwly8x5" ),
26- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "vpc_settings.subnet_id" , "subnet-d830wfso" ),
27- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "softwares.0" , "hadoop-2.8.4" ),
28- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "softwares.1" , "zookeeper-3.4.9" ),
25+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "vpc_settings.vpc_id" , "vpc-i9zty99n" ),
26+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "vpc_settings.subnet_id" , "subnet-opwnh0sw" ),
27+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "softwares.0" , "zookeeper-3.6.1" ),
2928 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "support_ha" , "0" ),
3029 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "instance_name" , "emr-test" ),
3130 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "resource_spec.master_resource_spec.mem_size" , "8192" ),
@@ -43,9 +42,9 @@ func TestAccTencentCloudEmrClusterResource(t *testing.T) {
4342 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "resource_spec.master_count" , "1" ),
4443 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "resource_spec.core_count" , "2" ),
4544 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "login_settings.password" , "tencent@cloud123" ),
46- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "time_span" , "1 " ),
47- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "time_unit" , "m " ),
48- resource .TestCheckResourceAttr (testTkeClusterResourceKey , "pay_mode" , "1 " ),
45+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "time_span" , "3600 " ),
46+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "time_unit" , "s " ),
47+ resource .TestCheckResourceAttr (testTkeClusterResourceKey , "pay_mode" , "0 " ),
4948 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "placement.zone" , "ap-guangzhou-3" ),
5049 resource .TestCheckResourceAttr (testTkeClusterResourceKey , "placement.project_id" , "0" ),
5150 resource .TestCheckResourceAttrSet (testTkeClusterResourceKey , "instance_id" ),
@@ -104,38 +103,48 @@ func testAccCheckEmrExists(n string) resource.TestCheckFunc {
104103 }
105104}
106105
107- const testEmrBasic = defaultVpcVariable + `
106+ const testEmrBasic = `
108107resource "tencentcloud_emr_cluster" "emrrrr" {
109108 product_id=4
110109 display_strategy="clusterList"
111- vpc_settings={vpc_id: var.vpc_id, subnet_id: var.subnet_id }
112- softwares=["zookeeper-3.5.5"]
113- support_ha=0
114- instance_name="emr-test"
110+ vpc_settings={
111+ vpc_id="vpc-i9zty99n"
112+ subnet_id:"subnet-opwnh0sw"
113+ }
114+ softwares=[
115+ "zookeeper-3.6.1",
116+ ]
117+ support_ha=0
118+ instance_name="emr-test-demo"
115119 resource_spec {
116- master_resource_spec {
117- mem_size=8192
118- cpu=4
119- disk_size=100
120- disk_type="CLOUD_PREMIUM"
121- spec="CVM.S2"
122- storage_type=5
123- }
124- core_resource_spec {
125- mem_size=8192
126- cpu=4
127- disk_size=100
128- disk_type="CLOUD_PREMIUM"
129- spec="CVM.S2"
130- storage_type=5
131- }
132- master_count=1
133- core_count=2
120+ master_resource_spec {
121+ mem_size=8192
122+ cpu=4
123+ disk_size=100
124+ disk_type="CLOUD_PREMIUM"
125+ spec="CVM.S2"
126+ storage_type=5
127+ }
128+ core_resource_spec {
129+ mem_size=8192
130+ cpu=4
131+ disk_size=100
132+ disk_type="CLOUD_PREMIUM"
133+ spec="CVM.S2"
134+ storage_type=5
135+ }
136+ master_count=1
137+ core_count=2
134138 }
135- login_settings={password:"tencent@cloud123"}
136- time_span=1
137- time_unit="m"
138- pay_mode=1
139- placement={zone:"ap-guangzhou-3", project_id:0}
140- }
139+ login_settings={
140+ password="tencent@cloud123"
141+ }
142+ time_span=3600
143+ time_unit="s"
144+ pay_mode=0
145+ placement={
146+ zone="ap-guangzhou-3"
147+ project_id=0
148+ }
149+ }
141150`
0 commit comments