0

Read csv file and load it to bigquery through dataflow job - use python coding for this instead of templates  How perform this task using terraform(GCP) anyone help

I trying to do it but not understanding what terraform script should I write for it

2
  • Terraform deploy resources, it runs nothing. Don't mix the usages! Commented Nov 14, 2022 at 10:25
  • What have you researched or tried, please read How to Ask. Commented May 12 at 16:02

1 Answer 1

1

It's not the responsability of Terraform to deploy a Dataflow job.

There is only a Terraform resource to instantiate a Dataflow template

You can deleguate this to your CI CD.

Example with Beam Python :

  • Develop the Job with Beam Python
  • Through your CI CD, deploy the Python Beam code to a Cloud Storage bucket
  • Run the Dataflow job and main file with Python command line

Example with Beam Java and mvn compile :

  • Develop the Job with Beam Java and Maven or Gradle
  • Through your CI CD, run mvn compile command to execute the Dataflow job

Example with Beam Java and a fat jar :

  • Develop the Job with Beam Java and Maven or Gradle
  • Through your CI CD, generate a fat jar
  • Deploy this fat jar to a Cloud Storage bucket
  • Run the Dataflow job and the Main inside the fat jar with java -jar command

Example with Beam Python and Airflow/Cloud Composer :

  • Develop the Job with Beam Python
  • Through your CI CD, deploy the Python Beam code to the Cloud Composer bucket with gcloud composer
  • In the Airflow code, uses BeamRunPythonPipelineOperator to instantiate the Dataflow job
  • Run the Airflow DAG to run the Dataflow job

Example with Beam Java and Airflow/Cloud Composer :

  • Develop the Job with Beam Java
  • Through your CI CD, generate a fat jar
  • Deploy this fat jar to a Cloud Storage bucket
  • In the Airflow code, uses BeamRunJavaPipelineOperator to instantiate the Dataflow job targeting on the path of the fat jar
  • Run the Airflow DAG to run the Dataflow job
Sign up to request clarification or add additional context in comments.

4 Comments

Hi Mazlum Tosun I have try it but not understanding which terraform scripts use for it so if u have any script for it can u provide please
Ok I am going to share with you some sample scripts.
Hi Mazlum Tosun , Thanks for ur help please share scripts
Hi Mazlum Tosun , Thanks for ur help please share scripts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.