|
| 1 | +--- |
| 2 | +subcategory: "Wedata" |
| 3 | +layout: "tencentcloud" |
| 4 | +page_title: "TencentCloud: tencentcloud_wedata_task" |
| 5 | +sidebar_current: "docs-tencentcloud-resource-wedata_task" |
| 6 | +description: |- |
| 7 | + Provides a resource to create a wedata wedata_task |
| 8 | +--- |
| 9 | + |
| 10 | +# tencentcloud_wedata_task |
| 11 | + |
| 12 | +Provides a resource to create a wedata wedata_task |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +```hcl |
| 17 | +resource "tencentcloud_wedata_workflow_folder" "wedata_workflow_folder" { |
| 18 | + project_id = "2905622749543821312" |
| 19 | + parent_folder_path = "/" |
| 20 | + folder_name = "tftest" |
| 21 | +} |
| 22 | +
|
| 23 | +resource "tencentcloud_wedata_workflow" "wedata_workflow" { |
| 24 | + project_id = 2905622749543821312 |
| 25 | + workflow_name = "test_workflow1" |
| 26 | + parent_folder_path = "${tencentcloud_wedata_workflow_folder.wedata_workflow_folder.parent_folder_path}${tencentcloud_wedata_workflow_folder.wedata_workflow_folder.folder_name}" |
| 27 | + workflow_type = "cycle" |
| 28 | +} |
| 29 | +
|
| 30 | +resource "tencentcloud_wedata_task" "wedata_task" { |
| 31 | + project_id = 2905622749543821312 |
| 32 | + task_base_attribute { |
| 33 | + task_name = "tfTask" |
| 34 | + task_type_id = 30 |
| 35 | + workflow_id = tencentcloud_wedata_workflow.wedata_workflow.workflow_id |
| 36 | + } |
| 37 | + task_configuration { |
| 38 | + code_content = "IyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiMKIyNhdXRob3I6IEFQSV9URVNUCiMjY3JlYXRlIHRpbWU6IDIwMjUtMTAtMTMgMTc6MjY6MTcKIyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiMK" |
| 39 | + task_ext_configuration_list { |
| 40 | + param_key = "bucket" |
| 41 | + param_value = "wedata-fusion-bjjr-1257305158" |
| 42 | + } |
| 43 | + task_ext_configuration_list { |
| 44 | + param_key = "ftp.file.name" |
| 45 | + param_value = "/datastudio/project/2905622749543821312/tftest/test_workflow1/tfTask.py" |
| 46 | + } |
| 47 | + task_ext_configuration_list { |
| 48 | + param_key = "tenantId" |
| 49 | + param_value = "1257305158" |
| 50 | + } |
| 51 | + task_ext_configuration_list { |
| 52 | + param_key = "region" |
| 53 | + param_value = "ap-beijing-fsi" |
| 54 | + } |
| 55 | + task_ext_configuration_list { |
| 56 | + param_key = "extraInfo" |
| 57 | + param_value = "{\"fromMapping\":false}" |
| 58 | + } |
| 59 | + task_ext_configuration_list { |
| 60 | + param_key = "ssmDynamicSkSwitch" |
| 61 | + param_value = "ON" |
| 62 | + } |
| 63 | + task_ext_configuration_list { |
| 64 | + param_key = "calendar_open" |
| 65 | + param_value = "0" |
| 66 | + } |
| 67 | + task_ext_configuration_list { |
| 68 | + param_key = "specLabelConfItems" |
| 69 | + param_value = "eyJzcGVjTGFiZWxDb25mSXRlbXMiOltdfQ==" |
| 70 | + } |
| 71 | + task_ext_configuration_list { |
| 72 | + param_key = "waitExecutionTotalTTL" |
| 73 | + param_value = "-1" |
| 74 | + } |
| 75 | + } |
| 76 | + task_scheduler_configuration { |
| 77 | + cycle_type = "DAY_CYCLE" |
| 78 | + } |
| 79 | +} |
| 80 | +``` |
| 81 | + |
| 82 | +## Argument Reference |
| 83 | + |
| 84 | +The following arguments are supported: |
| 85 | + |
| 86 | +* `project_id` - (Required, String) Project ID. |
| 87 | +* `task_base_attribute` - (Required, List) Basic task attributes. |
| 88 | +* `task_configuration` - (Required, List) Task configuration. |
| 89 | +* `task_scheduler_configuration` - (Required, List) Task scheduling configuration. |
| 90 | + |
| 91 | +The `dependency_strategy` object of `upstream_dependency_config_list` supports the following: |
| 92 | + |
| 93 | +* `polling_null_strategy` - (Optional, String) Strategy for waiting for upstream task instances: EXECUTING; WAITING. |
| 94 | +* `task_dependency_executing_strategies` - (Optional, Set) This field is required only when PollingNullStrategy is EXECUTING, List type: NOT_EXIST (default, when minute depends on minute/hour depends on hour, parent instance is not within the downstream instance scheduling time range); PARENT_EXPIRED (parent instance failed); PARENT_TIMEOUT (parent instance timed out). If any of the above scenarios is met, the parent task instance dependency judgment can be passed; otherwise, it is necessary to wait for the parent instance. |
| 95 | +* `task_dependency_executing_timeout_value` - (Optional, Int) This field is required only when TaskDependencyExecutingStrategies contains PARENT_TIMEOUT, the timeout time for downstream tasks depending on parent instance execution, unit: minutes. |
| 96 | + |
| 97 | +The `event_listener_list` object of `task_scheduler_configuration` supports the following: |
| 98 | + |
| 99 | +* `event_broadcast_type` - (Required, String) Event broadcast type: SINGLE, BROADCAST. |
| 100 | +* `event_name` - (Required, String) Event name. |
| 101 | +* `event_sub_type` - (Required, String) Event cycle: SECOND, MIN, HOUR, DAY. |
| 102 | +* `properties_list` - (Optional, List) Extended information. |
| 103 | + |
| 104 | +The `param_task_in_list` object of `task_scheduler_configuration` supports the following: |
| 105 | + |
| 106 | +* `from_param_key` - (Required, String) Parent task parameter key. |
| 107 | +* `from_task_id` - (Required, String) Parent task ID. |
| 108 | +* `param_desc` - (Required, String) Parameter description: format is project_identifier.task_name.parameter_name; example: project_wedata_1.sh_250820_104107.pp_out. |
| 109 | +* `param_key` - (Required, String) Parameter name. |
| 110 | + |
| 111 | +The `param_task_out_list` object of `task_scheduler_configuration` supports the following: |
| 112 | + |
| 113 | +* `param_key` - (Required, String) Parameter name. |
| 114 | +* `param_value` - (Required, String) Parameter definition. |
| 115 | + |
| 116 | +The `properties_list` object of `event_listener_list` supports the following: |
| 117 | + |
| 118 | +* `param_key` - (Required, String) Parameter name. |
| 119 | +* `param_value` - (Required, String) Parameter value. |
| 120 | + |
| 121 | +The `task_base_attribute` object supports the following: |
| 122 | + |
| 123 | +* `task_name` - (Required, String) Task name. |
| 124 | +* `task_type_id` - (Required, String) Task type ID: |
| 125 | + |
| 126 | +* 21:JDBC SQL |
| 127 | +* 23:TDSQL-PostgreSQL |
| 128 | +* 26:OfflineSynchronization |
| 129 | +* 30:Python |
| 130 | +* 31:PySpark |
| 131 | +* 32:DLC SQL |
| 132 | +* 33:Impala |
| 133 | +* 34:Hive SQL |
| 134 | +* 35:Shell |
| 135 | +* 36:Spark SQL |
| 136 | +* 38:Shell Form Mode |
| 137 | +* 39:Spark |
| 138 | +* 40:TCHouse-P |
| 139 | +* 41:Kettle |
| 140 | +* 42:Tchouse-X |
| 141 | +* 43:TCHouse-X SQL |
| 142 | +* 46:DLC Spark |
| 143 | +* 47:TiOne |
| 144 | +* 48:Trino |
| 145 | +* 50:DLC PySpark |
| 146 | +* 92:MapReduce |
| 147 | +* 130:Branch Node |
| 148 | +* 131:Merged Node |
| 149 | +* 132:Notebook |
| 150 | +* 133:SSH |
| 151 | +* 134:StarRocks |
| 152 | +* 137:For-each |
| 153 | +* 138:Setats SQL. |
| 154 | +* `workflow_id` - (Required, String) Workflow ID. |
| 155 | +* `owner_uin` - (Optional, String) Task owner ID, defaults to current user. |
| 156 | +* `task_description` - (Optional, String) Task description. |
| 157 | + |
| 158 | +The `task_configuration` object supports the following: |
| 159 | + |
| 160 | +* `broker_ip` - (Optional, String) Specified running node. |
| 161 | +* `bundle_id` - (Optional, String) ID used by Bundle. |
| 162 | +* `bundle_info` - (Optional, String) Bundle information. |
| 163 | +* `code_content` - (Optional, String) Base64 encoded code content. |
| 164 | +* `data_cluster` - (Optional, String) Cluster ID. |
| 165 | +* `resource_group` - (Optional, String) Resource group ID: Need to obtain ExecutorGroupId via DescribeNormalSchedulerExecutorGroups. |
| 166 | +* `source_service_id` - (Optional, String) Source data source ID, separated by `;`, need to obtain via DescribeDataSourceWithoutInfo. |
| 167 | +* `target_service_id` - (Optional, String) Target data source ID, separated by `;`, need to obtain via DescribeDataSourceWithoutInfo. |
| 168 | +* `task_ext_configuration_list` - (Optional, Set) Task extended attribute configuration list. |
| 169 | +* `task_scheduling_parameter_list` - (Optional, Set) Scheduling parameters. |
| 170 | +* `yarn_queue` - (Optional, String) Resource pool queue name, need to obtain via DescribeProjectClusterQueues. |
| 171 | + |
| 172 | +The `task_ext_configuration_list` object of `task_configuration` supports the following: |
| 173 | + |
| 174 | +* `param_key` - (Required, String) Parameter name. |
| 175 | +* `param_value` - (Required, String) Parameter value. |
| 176 | + |
| 177 | +The `task_output_registry_list` object of `task_scheduler_configuration` supports the following: |
| 178 | + |
| 179 | +* `data_flow_type` - (Required, String) Input/output table type |
| 180 | + Input stream |
| 181 | + UPSTREAM, |
| 182 | + Output stream |
| 183 | + DOWNSTREAM. |
| 184 | +* `database_name` - (Required, String) Database name. |
| 185 | +* `datasource_id` - (Required, String) Data source ID. |
| 186 | +* `partition_name` - (Required, String) Partition name. |
| 187 | +* `table_name` - (Required, String) Table name. |
| 188 | +* `table_physical_id` - (Required, String) Table physical unique ID. |
| 189 | +* `db_guid` - (Optional, String) Database unique identifier. |
| 190 | +* `table_guid` - (Optional, String) Table unique identifier. |
| 191 | + |
| 192 | +The `task_scheduler_configuration` object supports the following: |
| 193 | + |
| 194 | +* `allow_redo_type` - (Optional, String) Rerun & backfill configuration, defaults to ALL; ALL: can rerun or backfill after success or failure; FAILURE: cannot rerun or backfill after success, can rerun or backfill after failure; NONE: cannot rerun or backfill after success or failure. |
| 195 | +* `calendar_id` - (Optional, String) Calendar scheduling calendar ID. |
| 196 | +* `calendar_open` - (Optional, String) Calendar scheduling: Values are 0 and 1, 1 for enabled, 0 for disabled, defaults to 0. |
| 197 | +* `crontab_expression` - (Optional, String) Cron expression, defaults to 0 0 0 * * `?` *. |
| 198 | +* `cycle_type` - (Optional, String) Cycle type: Defaults to DAY_CYCLE. |
| 199 | + |
| 200 | +Supported types are |
| 201 | + |
| 202 | +* ONEOFF_CYCLE: One-time |
| 203 | +* YEAR_CYCLE: Yearly |
| 204 | +* MONTH_CYCLE: Monthly |
| 205 | +* WEEK_CYCLE: Weekly |
| 206 | +* DAY_CYCLE: Daily |
| 207 | +* HOUR_CYCLE: Hourly |
| 208 | +* MINUTE_CYCLE: Minutely |
| 209 | +* CRONTAB_CYCLE: Crontab expression type. |
| 210 | +* `end_time` - (Optional, String) End date, defaults to 2099-12-31 23:59:59. |
| 211 | +* `event_listener_list` - (Optional, List) Event array. |
| 212 | +* `execution_end_time` - (Optional, String) Execution time right-closed interval, default 23:59. |
| 213 | +* `execution_start_time` - (Optional, String) Execution time left-closed interval, default 00:00. |
| 214 | +* `execution_ttl` - (Optional, String) Timeout handling strategy - running time timeout (unit: minutes) defaults to -1. |
| 215 | +* `init_strategy` - (Optional, String) **Instance generation strategy** |
| 216 | +* T_PLUS_0: T+0 generation, default strategy |
| 217 | +* T_PLUS_1: T+1 generation. |
| 218 | +* `max_retry_attempts` - (Optional, String) Retry strategy - maximum number of attempts, default: 4. |
| 219 | +* `param_task_in_list` - (Optional, List) Input parameter array. |
| 220 | +* `param_task_out_list` - (Optional, List) Output parameter array. |
| 221 | +* `retry_wait` - (Optional, String) Retry strategy - retry waiting time, unit: minutes: default: 5. |
| 222 | +* `run_priority` - (Optional, String) Task scheduling priority: 4 for high, 5 for medium, 6 for low, default: 6. |
| 223 | +* `schedule_run_type` - (Optional, String) Scheduling type: 0 Normal scheduling 1 Empty run scheduling, defaults to 0. |
| 224 | +* `schedule_time_zone` - (Optional, String) Time zone, defaults to UTC+8. |
| 225 | +* `self_depend` - (Optional, String) Self-dependency, default value serial, values: parallel, serial, orderly. |
| 226 | +* `start_time` - (Optional, String) Effective date, defaults to 00:00:00 of current date. |
| 227 | +* `task_output_registry_list` - (Optional, List) Output registration. |
| 228 | +* `upstream_dependency_config_list` - (Optional, List) Upstream dependency array. |
| 229 | +* `wait_execution_total_ttl` - (Optional, String) Timeout handling strategy - total waiting time timeout (unit: minutes) defaults to -1. |
| 230 | + |
| 231 | +The `task_scheduling_parameter_list` object of `task_configuration` supports the following: |
| 232 | + |
| 233 | +* `param_key` - (Required, String) Parameter name. |
| 234 | +* `param_value` - (Required, String) Parameter value. |
| 235 | + |
| 236 | +The `upstream_dependency_config_list` object of `task_scheduler_configuration` supports the following: |
| 237 | + |
| 238 | +* `main_cyclic_config` - (Required, String) Main dependency configuration, values: |
| 239 | + |
| 240 | +* CRONTAB |
| 241 | +* DAY |
| 242 | +* HOUR |
| 243 | +* LIST_DAY |
| 244 | +* LIST_HOUR |
| 245 | +* LIST_MINUTE |
| 246 | +* MINUTE |
| 247 | +* MONTH |
| 248 | +* RANGE_DAY |
| 249 | +* RANGE_HOUR |
| 250 | +* RANGE_MINUTE |
| 251 | +* WEEK |
| 252 | +* YEAR. |
| 253 | +* `task_id` - (Required, String) Task ID. |
| 254 | +* `dependency_strategy` - (Optional, List) Dependency execution strategy. |
| 255 | +* `offset` - (Optional, String) Offset in interval and list modes. |
| 256 | +* `subordinate_cyclic_config` - (Optional, String) Secondary dependency configuration, values: |
| 257 | +* ALL_DAY_OF_YEAR |
| 258 | +* ALL_MONTH_OF_YEAR |
| 259 | +* CURRENT |
| 260 | +* CURRENT_DAY |
| 261 | +* CURRENT_HOUR |
| 262 | +* CURRENT_MINUTE |
| 263 | +* CURRENT_MONTH |
| 264 | +* CURRENT_WEEK |
| 265 | +* CURRENT_YEAR |
| 266 | +* PREVIOUS_BEGIN_OF_MONTH |
| 267 | +* PREVIOUS_DAY |
| 268 | +* PREVIOUS_DAY_LATER_OFFSET_HOUR |
| 269 | +* PREVIOUS_DAY_LATER_OFFSET_MINUTE |
| 270 | +* PREVIOUS_END_OF_MONTH |
| 271 | +* PREVIOUS_FRIDAY |
| 272 | +* PREVIOUS_HOUR |
| 273 | +* PREVIOUS_HOUR_CYCLE |
| 274 | +* PREVIOUS_HOUR_LATER_OFFSET_MINUTE |
| 275 | +* PREVIOUS_MINUTE_CYCLE |
| 276 | +* PREVIOUS_MONTH |
| 277 | +* PREVIOUS_WEEK |
| 278 | +* PREVIOUS_WEEKEND |
| 279 | +* RECENT_DATE. |
| 280 | + |
| 281 | +## Attributes Reference |
| 282 | + |
| 283 | +In addition to all arguments above, the following attributes are exported: |
| 284 | + |
| 285 | +* `id` - ID of the resource. |
| 286 | + |
| 287 | + |
| 288 | + |
| 289 | +## Import |
| 290 | + |
| 291 | +wedata wedata_task can be imported using the id, e.g. |
| 292 | + |
| 293 | +``` |
| 294 | +terraform import tencentcloud_wedata_task.wedata_task wedata_task_id |
| 295 | +``` |
| 296 | + |
0 commit comments