hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Create google_dataproc_workflow_template without job #12843

Open cloudifyme opened 2 years ago

cloudifyme commented 2 years ago

Community Note

Description

In GCP, the dataproc workflow templates can be created without attaching the jobs. Later the jobs can be attached and template can be instantiated. As the API of dataproc workflow template has been changed, need enhancement to the terraform module to allow dataproc workflow template creation without attaching the job.

Current behaviour:

Attaching a job is mandatory in Terraform while creating dataproc_workflow_template resource.

Error: Insufficient jobs blocks
on dataproc-workflow.tf line 2, in resource "google_dataproc_workflow_template" "template":
resource "google_dataproc_workflow_template" "template" {
At least 1 "jobs" blocks are required.

Previously a bug was raised to fix this issue but due to API changes, enhancement request has been raised to fix this problem. Bug Link: https://github.com/hashicorp/terraform-provider-google/issues/12783

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_dataproc_workflow_template" "template" {
  name = "test-tfe-example1"
  location = "us-central1"
  project  = "test-project"
  placement {
    managed_cluster {
      cluster_name = "test-bucket"
      config {
          staging_bucket = "test-bucket-staging"
          temp_bucket    = "test-bucket-temp"
        gce_cluster_config {
          internal_ip_only       = true
          zone = "us-central1-a"
          tags = ["foo", "bar"]
        }
        endpoint_config {
      enable_http_port_access = "false"
    }
      }
    }
  } 
}

References

rileykarson commented 2 years ago

@melinath to triage

rileykarson commented 1 year ago

google_dataproc_workflow_template is an unusual resource, given it creates a template and then kicks it off. I'm not sure how useful this resource would end up being; there's probably some design thinking in implementing it.