diff --git a/.changelog/2981.txt b/.changelog/2981.txt new file mode 100644 index 0000000000..5419b7658d --- /dev/null +++ b/.changelog/2981.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +tencentcloud_cls_notice_content +``` diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 94820d1551..35ff575a85 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1705,6 +1705,7 @@ func Provider() *schema.Provider { "tencentcloud_cls_export": cls.ResourceTencentCloudClsExport(), "tencentcloud_cls_data_transform": cls.ResourceTencentCloudClsDataTransform(), "tencentcloud_cls_cloud_product_log_task": cls.ResourceTencentCloudClsCloudProductLogTask(), + "tencentcloud_cls_notice_content": cls.ResourceTencentCloudClsNoticeContent(), "tencentcloud_lighthouse_instance": lighthouse.ResourceTencentCloudLighthouseInstance(), "tencentcloud_lighthouse_firewall_template": lighthouse.ResourceTencentCloudLighthouseFirewallTemplate(), "tencentcloud_tem_environment": tem.ResourceTencentCloudTemEnvironment(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 2f559a1ee4..05a850434e 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -1379,6 +1379,7 @@ Cloud Log Service(CLS) tencentcloud_cls_scheduled_sql tencentcloud_cls_data_transform tencentcloud_cls_cloud_product_log_task + tencentcloud_cls_notice_content Data Source tencentcloud_cls_shipper_tasks diff --git a/tencentcloud/services/cls/resource_tc_cls_notice_content.go b/tencentcloud/services/cls/resource_tc_cls_notice_content.go new file mode 100644 index 0000000000..a26d8d9cff --- /dev/null +++ b/tencentcloud/services/cls/resource_tc_cls_notice_content.go @@ -0,0 +1,426 @@ +// Code generated by iacg; DO NOT EDIT. +package cls + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + clsv20201016 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudClsNoticeContent() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudClsNoticeContentCreate, + Read: resourceTencentCloudClsNoticeContentRead, + Update: resourceTencentCloudClsNoticeContentUpdate, + Delete: resourceTencentCloudClsNoticeContentDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "Notice content name.", + }, + + "type": { + Type: schema.TypeInt, + Optional: true, + Description: "Template content language. 0: Chinese 1: English.", + }, + + "notice_contents": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Template detailed configuration.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Required: true, + Description: "Channel type. Email: Email; Sms: SMS; WeChat: WeChat; Phone: Telephone; WeCom: Enterprise WeChat; DingTalk: DingTalk; Lark: Feishu; HTTP: Custom callback.", + }, + "trigger_content": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Alarm triggered notification content template.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "title": { + Type: schema.TypeString, + Optional: true, + Description: "Notification content template title information. Some notification channel types do not support 'title', please refer to the Tencent Cloud Console page.", + }, + "content": { + Type: schema.TypeString, + Optional: true, + Description: "Notification content template body information.", + }, + "headers": { + Type: schema.TypeSet, + Optional: true, + Description: "Request headers: In HTTP requests, request headers contain additional information sent by the client to the server, such as user agent, authorization credentials, expected response format, etc. Only `custom callback` supports this configuration.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "recovery_content": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Template for Alarm Recovery Notification Content.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "title": { + Type: schema.TypeString, + Optional: true, + Description: "Notification content template title information. Some notification channel types do not support 'title', please refer to the Tencent Cloud Console page.", + }, + "content": { + Type: schema.TypeString, + Optional: true, + Description: "Notification content template body information.", + }, + "headers": { + Type: schema.TypeSet, + Optional: true, + Description: "Request headers: In HTTP requests, request headers contain additional information sent by the client to the server, such as user agent, authorization credentials, expected response format, etc. Only `custom callback` supports this configuration.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudClsNoticeContentCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cls_notice_content.create")() + defer tccommon.InconsistentCheck(d, meta)() + + logId := tccommon.GetLogId(tccommon.ContextNil) + + ctx := tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + + var ( + noticeContentId string + ) + var ( + request = clsv20201016.NewCreateNoticeContentRequest() + response = clsv20201016.NewCreateNoticeContentResponse() + ) + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("type"); ok { + request.Type = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("notice_contents"); ok { + for _, item := range v.([]interface{}) { + noticeContentsMap := item.(map[string]interface{}) + noticeContent := clsv20201016.NoticeContent{} + if v, ok := noticeContentsMap["type"]; ok { + noticeContent.Type = helper.String(v.(string)) + } + if triggerContentMap, ok := helper.ConvertInterfacesHeadToMap(noticeContentsMap["trigger_content"]); ok { + noticeContentInfo := clsv20201016.NoticeContentInfo{} + if v, ok := triggerContentMap["title"]; ok { + noticeContentInfo.Title = helper.String(v.(string)) + } + if v, ok := triggerContentMap["content"]; ok { + noticeContentInfo.Content = helper.String(v.(string)) + } + if v, ok := triggerContentMap["headers"]; ok { + headersSet := v.(*schema.Set).List() + for i := range headersSet { + headers := headersSet[i].(string) + noticeContentInfo.Headers = append(noticeContentInfo.Headers, helper.String(headers)) + } + } + noticeContent.TriggerContent = ¬iceContentInfo + } + if recoveryContentMap, ok := helper.ConvertInterfacesHeadToMap(noticeContentsMap["recovery_content"]); ok { + noticeContentInfo2 := clsv20201016.NoticeContentInfo{} + if v, ok := recoveryContentMap["title"]; ok { + noticeContentInfo2.Title = helper.String(v.(string)) + } + if v, ok := recoveryContentMap["content"]; ok { + noticeContentInfo2.Content = helper.String(v.(string)) + } + if v, ok := recoveryContentMap["headers"]; ok { + headersSet := v.(*schema.Set).List() + for i := range headersSet { + headers := headersSet[i].(string) + noticeContentInfo2.Headers = append(noticeContentInfo2.Headers, helper.String(headers)) + } + } + noticeContent.RecoveryContent = ¬iceContentInfo2 + } + request.NoticeContents = append(request.NoticeContents, ¬iceContent) + } + } + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClsV20201016Client().CreateNoticeContentWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create cls notice content failed, reason:%+v", logId, err) + return err + } + + noticeContentId = *response.Response.NoticeContentId + + d.SetId(noticeContentId) + + return resourceTencentCloudClsNoticeContentRead(d, meta) +} + +func resourceTencentCloudClsNoticeContentRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cls_notice_content.read")() + defer tccommon.InconsistentCheck(d, meta)() + + logId := tccommon.GetLogId(tccommon.ContextNil) + + ctx := tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + + service := ClsService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + + noticeContentId := d.Id() + + respData, err := service.DescribeClsNoticeContentById(ctx, noticeContentId) + if err != nil { + return err + } + + if respData == nil { + d.SetId("") + log.Printf("[WARN]%s resource `cls_notice_content` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + if respData.Name != nil { + _ = d.Set("name", respData.Name) + } + + if respData.Type != nil { + _ = d.Set("type", respData.Type) + } + + noticeContentsList := make([]map[string]interface{}, 0, len(respData.NoticeContents)) + if respData.NoticeContents != nil { + for _, noticeContents := range respData.NoticeContents { + noticeContentsMap := map[string]interface{}{} + + if noticeContents.Type != nil { + noticeContentsMap["type"] = noticeContents.Type + } + + triggerContentMap := map[string]interface{}{} + + if noticeContents.TriggerContent != nil { + if noticeContents.TriggerContent.Title != nil { + triggerContentMap["title"] = noticeContents.TriggerContent.Title + } + + if noticeContents.TriggerContent.Content != nil { + triggerContentMap["content"] = noticeContents.TriggerContent.Content + } + + if noticeContents.TriggerContent.Headers != nil { + tmpList := make([]string, 0, len(noticeContents.TriggerContent.Headers)) + for _, item := range noticeContents.TriggerContent.Headers { + tmpList = append(tmpList, *item) + } + + triggerContentMap["headers"] = tmpList + } + + noticeContentsMap["trigger_content"] = []interface{}{triggerContentMap} + } + + recoveryContentMap := map[string]interface{}{} + + if noticeContents.RecoveryContent != nil { + if noticeContents.RecoveryContent.Title != nil { + recoveryContentMap["title"] = noticeContents.RecoveryContent.Title + } + + if noticeContents.RecoveryContent.Content != nil { + recoveryContentMap["content"] = noticeContents.RecoveryContent.Content + } + + if noticeContents.RecoveryContent.Headers != nil { + tmpList := make([]string, 0, len(noticeContents.RecoveryContent.Headers)) + for _, item := range noticeContents.RecoveryContent.Headers { + tmpList = append(tmpList, *item) + } + + recoveryContentMap["headers"] = tmpList + } + + noticeContentsMap["recovery_content"] = []interface{}{recoveryContentMap} + } + + noticeContentsList = append(noticeContentsList, noticeContentsMap) + } + + _ = d.Set("notice_contents", noticeContentsList) + } + + return nil +} + +func resourceTencentCloudClsNoticeContentUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cls_notice_content.update")() + defer tccommon.InconsistentCheck(d, meta)() + + logId := tccommon.GetLogId(tccommon.ContextNil) + + ctx := tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + + noticeContentId := d.Id() + + needChange := false + mutableArgs := []string{"name", "type", "notice_contents"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := clsv20201016.NewModifyNoticeContentRequest() + + request.NoticeContentId = helper.String(noticeContentId) + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("type"); ok { + request.Type = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("notice_contents"); ok { + for _, item := range v.([]interface{}) { + noticeContentsMap := item.(map[string]interface{}) + noticeContent := clsv20201016.NoticeContent{} + if v, ok := noticeContentsMap["type"]; ok { + noticeContent.Type = helper.String(v.(string)) + } + if triggerContentMap, ok := helper.ConvertInterfacesHeadToMap(noticeContentsMap["trigger_content"]); ok { + noticeContentInfo := clsv20201016.NoticeContentInfo{} + if v, ok := triggerContentMap["title"]; ok { + noticeContentInfo.Title = helper.String(v.(string)) + } + if v, ok := triggerContentMap["content"]; ok { + noticeContentInfo.Content = helper.String(v.(string)) + } + if v, ok := triggerContentMap["headers"]; ok { + headersSet := v.(*schema.Set).List() + for i := range headersSet { + headers := headersSet[i].(string) + noticeContentInfo.Headers = append(noticeContentInfo.Headers, helper.String(headers)) + } + } + noticeContent.TriggerContent = ¬iceContentInfo + } + if recoveryContentMap, ok := helper.ConvertInterfacesHeadToMap(noticeContentsMap["recovery_content"]); ok { + noticeContentInfo2 := clsv20201016.NoticeContentInfo{} + if v, ok := recoveryContentMap["title"]; ok { + noticeContentInfo2.Title = helper.String(v.(string)) + } + if v, ok := recoveryContentMap["content"]; ok { + noticeContentInfo2.Content = helper.String(v.(string)) + } + if v, ok := recoveryContentMap["headers"]; ok { + headersSet := v.(*schema.Set).List() + for i := range headersSet { + headers := headersSet[i].(string) + noticeContentInfo2.Headers = append(noticeContentInfo2.Headers, helper.String(headers)) + } + } + noticeContent.RecoveryContent = ¬iceContentInfo2 + } + request.NoticeContents = append(request.NoticeContents, ¬iceContent) + } + } + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClsV20201016Client().ModifyNoticeContentWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s update cls notice content failed, reason:%+v", logId, err) + return err + } + } + + return resourceTencentCloudClsNoticeContentRead(d, meta) +} + +func resourceTencentCloudClsNoticeContentDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_cls_notice_content.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + logId := tccommon.GetLogId(tccommon.ContextNil) + ctx := tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + + noticeContentId := d.Id() + + var ( + request = clsv20201016.NewDeleteNoticeContentRequest() + response = clsv20201016.NewDeleteNoticeContentResponse() + ) + + request.NoticeContentId = helper.String(noticeContentId) + + err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseClsV20201016Client().DeleteNoticeContentWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s delete cls notice content failed, reason:%+v", logId, err) + return err + } + + _ = response + return nil +} diff --git a/tencentcloud/services/cls/resource_tc_cls_notice_content.md b/tencentcloud/services/cls/resource_tc_cls_notice_content.md new file mode 100644 index 0000000000..1e4a85e71c --- /dev/null +++ b/tencentcloud/services/cls/resource_tc_cls_notice_content.md @@ -0,0 +1,37 @@ +Provides a resource to create a cls notice content + +Example Usage + +```hcl +resource "tencentcloud_cls_notice_content" "example" { + name = "tf-example" + type = 0 + notice_contents { + type = "Email" + + trigger_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + + recovery_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + } +} +``` + +Import + +cls notice content can be imported using the id, e.g. + +``` +terraform import tencentcloud_cls_notice_content.example noticetemplate-b417f32a-bdf9-46c5-933e-28c23cd7a6b7 +``` diff --git a/tencentcloud/services/cls/resource_tc_cls_notice_content_extension.go b/tencentcloud/services/cls/resource_tc_cls_notice_content_extension.go new file mode 100644 index 0000000000..b1ff12dd72 --- /dev/null +++ b/tencentcloud/services/cls/resource_tc_cls_notice_content_extension.go @@ -0,0 +1 @@ +package cls diff --git a/tencentcloud/services/cls/resource_tc_cls_notice_content_test.go b/tencentcloud/services/cls/resource_tc_cls_notice_content_test.go new file mode 100644 index 0000000000..5e6a6d69d1 --- /dev/null +++ b/tencentcloud/services/cls/resource_tc_cls_notice_content_test.go @@ -0,0 +1,96 @@ +package cls_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudClsNoticeContentResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccClsNoticeContent, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "type"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "notice_contents"), + ), + }, + { + Config: testAccClsNoticeContentUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "name"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "type"), + resource.TestCheckResourceAttrSet("tencentcloud_cls_notice_content.example", "notice_contents"), + ), + }, + { + ResourceName: "tencentcloud_cls_notice_content.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccClsNoticeContent = ` +resource "tencentcloud_cls_notice_content" "example" { + name = "tf-example" + type = 0 + notice_contents { + type = "Email" + + trigger_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + + recovery_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + } +} +` + +const testAccClsNoticeContentUpdate = ` +resource "tencentcloud_cls_notice_content" "example" { + name = "tf-example-update" + type = 1 + notice_contents { + type = "Sms" + + trigger_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + + recovery_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + } +} +` diff --git a/tencentcloud/services/cls/service_tencentcloud_cls.go b/tencentcloud/services/cls/service_tencentcloud_cls.go index 46c0a8d9b9..c13111b321 100644 --- a/tencentcloud/services/cls/service_tencentcloud_cls.go +++ b/tencentcloud/services/cls/service_tencentcloud_cls.go @@ -1399,3 +1399,36 @@ func (me *ClsService) DescribeClsCloudProductLogTaskById(ctx context.Context) (r ret = response.Response return } + +func (me *ClsService) DescribeClsNoticeContentById(ctx context.Context, noticeContentId string) (ret *cls.NoticeContentTemplate, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := cls.NewDescribeNoticeContentsRequest() + filter := &cls.Filter{ + Key: helper.String("noticeContentId"), + Values: []*string{helper.String(noticeContentId)}, + } + request.Filters = append(request.Filters, filter) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseClsV20201016Client().DescribeNoticeContents(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if len(response.Response.NoticeContents) < 1 { + return + } + + ret = response.Response.NoticeContents[0] + return +} diff --git a/website/docs/r/cls_notice_content.html.markdown b/website/docs/r/cls_notice_content.html.markdown new file mode 100644 index 0000000000..56eee10966 --- /dev/null +++ b/website/docs/r/cls_notice_content.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "Cloud Log Service(CLS)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_cls_notice_content" +sidebar_current: "docs-tencentcloud-resource-cls_notice_content" +description: |- + Provides a resource to create a cls notice content +--- + +# tencentcloud_cls_notice_content + +Provides a resource to create a cls notice content + +## Example Usage + +```hcl +resource "tencentcloud_cls_notice_content" "example" { + name = "tf-example" + type = 0 + notice_contents { + type = "Email" + + trigger_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + + recovery_content { + title = "title" + content = "This is content." + headers = [ + "Content-Type:application/json" + ] + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required, String) Notice content name. +* `notice_contents` - (Optional, List) Template detailed configuration. +* `type` - (Optional, Int) Template content language. 0: Chinese 1: English. + +The `notice_contents` object supports the following: + +* `type` - (Required, String) Channel type. Email: Email; Sms: SMS; WeChat: WeChat; Phone: Telephone; WeCom: Enterprise WeChat; DingTalk: DingTalk; Lark: Feishu; HTTP: Custom callback. +* `recovery_content` - (Optional, List) Template for Alarm Recovery Notification Content. +* `trigger_content` - (Optional, List) Alarm triggered notification content template. + +The `recovery_content` object of `notice_contents` supports the following: + +* `content` - (Optional, String) Notification content template body information. +* `headers` - (Optional, Set) Request headers: In HTTP requests, request headers contain additional information sent by the client to the server, such as user agent, authorization credentials, expected response format, etc. Only `custom callback` supports this configuration. +* `title` - (Optional, String) Notification content template title information. Some notification channel types do not support 'title', please refer to the Tencent Cloud Console page. + +The `trigger_content` object of `notice_contents` supports the following: + +* `content` - (Optional, String) Notification content template body information. +* `headers` - (Optional, Set) Request headers: In HTTP requests, request headers contain additional information sent by the client to the server, such as user agent, authorization credentials, expected response format, etc. Only `custom callback` supports this configuration. +* `title` - (Optional, String) Notification content template title information. Some notification channel types do not support 'title', please refer to the Tencent Cloud Console page. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +cls notice content can be imported using the id, e.g. + +``` +terraform import tencentcloud_cls_notice_content.example noticetemplate-b417f32a-bdf9-46c5-933e-28c23cd7a6b7 +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 243803c04c..f8f258bf13 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -1539,6 +1539,9 @@