Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add machine_type configuration to google_dataflow_job #1834

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions google/resource_dataflow_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ func resourceDataflowJob() *schema.Resource {
ForceNew: true,
},

"machine_type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},

"max_workers": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -106,6 +112,7 @@ func resourceDataflowJobCreate(d *schema.ResourceData, meta interface{}) error {
TempLocation: d.Get("temp_gcs_location").(string),
Zone: zone,
MaxWorkers: int64(d.Get("max_workers").(int)),
MachineType: d.Get("machine_type").(string),
}

request := dataflow.CreateJobFromTemplateRequest{
Expand Down
1 change: 1 addition & 0 deletions google/resource_dataflow_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ resource "google_dataflow_job" "big_data" {
}
zone = "us-central1-f"
project = "%s"
machine_type = "n1-standard-1"

on_delete = "cancel"
}`, acctest.RandString(10), acctest.RandString(10), getTestProjectFromEnv())
1 change: 1 addition & 0 deletions website/docs/r/dataflow_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The following arguments are supported:
* `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.
* `machine_type` - (Optional) The machine type for Google Compute Engine instances used in your pipeline execution. E.g., n1-standard-1.

## Attributes Reference

Expand Down