Skip to content

Latest commit

 

History

History
 
 

basic

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Basic Terraform

This sample shows how to use Terraform's google_workflows_workflow resource to deploy a Workflow.

More specifically, this sample:

  1. Enables Workflows API.
  2. Creates a service account for Workflows to use.
  3. Deploys a workflow using Terraform.
  4. Executes the workflow with gcloud.

Terraform

You can see main.tf for the definition.

  1. Initialize terraform:

    terraform init
  2. See the planned changes:

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

    terraform apply -var="project_id=YOUR-PROJECT-ID"
  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"

Execute

You can optionally execute the workflow using gcloud:

gcloud workflows execute sample-workflow