Skip to content

Commit a384362

Browse files
committed
add
1 parent b8d2500 commit a384362

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tencentcloud/services/cls/resource_tc_cls_index.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cls
22

33
import (
44
"context"
5+
"fmt"
56
"log"
67

78
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
@@ -547,6 +548,13 @@ func resourceTencentCloudClsIndexUpdate(d *schema.ResourceData, meta interface{}
547548
id = d.Id()
548549
)
549550

551+
immutableArgs := []string{"topic_id"}
552+
for _, v := range immutableArgs {
553+
if d.HasChange(v) {
554+
return fmt.Errorf("argument `%s` cannot be changed", v)
555+
}
556+
}
557+
550558
request.TopicId = &id
551559
if dMap, ok := helper.InterfacesHeadMap(d, "rule"); ok {
552560
ruleInfo := cls.RuleInfo{}

tencentcloud/services/cls/resource_tc_cls_inex_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestAccTencentCloudClsIndex_basic(t *testing.T) {
3333
Config: testAccClsIndexUpdate,
3434
Check: resource.ComposeTestCheckFunc(
3535
resource.TestCheckResourceAttrSet("tencentcloud_cls_index.example", "topic_id"),
36-
resource.TestCheckResourceAttr("tencentcloud_cls_index.example", "status", "false"),
36+
resource.TestCheckResourceAttr("tencentcloud_cls_index.example", "status", "true"),
3737
resource.TestCheckResourceAttr("tencentcloud_cls_index.example", "include_internal_fields", "true"),
3838
),
3939
},
@@ -193,7 +193,7 @@ resource "tencentcloud_cls_index" "example" {
193193
status = false
194194
}
195195
}
196-
status = false
196+
status = true
197197
include_internal_fields = true
198198
metadata_flag = 1
199199
}

0 commit comments

Comments
 (0)