forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Resource: Dataflow Job (hashicorp#855)
Add support for Google Dataflow jobs Note: A dataflow job exists when it is in a nonterminal state, and does not exist if it is in a terminal state (or a non-running state which can only transition into terminal states). See doc for more detail.
- Loading branch information
1 parent
c72bc9d
commit 0c9b092
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
layout: "google" | ||
page_title: "Google: google_dataflow_job" | ||
sidebar_current: "docs-google-dataflow-job" | ||
description: |- | ||
Creates a job in Dataflow according to a provided config file. | ||
--- | ||
|
||
# google\_dataflow\_job | ||
|
||
Creates a job on Dataflow, which is an implementation of Apache Beam running on Google Compute Engine. For more information see | ||
the official documentation for | ||
[Beam](https://beam.apache.org) and [Dataflow](https://cloud.google.com/dataflow/). | ||
|
||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "google_dataflow_job" "big_data_job" { | ||
name = "dataflow-job" | ||
template_gcs_path = "gs://my-bucket/templates/template_file" | ||
temp_gcs_location = "gs://my-bucket/tmp_dir" | ||
parameters { | ||
foo = "bar" | ||
baz = "qux" | ||
} | ||
} | ||
``` | ||
|
||
## Note on "destroy" / "apply" | ||
There are many types of Dataflow jobs. Some Dataflow jobs run constantly, getting new data from (e.g.) a GCS bucket, and outputting data continuously. Some jobs process a set amount of data then terminate. All jobs can fail while running due to programming errors or other issues. In this way, Dataflow jobs are different from most other Terraform / Google resources. | ||
|
||
The Dataflow resource is considered 'existing' while it is in a nonterminal state. If it reaches a terminal state (e.g. 'FAILED', 'COMPLETE', 'CANCELLED'), it will be recreated on the next 'apply'. This is as expected for jobs which run continously, but may surprise users who use this resource for other kinds of Dataflow jobs. | ||
|
||
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 "cancelled", but if a user sets `on_delete` to `"drain"` in the configuration, you may experience a long wait for your `terraform destroy` to complete. | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) A unique name for the resource, required by Dataflow. | ||
* `template_gcs_path` - (Required) The GCS path to the Dataflow job template. | ||
* `temp_gcs_location` - (Required) A writeable location on GCS for the Dataflow job to dump its temporary data. | ||
|
||
- - - | ||
|
||
* `parameters` - (Optional) Key/Value pairs to be passed to the Dataflow job (as used in the template). | ||
* `max_workers` - (Optional) The number of workers permitted to work on the job. More workers may improve processing speed at additional cost. | ||
* `on_delete` - (Optional) One of "drain" or "cancel". Specifies behavior of deletion during `terraform destroy`. See above note. | ||
* `project` - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used. | ||
* `zone` - (Optional) The zone in which the created job should run. If it is not provided, the provider zone is used. | ||
|
||
## Attributes Reference | ||
|
||
* `state` - The current state of the resource, selected from the [JobState enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters