diff --git a/tencentcloud/resource_tc_clb_listener_rule.go b/tencentcloud/resource_tc_clb_listener_rule.go index 53120c63c4..0bbd064db7 100644 --- a/tencentcloud/resource_tc_clb_listener_rule.go +++ b/tencentcloud/resource_tc_clb_listener_rule.go @@ -564,7 +564,7 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte domainChanged := false domainRequest := clb.NewModifyDomainAttributesRequest() if d.HasChange("domain") { - new, old := d.GetChange("domain") + old, new := d.GetChange("domain") domainChanged = true domainRequest.Domain = helper.String(old.(string)) domainRequest.NewDomain = helper.String(new.(string)) diff --git a/tencentcloud/resource_tc_clb_listener_rule_test.go b/tencentcloud/resource_tc_clb_listener_rule_test.go index 432bc0e5ff..148e32a16a 100644 --- a/tencentcloud/resource_tc_clb_listener_rule_test.go +++ b/tencentcloud/resource_tc_clb_listener_rule_test.go @@ -89,7 +89,7 @@ func TestAccTencentCloudClbListenerRule_full(t *testing.T) { testAccCheckClbListenerRuleExists("tencentcloud_clb_listener_rule.rule_full"), resource.TestCheckResourceAttrSet("tencentcloud_clb_listener_rule.rule_full", "clb_id"), resource.TestCheckResourceAttrSet("tencentcloud_clb_listener_rule.rule_full", "listener_id"), - resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_full", "domain", "abcdr.com"), + resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_full", "domain", "abcd.com"), resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_full", "session_expire_time", "60"), resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_full", "url", "/"), resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_full", "scheduler", "WRR"), diff --git a/tencentcloud/resource_tc_clb_target_group.go b/tencentcloud/resource_tc_clb_target_group.go index 8be6fb15d8..c166e59c19 100644 --- a/tencentcloud/resource_tc_clb_target_group.go +++ b/tencentcloud/resource_tc_clb_target_group.go @@ -187,13 +187,9 @@ func resourceTencentCloudClbTargetUpdate(d *schema.ResourceData, meta interface{ ) isChanged := false - if d.HasChange("port") { + if d.HasChange("port") || d.HasChange("target_group_name"){ isChanged = true port = uint64(d.Get("port").(int)) - } - - if d.HasChange("target_group_name") { - isChanged = true tgtGroupName = d.Get("target_group_name").(string) } diff --git a/tencentcloud/resource_tc_clb_target_group_test.go b/tencentcloud/resource_tc_clb_target_group_test.go index 9fc1dcbf78..c9a2fb56a5 100644 --- a/tencentcloud/resource_tc_clb_target_group_test.go +++ b/tencentcloud/resource_tc_clb_target_group_test.go @@ -52,7 +52,7 @@ func TestAccTencentCloudClbInstanceTargetGroup(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckClbTargetGroupExists("tencentcloud_clb_target_group.target_group"), resource.TestCheckResourceAttr("tencentcloud_clb_target_group.target_group", "target_group_name", "tgt_grp_test"), - resource.TestCheckResourceAttr("tencentcloud_clb_target_group.target_group", "port", "33"), + resource.TestCheckResourceAttr("tencentcloud_clb_target_group.target_group", "port", "44"), //resource.TestCheckResourceAttr("tencentcloud_clb_target_group.target_group", "target_group_instances.bind_ip", "10.0.0.4"), //resource.TestCheckResourceAttr("tencentcloud_clb_target_group.target_group", "target_group_instances.port", "44"), ),