Skip to content

Commit 63c18a3

Browse files
tongyimingmikatong
andauthored
fix emr unit test (#1420)
Co-authored-by: mikatong <mikatong@tencent.com>
1 parent 9b70cf6 commit 63c18a3

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tencentcloud/resource_tc_emr_cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func resourceTencentCloudEmrCluster() *schema.Resource {
147147
Type: schema.TypeInt,
148148
Required: true,
149149
ValidateFunc: validateIntegerInRange(0, 1),
150-
Description: "The pay mode of instance. 0 is pay on an annual basis, 1 is pay on a measure basis.",
150+
Description: "The pay mode of instance. 0 represent POSTPAID_BY_HOUR, 1 represent PREPAID.",
151151
},
152152
"placement": {
153153
Type: schema.TypeMap,

tencentcloud/resource_tc_emr_cluster_test.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,20 @@ func testAccCheckEmrExists(n string) resource.TestCheckFunc {
183183
}
184184

185185
const testEmrBasic = defaultEMRVariable + `
186+
data "tencentcloud_instance_types" "cvm4c8m" {
187+
exclude_sold_out=true
188+
cpu_core_count=4
189+
memory_size=8
190+
filter {
191+
name = "instance-charge-type"
192+
values = ["POSTPAID_BY_HOUR"]
193+
}
194+
filter {
195+
name = "zone"
196+
values = ["ap-guangzhou-3"]
197+
}
198+
}
199+
186200
resource "tencentcloud_emr_cluster" "emrrrr" {
187201
product_id=4
188202
display_strategy="clusterList"
@@ -201,7 +215,7 @@ resource "tencentcloud_emr_cluster" "emrrrr" {
201215
cpu=4
202216
disk_size=100
203217
disk_type="CLOUD_PREMIUM"
204-
spec="CVM.S2"
218+
spec="CVM.${data.tencentcloud_instance_types.cvm4c8m.instance_types.0.family}"
205219
storage_type=5
206220
root_size=50
207221
}
@@ -210,7 +224,7 @@ resource "tencentcloud_emr_cluster" "emrrrr" {
210224
cpu=4
211225
disk_size=100
212226
disk_type="CLOUD_PREMIUM"
213-
spec="CVM.S2"
227+
spec="CVM.${data.tencentcloud_instance_types.cvm4c8m.instance_types.0.family}"
214228
storage_type=5
215229
root_size=50
216230
}

website/docs/r/emr_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The following arguments are supported:
6464
* `display_strategy` - (Required, String, ForceNew) Display strategy of EMR instance.
6565
* `instance_name` - (Required, String, ForceNew) Name of the instance, which can contain 6 to 36 English letters, Chinese characters, digits, dashes(-), or underscores(_).
6666
* `login_settings` - (Required, Map, ForceNew) Instance login settings.
67-
* `pay_mode` - (Required, Int) The pay mode of instance. 0 is pay on an annual basis, 1 is pay on a measure basis.
67+
* `pay_mode` - (Required, Int) The pay mode of instance. 0 represent POSTPAID_BY_HOUR, 1 represent PREPAID.
6868
* `placement` - (Required, Map, ForceNew) The location of the instance.
6969
* `product_id` - (Required, Int, ForceNew) The product id of EMR instance.
7070
* `softwares` - (Required, List: [`String`], ForceNew) The softwares of a EMR instance.

0 commit comments

Comments
 (0)