You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: `Indicates if the job should use the streaming engine feature.`,
206
211
},
212
+
213
+
"skip_wait_on_job_termination": {
214
+
Type: schema.TypeBool,
215
+
Optional: true,
216
+
Default: false,
217
+
Description: `If true, treat DRAINING and CANCELLING as terminal job states and do not wait for further changes before removing from terraform state and moving on. WARNING: this will lead to job name conflicts if you do not ensure that the job names are different, e.g. by embedding a release ID or by using a random_id.`,
218
+
},
207
219
},
208
220
UseJSONNumber: true,
209
221
}
@@ -233,6 +245,16 @@ func resourceDataflowJobTypeCustomizeDiff(_ context.Context, d *schema.ResourceD
233
245
returnnil
234
246
}
235
247
248
+
// return true if a job is in a terminal state, OR if a job is in a
Copy file name to clipboardExpand all lines: website/docs/r/dataflow_job.html.markdown
+28
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,33 @@ The Dataflow resource is considered 'existing' while it is in a nonterminal stat
65
65
66
66
A Dataflow job which is 'destroyed' may be "cancelled" or "drained". If "cancelled", the job terminates - any data written remains where it is, but no new data will be processed. If "drained", no new data will enter the pipeline, but any data currently in the pipeline will finish being processed. The default is "drain". When `on_delete` is set to `"drain"` in the configuration, you may experience a long wait for your `terraform destroy` to complete.
67
67
68
+
You can potentially short-circuit the wait by setting `skip_wait_for_job_termination` to `true`, but beware that unless you take active steps to ensure that the job `name` parameter changes between instances, the name will conflict and the launch of the new job will fail. One way to do this is with a [random_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) resource, for example:
@@ -83,6 +110,7 @@ The following arguments are supported:
83
110
*`transform_name_mapping` - (Optional) Only applicable when updating a pipeline. Map of transform name prefixes of the job to be replaced with the corresponding name prefixes of the new job. This field is not used outside of update.
84
111
*`max_workers` - (Optional) The number of workers permitted to work on the job. More workers may improve processing speed at additional cost.
85
112
*`on_delete` - (Optional) One of "drain" or "cancel". Specifies behavior of deletion during `terraform destroy`. See above note.
113
+
*`skip_wait_for_job_termination` - (Optional) If set to `true`, terraform will treat `DRAINING` and `CANCELLING` as terminal states when deleting the resource, and will remove the resource from terraform state and move on. See above note.
86
114
*`project` - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.
87
115
*`zone` - (Optional) The zone in which the created job should run. If it is not provided, the provider zone is used.
88
116
*`region` - (Optional) The region in which the created job should run.
0 commit comments