From 18bd1da6d70d732c39ae96170c8b3af848dfab06 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Mon, 27 Oct 2025 15:51:44 +0800 Subject: [PATCH 1/3] add --- tencentcloud/provider.go | 2 + tencentcloud/provider.md | 2 + ...a_add_calc_engines_to_project_operation.go | 159 +++++++++ ...a_add_calc_engines_to_project_operation.md | 16 + ..._calc_engines_to_project_operation_test.go | 40 +++ ..._tc_wedata_data_backfill_plan_operation.go | 310 ++++++++++++++++++ ..._tc_wedata_data_backfill_plan_operation.md | 19 ++ ...edata_data_backfill_plan_operation_test.go | 43 +++ ...engines_to_project_operation.html.markdown | 60 ++++ ...data_backfill_plan_operation.html.markdown | 86 +++++ website/tencentcloud.erb | 6 + 11 files changed, 743 insertions(+) create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.go create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.md create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation_test.go create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.go create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.md create mode 100644 tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation_test.go create mode 100644 website/docs/r/wedata_add_calc_engines_to_project_operation.html.markdown create mode 100644 website/docs/r/wedata_data_backfill_plan_operation.html.markdown diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 0ee049fe6e..b17778fda3 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -2350,6 +2350,8 @@ func Provider() *schema.Provider { "tencentcloud_wedata_code_file": wedata.ResourceTencentCloudWedataCodeFile(), "tencentcloud_wedata_run_sql_script_operation": wedata.ResourceTencentCloudWedataRunSqlScriptOperation(), "tencentcloud_wedata_stop_sql_script_run_operation": wedata.ResourceTencentCloudWedataStopSqlScriptRunOperation(), + "tencentcloud_wedata_add_calc_engines_to_project_operation": wedata.ResourceTencentCloudWedataAddCalcEnginesToProjectOperation(), + "tencentcloud_wedata_data_backfill_plan_operation": wedata.ResourceTencentCloudWedataDataBackfillPlanOperation(), "tencentcloud_cfw_address_template": cfw.ResourceTencentCloudCfwAddressTemplate(), "tencentcloud_cfw_block_ignore": cfw.ResourceTencentCloudCfwBlockIgnore(), "tencentcloud_cfw_edge_policy": cfw.ResourceTencentCloudCfwEdgePolicy(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 91e1b1a06c..2f51816d96 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2295,6 +2295,8 @@ tencentcloud_wedata_run_sql_script_operation tencentcloud_wedata_stop_sql_script_run_operation tencentcloud_wedata_project tencentcloud_wedata_project_member +tencentcloud_wedata_add_calc_engines_to_project_operation +tencentcloud_wedata_data_backfill_plan_operation Cloud Firewall(CFW) Data Source diff --git a/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.go b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.go new file mode 100644 index 0000000000..8f48df7c25 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.go @@ -0,0 +1,159 @@ +package wedata + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataAddCalcEnginesToProjectOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataAddCalcEnginesToProjectOperationCreate, + Read: resourceTencentCloudWedataAddCalcEnginesToProjectOperationRead, + Delete: resourceTencentCloudWedataAddCalcEnginesToProjectOperationDelete, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project ID to be modified.", + }, + + "dlc_info": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Description: "DLC cluster information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "compute_resources": { + Type: schema.TypeSet, + Required: true, + Description: "DLC resource names (need to add role Uin to DLC, otherwise resources may not be available).", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "region": { + Type: schema.TypeString, + Required: true, + Description: "DLC region.", + }, + "default_database": { + Type: schema.TypeString, + Required: true, + Description: "Specify the default database for the DLC cluster.", + }, + "standard_mode_env_tag": { + Type: schema.TypeString, + Optional: true, + Description: "Cluster configuration tag (only effective for standard mode projects and required for standard mode). Enum values:\n- Prod (Production environment)\n- Dev (Development environment).", + }, + "access_account": { + Type: schema.TypeString, + Optional: true, + Description: "Access account (only effective for standard mode projects and required for standard mode), used to submit DLC tasks.\nIt is recommended to use a specified sub-account and set corresponding database table permissions for the sub-account; task runner mode may cause task failures when the responsible person leaves; main account mode is not easy for permission control when multiple projects have different permissions.\n\nEnum values:\n- TASK_RUNNER (Task Runner)\n- OWNER (Main Account Mode)\n- SUB (Sub-Account Mode).", + }, + "sub_account_uin": { + Type: schema.TypeString, + Optional: true, + Description: "Sub-account ID (only effective for standard mode projects), when AccessAccount is in sub-account mode, the sub-account ID information needs to be specified, other modes do not need to be specified.", + }, + }, + }, + }, + }, + } +} + +func resourceTencentCloudWedataAddCalcEnginesToProjectOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_add_calc_engines_to_project_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewAddCalcEnginesToProjectRequest() + projectId string + ) + + if v, ok := d.GetOk("project_id"); ok { + request.ProjectId = helper.String(v.(string)) + projectId = v.(string) + } + + if v, ok := d.GetOk("dlc_info"); ok { + for _, item := range v.([]interface{}) { + dLCInfoMap := item.(map[string]interface{}) + dLCClusterInfo := wedatav20250806.DLCClusterInfo{} + if v, ok := dLCInfoMap["compute_resources"]; ok { + computeResourcesSet := v.(*schema.Set).List() + for i := range computeResourcesSet { + computeResources := computeResourcesSet[i].(string) + dLCClusterInfo.ComputeResources = append(dLCClusterInfo.ComputeResources, helper.String(computeResources)) + } + } + + if v, ok := dLCInfoMap["region"].(string); ok && v != "" { + dLCClusterInfo.Region = helper.String(v) + } + + if v, ok := dLCInfoMap["default_database"].(string); ok && v != "" { + dLCClusterInfo.DefaultDatabase = helper.String(v) + } + + if v, ok := dLCInfoMap["standard_mode_env_tag"].(string); ok && v != "" { + dLCClusterInfo.StandardModeEnvTag = helper.String(v) + } + + if v, ok := dLCInfoMap["access_account"].(string); ok && v != "" { + dLCClusterInfo.AccessAccount = helper.String(v) + } + + if v, ok := dLCInfoMap["sub_account_uin"].(string); ok && v != "" { + dLCClusterInfo.SubAccountUin = helper.String(v) + } + + request.DLCInfo = append(request.DLCInfo, &dLCClusterInfo) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().AddCalcEnginesToProjectWithContext(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 reqErr != nil { + log.Printf("[CRITAL]%s create wedata add calc engines to project operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(projectId) + return resourceTencentCloudWedataAddCalcEnginesToProjectOperationRead(d, meta) +} + +func resourceTencentCloudWedataAddCalcEnginesToProjectOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_add_calc_engines_to_project_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudWedataAddCalcEnginesToProjectOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_add_calc_engines_to_project_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.md b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.md new file mode 100644 index 0000000000..c4e0a2bbe5 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation.md @@ -0,0 +1,16 @@ +Provides a resource to create a WeData add calc engines to project operation + +Example Usage + +```hcl +resource "tencentcloud_wedata_add_calc_engines_to_project_operation" "example" { + project_id = "20241107221758402" + dlc_info { + compute_resources = [ + "dlc_linau6d4bu8bd5u52ffu52a8" + ] + region = "ap-guangzhou" + default_database = "default_db" + } +} +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation_test.go b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation_test.go new file mode 100644 index 0000000000..84d02b9f2c --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_add_calc_engines_to_project_operation_test.go @@ -0,0 +1,40 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataAddCalcEnginesToProjectOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataAddCalcEnginesToProjectOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_add_calc_engines_to_project_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccWedataAddCalcEnginesToProjectOperation = ` +resource "tencentcloud_wedata_add_calc_engines_to_project_operation" "example" { + project_id = "20241107221758402" + dlc_info { + compute_resources = [ + "dlc_linau6d4bu8bd5u52ffu52a8" + ] + region = "ap-guangzhou" + default_database = "default_db" + } +} +` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.go b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.go new file mode 100644 index 0000000000..ae8320f2a2 --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.go @@ -0,0 +1,310 @@ +package wedata + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + wedatav20250806 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata/v20250806" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudWedataDataBackfillPlanOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudWedataDataBackfillPlanOperationCreate, + Read: resourceTencentCloudWedataDataBackfillPlanOperationRead, + Delete: resourceTencentCloudWedataDataBackfillPlanOperationDelete, + Schema: map[string]*schema.Schema{ + "project_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Project ID.", + }, + + "task_ids": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + Description: "Backfill task collection.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + "data_backfill_range_list": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Description: "Specifies the data time configuration for the backfill task.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_date": { + Type: schema.TypeString, + Optional: true, + Description: "Start date in yyyy-MM-dd format. indicates the start from 00:00:00 on the specified date.", + }, + "end_date": { + Type: schema.TypeString, + Optional: true, + Description: "End date in the format yyyy-MM-dd, indicates ending at 23:59:59 of the specified date.", + }, + "execution_start_time": { + Type: schema.TypeString, + Optional: true, + Description: "Start time of each day between [StartDate, EndDate] in HH:mm format. effective for tasks with a period of hours or less.", + }, + "execution_end_time": { + Type: schema.TypeString, + Optional: true, + Description: "End time point between [StartDate, EndDate] in HH:mm format. effective for tasks with a period of hours or less.", + }, + }, + }, + }, + + "time_zone": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Time zone, default UTC+8.", + }, + + "data_backfill_plan_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Backfill plan name. if left empty, a string of characters is randomly generated by system.", + }, + + "check_parent_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Check parent task type. valid values: NONE (do not check ALL), ALL (check ALL upstream parent tasks), MAKE_SCOPE (only check in the currently selected tasks of the backfill plan). default: NONE (do not check).", + }, + + "skip_event_listening": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Description: "Specifies whether to ignore event dependency for backfill. default true.", + }, + + "redefine_self_workflow_dependency": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Custom workflow self-dependency. valid values: yes or no. if not configured, use the original workflow self-dependency.", + }, + + "redefine_parallel_num": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Customizes the degree of concurrency for instance running. if without configuring, use the existing self-dependent of the task.", + }, + + "scheduler_resource_group_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Scheduling resource group id. if left empty, indicates usage of the original task scheduling execution resource group.", + }, + + "integration_resource_group_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Integration task resource group id. indicates usage of the original task scheduling execution resource group if empty.", + }, + + "redefine_param_list": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Description: "Custom parameter. re-specifies the task's parameters to facilitate the execution of new logic by replenished instances.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "k": { + Type: schema.TypeString, + Optional: true, + Description: "Key name.", + }, + "v": { + Type: schema.TypeString, + Optional: true, + Description: "The value. do not pass SQL (the request will be deemed as an attack on the api). if needed, transcode the SQL with Base64 and decode it.", + }, + }, + }, + }, + + "data_time_order": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Backfill Execution Order - The execution order for backfill instances based on their data time. Effective only when both conditions are met:\n\n1. Must be the same cycle task.\n\n2. Priority is given to dependency order. If no dependencies apply, execution follows the configured order.\n\nValid values:\n\n-NORMAL: No specific order (default)\n\n-ORDER: Execute in chronological order\n\n-REVERSE: Execute in reverse chronological order.", + }, + + "redefine_cycle_type": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Backfill Instance Regeneration Cycle - If set, this will redefine the generation cycle of backfill task instances. Currently, only daily instances can be converted into instances generated on the first day of each month.\n\nValid value:\n\nMONTH_CYCLE: Monthly.", + }, + }, + } +} + +func resourceTencentCloudWedataDataBackfillPlanOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_backfill_plan_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = wedatav20250806.NewCreateDataBackfillPlanRequest() + response = wedatav20250806.NewCreateDataBackfillPlanResponse() + dataBackfillPlanId string + ) + + if v, ok := d.GetOk("project_id"); ok { + request.ProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("task_ids"); ok { + taskIdsSet := v.(*schema.Set).List() + for i := range taskIdsSet { + taskIds := taskIdsSet[i].(string) + request.TaskIds = append(request.TaskIds, helper.String(taskIds)) + } + } + + if v, ok := d.GetOk("data_backfill_range_list"); ok { + for _, item := range v.([]interface{}) { + dataBackfillRangeListMap := item.(map[string]interface{}) + dataBackfillRange := wedatav20250806.DataBackfillRange{} + if v, ok := dataBackfillRangeListMap["start_date"].(string); ok && v != "" { + dataBackfillRange.StartDate = helper.String(v) + } + + if v, ok := dataBackfillRangeListMap["end_date"].(string); ok && v != "" { + dataBackfillRange.EndDate = helper.String(v) + } + + if v, ok := dataBackfillRangeListMap["execution_start_time"].(string); ok && v != "" { + dataBackfillRange.ExecutionStartTime = helper.String(v) + } + + if v, ok := dataBackfillRangeListMap["execution_end_time"].(string); ok && v != "" { + dataBackfillRange.ExecutionEndTime = helper.String(v) + } + + request.DataBackfillRangeList = append(request.DataBackfillRangeList, &dataBackfillRange) + } + } + + if v, ok := d.GetOk("time_zone"); ok { + request.TimeZone = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_backfill_plan_name"); ok { + request.DataBackfillPlanName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("check_parent_type"); ok { + request.CheckParentType = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("skip_event_listening"); ok { + request.SkipEventListening = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOk("redefine_self_workflow_dependency"); ok { + request.RedefineSelfWorkflowDependency = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("redefine_parallel_num"); ok { + request.RedefineParallelNum = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("scheduler_resource_group_id"); ok { + request.SchedulerResourceGroupId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("integration_resource_group_id"); ok { + request.IntegrationResourceGroupId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("redefine_param_list"); ok { + for _, item := range v.([]interface{}) { + redefineParamListMap := item.(map[string]interface{}) + kVPair := wedatav20250806.KVPair{} + if v, ok := redefineParamListMap["k"].(string); ok && v != "" { + kVPair.K = helper.String(v) + } + + if v, ok := redefineParamListMap["v"].(string); ok && v != "" { + kVPair.V = helper.String(v) + } + + request.RedefineParamList = append(request.RedefineParamList, &kVPair) + } + } + + if v, ok := d.GetOk("data_time_order"); ok { + request.DataTimeOrder = helper.String(v.(string)) + } + + if v, ok := d.GetOk("redefine_cycle_type"); ok { + request.RedefineCycleType = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().CreateDataBackfillPlanWithContext(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()) + } + + if result == nil || result.Response == nil || result.Response.Data == nil { + return resource.NonRetryableError(fmt.Errorf("Create wedata data backfill plan operation failed, Response is nil")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create wedata data backfill plan operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Data.DataBackfillPlanId == nil { + return fmt.Errorf("DataBackfillPlanId is nil.") + } + + dataBackfillPlanId = *response.Response.Data.DataBackfillPlanId + d.SetId(dataBackfillPlanId) + return resourceTencentCloudWedataDataBackfillPlanOperationRead(d, meta) +} + +func resourceTencentCloudWedataDataBackfillPlanOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_backfill_plan_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudWedataDataBackfillPlanOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_wedata_data_backfill_plan_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.md b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.md new file mode 100644 index 0000000000..8a6c9db0df --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation.md @@ -0,0 +1,19 @@ +Provides a resource to create a WeData data backfill plan operation + +Example Usage + +```hcl +resource "tencentcloud_wedata_data_backfill_plan_operation" "example" { + project_id = "20241107221758402" + task_ids = [ + "20250827115253729" + ] + + data_backfill_range_list { + start_date = "2025-09-02" + end_date = "2025-09-02" + } + + skip_event_listening = true +} +``` diff --git a/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation_test.go b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation_test.go new file mode 100644 index 0000000000..3a36937ecb --- /dev/null +++ b/tencentcloud/services/wedata/resource_tc_wedata_data_backfill_plan_operation_test.go @@ -0,0 +1,43 @@ +package wedata_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudWedataDataBackfillPlanOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccWedataDataBackfillPlanOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_wedata_data_backfill_plan_operation.example", "id"), + ), + }, + }, + }) +} + +const testAccWedataDataBackfillPlanOperation = ` +resource "tencentcloud_wedata_data_backfill_plan_operation" "example" { + project_id = "20241107221758402" + task_ids = [ + "20250827115253729" + ] + + data_backfill_range_list { + start_date = "2025-09-02" + end_date = "2025-09-02" + } + + skip_event_listening = true +} +` diff --git a/website/docs/r/wedata_add_calc_engines_to_project_operation.html.markdown b/website/docs/r/wedata_add_calc_engines_to_project_operation.html.markdown new file mode 100644 index 0000000000..d6d62c8b6b --- /dev/null +++ b/website/docs/r/wedata_add_calc_engines_to_project_operation.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_add_calc_engines_to_project_operation" +sidebar_current: "docs-tencentcloud-resource-wedata_add_calc_engines_to_project_operation" +description: |- + Provides a resource to create a WeData add calc engines to project operation +--- + +# tencentcloud_wedata_add_calc_engines_to_project_operation + +Provides a resource to create a WeData add calc engines to project operation + +## Example Usage + +```hcl +resource "tencentcloud_wedata_add_calc_engines_to_project_operation" "example" { + project_id = "20241107221758402" + dlc_info { + compute_resources = [ + "dlc_linau6d4bu8bd5u52ffu52a8" + ] + region = "ap-guangzhou" + default_database = "default_db" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `dlc_info` - (Required, List, ForceNew) DLC cluster information. +* `project_id` - (Required, String, ForceNew) Project ID to be modified. + +The `dlc_info` object supports the following: + +* `compute_resources` - (Required, Set) DLC resource names (need to add role Uin to DLC, otherwise resources may not be available). +* `default_database` - (Required, String) Specify the default database for the DLC cluster. +* `region` - (Required, String) DLC region. +* `access_account` - (Optional, String) Access account (only effective for standard mode projects and required for standard mode), used to submit DLC tasks. +It is recommended to use a specified sub-account and set corresponding database table permissions for the sub-account; task runner mode may cause task failures when the responsible person leaves; main account mode is not easy for permission control when multiple projects have different permissions. + +Enum values: +- TASK_RUNNER (Task Runner) +- OWNER (Main Account Mode) +- SUB (Sub-Account Mode). +* `standard_mode_env_tag` - (Optional, String) Cluster configuration tag (only effective for standard mode projects and required for standard mode). Enum values: +- Prod (Production environment) +- Dev (Development environment). +* `sub_account_uin` - (Optional, String) Sub-account ID (only effective for standard mode projects), when AccessAccount is in sub-account mode, the sub-account ID information needs to be specified, other modes do not need to be specified. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/wedata_data_backfill_plan_operation.html.markdown b/website/docs/r/wedata_data_backfill_plan_operation.html.markdown new file mode 100644 index 0000000000..88d5862dbe --- /dev/null +++ b/website/docs/r/wedata_data_backfill_plan_operation.html.markdown @@ -0,0 +1,86 @@ +--- +subcategory: "Wedata" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_wedata_data_backfill_plan_operation" +sidebar_current: "docs-tencentcloud-resource-wedata_data_backfill_plan_operation" +description: |- + Provides a resource to create a WeData data backfill plan operation +--- + +# tencentcloud_wedata_data_backfill_plan_operation + +Provides a resource to create a WeData data backfill plan operation + +## Example Usage + +```hcl +resource "tencentcloud_wedata_data_backfill_plan_operation" "example" { + project_id = "20241107221758402" + task_ids = [ + "20250827115253729" + ] + + data_backfill_range_list { + start_date = "2025-09-02" + end_date = "2025-09-02" + } + + skip_event_listening = true +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_backfill_range_list` - (Required, List, ForceNew) Specifies the data time configuration for the backfill task. +* `project_id` - (Required, String, ForceNew) Project ID. +* `task_ids` - (Required, Set: [`String`], ForceNew) Backfill task collection. +* `check_parent_type` - (Optional, String, ForceNew) Check parent task type. valid values: NONE (do not check ALL), ALL (check ALL upstream parent tasks), MAKE_SCOPE (only check in the currently selected tasks of the backfill plan). default: NONE (do not check). +* `data_backfill_plan_name` - (Optional, String, ForceNew) Backfill plan name. if left empty, a string of characters is randomly generated by system. +* `data_time_order` - (Optional, String, ForceNew) Backfill Execution Order - The execution order for backfill instances based on their data time. Effective only when both conditions are met: + +1. Must be the same cycle task. + +2. Priority is given to dependency order. If no dependencies apply, execution follows the configured order. + +Valid values: + +-NORMAL: No specific order (default) + +-ORDER: Execute in chronological order + +-REVERSE: Execute in reverse chronological order. +* `integration_resource_group_id` - (Optional, String, ForceNew) Integration task resource group id. indicates usage of the original task scheduling execution resource group if empty. +* `redefine_cycle_type` - (Optional, String, ForceNew) Backfill Instance Regeneration Cycle - If set, this will redefine the generation cycle of backfill task instances. Currently, only daily instances can be converted into instances generated on the first day of each month. + +Valid value: + +MONTH_CYCLE: Monthly. +* `redefine_parallel_num` - (Optional, Int, ForceNew) Customizes the degree of concurrency for instance running. if without configuring, use the existing self-dependent of the task. +* `redefine_param_list` - (Optional, List, ForceNew) Custom parameter. re-specifies the task's parameters to facilitate the execution of new logic by replenished instances. +* `redefine_self_workflow_dependency` - (Optional, String, ForceNew) Custom workflow self-dependency. valid values: yes or no. if not configured, use the original workflow self-dependency. +* `scheduler_resource_group_id` - (Optional, String, ForceNew) Scheduling resource group id. if left empty, indicates usage of the original task scheduling execution resource group. +* `skip_event_listening` - (Optional, Bool, ForceNew) Specifies whether to ignore event dependency for backfill. default true. +* `time_zone` - (Optional, String, ForceNew) Time zone, default UTC+8. + +The `data_backfill_range_list` object supports the following: + +* `end_date` - (Optional, String) End date in the format yyyy-MM-dd, indicates ending at 23:59:59 of the specified date. +* `execution_end_time` - (Optional, String) End time point between [StartDate, EndDate] in HH:mm format. effective for tasks with a period of hours or less. +* `execution_start_time` - (Optional, String) Start time of each day between [StartDate, EndDate] in HH:mm format. effective for tasks with a period of hours or less. +* `start_date` - (Optional, String) Start date in yyyy-MM-dd format. indicates the start from 00:00:00 on the specified date. + +The `redefine_param_list` object supports the following: + +* `k` - (Optional, String) Key name. +* `v` - (Optional, String) The value. do not pass SQL (the request will be deemed as an attack on the api). if needed, transcode the SQL with Base64 and decode it. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 0c1829d857..f747a5b2b0 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -7146,12 +7146,18 @@