Skip to content

Latest commit

 

History

History

import-multiple-yamls

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Workflows Terraform with multiple external YAMLs

This sample shows how to use Terraform's google_workflows_workflow resource to deploy a Workflow split across a main workflow YAML file and a subflow YAML file.

Terraform

You can see main.tf for Terraform, workflow.yaml for the main workflow YAML file and subworkflow.yaml for the subworkflow YAML file used by the main workflow.

  1. Initialize terraform:

    terraform init
  2. See the planned changes:

    terraform plan -var="project_id=YOUR-PROJECT-ID" -var="region=YOUR-GCP-REGION"
  3. Create workflow:

    terraform apply -var="project_id=YOUR-PROJECT-ID" -var="region=YOUR-GCP-REGION"
  4. Once workflow is created, you can see it in the list:

    gcloud workflows list --location YOUR-GCP-REGION
  5. Cleanup:

    terraform destroy -var="project_id=YOUR-PROJECT-ID" -var="region=YOUR-GCP-REGION"

Execute

You can optionally execute the workflow using gcloud:

gcloud workflows execute sample-workflow

Thanks to Jamie Thomson @jamiet for the templatefile idea.