Created
April 30, 2021 02:48
-
-
Save antoniocachuan/119f265538dd15ca9faae847aa053efd to your computer and use it in GitHub Desktop.
Launch Dataflow and write in Pub/Sub
This file contains hidden or 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
| main: | |
| steps: | |
| - init: | |
| assign: | |
| - project: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")} | |
| - region: "us-central1" | |
| - zone: "us-central1-a" | |
| - topic: "TOPIC_NAME" | |
| - job_name: "covid_job" | |
| - input_script: "gs://BUCKET_NAME/dataflow/template/templatefile" | |
| - temp_location: "gs://BUCKET_NAME/dataflow/tmp" | |
| - launchDataflow: | |
| call: googleapis.dataflow.v1b3.projects.locations.templates.create | |
| args: | |
| location: ${region} | |
| projectId: ${project} | |
| body: | |
| gcsPath: ${input_script} | |
| jobName: ${job_name} | |
| result: createResult | |
| - successTopic: | |
| call: googleapis.pubsub.v1.projects.topics.publish | |
| args: | |
| topic: ${"projects/" + project + "/topics/" + topic} | |
| body: | |
| messages: | |
| - data: ${base64.encode(text.encode("{\"message\":\"pipeline done\"}"))} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment