Skip to content

Commit 8aa0be9

Browse files
author
mikatong
committed
add force_delete
1 parent 2c021ba commit 8aa0be9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tencentcloud/services/wedata/resource_tc_wedata_workflow.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ func ResourceTencentCloudWedataWorkflow() *schema.Resource {
176176
Optional: true,
177177
Description: "Bundle Information.",
178178
},
179+
180+
"force_delete": {
181+
Type: schema.TypeBool,
182+
Optional: true,
183+
Default: false,
184+
Description: "Indicate whether to delete workflow instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.",
185+
},
179186
},
180187
}
181188
}
@@ -640,6 +647,24 @@ func resourceTencentCloudWedataWorkflowDelete(d *schema.ResourceData, meta inter
640647
return err
641648
}
642649

650+
forceDelete := d.Get("force_delete").(bool)
651+
if forceDelete {
652+
// removed from the recycle bin
653+
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
654+
result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseWedataV20250806Client().DeleteWorkflowWithContext(ctx, request)
655+
if e != nil {
656+
return tccommon.RetryError(e)
657+
} else {
658+
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
659+
}
660+
response = result
661+
return nil
662+
})
663+
if err != nil {
664+
log.Printf("[CRITAL]%s delete wedata workflow failed, reason:%+v", logId, err)
665+
return err
666+
}
667+
}
643668
_ = response
644669
_ = projectId
645670
return nil

0 commit comments

Comments
 (0)