This sample shows how to use Terraform's google_workflows_workflow resource to deploy a Workflow.
More specifically, this sample:
- Enables Workflows API.
- Creates a service account for Workflows to use.
- Deploys a workflow using Terraform.
- Executes the workflow with gcloud.
You can see main.tf for the definition.
-
Initialize terraform:
terraform init
-
See the planned changes:
terraform plan -var="project_id=YOUR-PROJECT-ID"
-
Create workflow:
terraform apply -var="project_id=YOUR-PROJECT-ID"
-
Once workflow is created, you can see it in the list:
gcloud workflows list --location YOUR-GCP-REGION
-
Cleanup:
terraform destroy -var="project_id=YOUR-PROJECT-ID"
You can optionally execute the workflow using gcloud:
gcloud workflows execute sample-workflow