googleWorkflowsWorkflow
Workflow program to be executed by Workflows.
To get more information about Workflow, see:
- API documentation
- How-to Guides
- Managing Workflows
Example Usage - Workflow Basic
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleServiceAccountTestAccount =
new google.serviceAccount.ServiceAccount(this, "test_account", {
account_id: "my-account",
display_name: "Test Service Account",
});
new google.workflowsWorkflow.WorkflowsWorkflow(this, "example", {
description: "Magic",
name: "workflow",
region: "us-central1",
service_account: googleServiceAccountTestAccount.id,
source_contents:
"# This is a sample workflow, feel free to replace it with your source code\n#\n# This workflow does the following:\n# - reads current time and date information from an external API and stores\n# the response in CurrentDateTime variable\n# - retrieves a list of Wikipedia articles related to the day of the week\n# from CurrentDateTime\n# - returns the list of articles as an output of the workflow\n# FYI, In terraform you need to escape the $$ or it will cause errors.\n\n- getCurrentTime:\n call: http.get\n args:\n url: https://us-central1-workflowsample.cloudfunctions.net/datetime\n result: CurrentDateTime\n- readWikipedia:\n call: http.get\n args:\n url: https://en.wikipedia.org/w/api.php\n query:\n action: opensearch\n search: ${CurrentDateTime.body.dayOfTheWeek}\n result: WikiResult\n- returnOutput:\n return: ${WikiResult.body[1]}\n",
});
Argument Reference
The following arguments are supported:
-
name
- (Optional) Name of the Workflow. -
description
- (Optional) Description of the workflow provided by the user. Must be at most 1000 unicode characters long. -
labels
- (Optional) A set of key/value label pairs to assign to this Workflow. -
serviceAccount
- (Optional) Name of the service account associated with the latest workflow version. This service account represents the identity of the workflow and determines what permissions the workflow has. Format: projects/{project}/serviceAccounts/{account}. -
sourceContents
- (Optional) Workflow code to be executed. The size limit is 32KB. -
region
- (Optional) The region of the workflow. -
project
- (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. -
namePrefix
- (Optional) Creates a unique name beginning with the specified prefix. If this and name are unspecified, a random value is chosen for the name.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
-
id
- an identifier for the resource with formatprojects/{{project}}/locations/{{region}}/workflows/{{name}}
-
createTime
- The timestamp of when the workflow was created in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. -
updateTime
- The timestamp of when the workflow was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. -
state
- State of the workflow deployment. -
revisionId
- The revision of the workflow. A new one is generated if the service account or source contents is changed.
Timeouts
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.
Import
This resource does not support import.
User Project Overrides
This resource supports User Project Overrides.