Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

terraform-google-cloud-workflow-simple

This module is used to create a Workflow

The resources/services/activations/deletions that this module will create/trigger are:

  • Creates a Workflow

Usage

  • Usage of this module for creating a simple workflow :
module "cloud_workflow" {
  source  = "GoogleCloudPlatform/cloud-workflows/google"
  version = "~> 0.2"

  workflow_name         = "wf-sample"
  region                = "us-central1"
  service_account_email = "<svc_account>"
  workflow_source       = <<-EOF
  - getCurrentTime:
      call: http.get
      args:
          url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam
      result: CurrentDateTime
  - readWikipedia:
      call: http.get
      args:
          url: https://en.wikipedia.org/w/api.php
          query:
              action: opensearch
              search: $${CurrentDateTime.body.dayOfWeek}
      result: WikiResult
  - returnOutput:
      return: $${WikiResult.body[1]}
EOF
}

Functional examples are included in the examples directory.

Inputs

Name Description Type Default Required
location The name of the location where workflow will be created string n/a yes
project_id The project ID to deploy to string n/a yes
service_account_email Service account email. string null no
workflow_description Description for the cloud workflow string "" no
workflow_labels A set of key/value label pairs to assign to the workflow map(string) {} no
workflow_name The name of the cloud workflow to create string n/a yes
workflow_source Workflow YAML code to be executed. The size limit is 32KB. string n/a yes

Outputs

Name Description
revision_id The revision of the workflow. A new one is generated if the service account or source contents is changed.
workflow_id Workflow identifier for the resource with format projects/{{project}}/locations/{{region}}/workflows/{{name}}

Requirements

These sections describe requirements for using this module.

Software

The following dependencies must be available:

Service Account

A service account with the following roles must be used to provision the resources of this module:

  • Storage Admin: roles/storage.admin

The Project Factory module and the IAM module may be used in combination to provision a service account with the necessary roles applied.

APIs

A project with the following APIs enabled must be used to host the resources of this module:

  • Google Cloud Storage JSON API: storage-api.googleapis.com

The Project Factory module can be used to provision a project with the necessary APIs enabled.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Security Disclosures

Please see our security disclosure process.