WorkflowArgs

data class WorkflowArgs(val cryptoKeyName: Output<String>? = null, val description: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val serviceAccount: Output<String>? = null, val sourceContents: Output<String>? = null) : ConvertibleToJava<WorkflowArgs>

Workflow program to be executed by Workflows. To get more information about Workflow, see:

Example Usage

Workflow Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceAccount.Account;
import com.pulumi.gcp.serviceAccount.AccountArgs;
import com.pulumi.gcp.workflows.Workflow;
import com.pulumi.gcp.workflows.WorkflowArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testAccount = new Account("testAccount", AccountArgs.builder()
.accountId("my-account")
.displayName("Test Service Account")
.build());
var example = new Workflow("example", WorkflowArgs.builder()
.region("us-central1")
.description("Magic")
.serviceAccount(testAccount.id())
.sourceContents("""
# This is a sample workflow. You can replace it with your source code.
# This workflow does the following:
# - reads current time and date information from an external API and stores
# the response in currentTime variable
# - retrieves a list of Wikipedia articles related to the day of the week
# from currentTime
# - returns the list of articles as an output of the workflow
# Note: In Terraform you need to escape the $$ or it will cause errors.
- getCurrentTime:
call: http.get
args:
url: https://timeapi.io/api/Time/current/zone?timeZone=Europe/Amsterdam
result: currentTime
- readWikipedia:
call: http.get
args:
url: https://en.wikipedia.org/w/api.php
query:
action: opensearch
search: %s
result: wikiResult
- returnOutput:
return: %s
", currentTime.body().dayOfWeek(),wikiResult.body()[1]))
.build());
}
}

Import

This resource does not support import.

Constructors

Link copied to clipboard
constructor(cryptoKeyName: Output<String>? = null, description: Output<String>? = null, labels: Output<Map<String, String>>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, project: Output<String>? = null, region: Output<String>? = null, serviceAccount: Output<String>? = null, sourceContents: Output<String>? = null)

Properties

Link copied to clipboard
val cryptoKeyName: Output<String>? = null

The KMS key used to encrypt workflow and execution data. Format: projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}

Link copied to clipboard
val description: Output<String>? = null

Description of the workflow provided by the user. Must be at most 1000 unicode characters long.

Link copied to clipboard
val labels: Output<Map<String, String>>? = null

A set of key/value label pairs to assign to this Workflow.

Link copied to clipboard
val name: Output<String>? = null

Name of the Workflow.

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates a unique name beginning with the specified prefix. If this and name are unspecified, a random value is chosen for the name.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val region: Output<String>? = null

The region of the workflow.

Link copied to clipboard
val serviceAccount: Output<String>? = null

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} or {account}. Using - as a wildcard for the {project} or not providing one at all will infer the project from the account. The {account} value can be the email address or the unique_id of the service account. If not provided, workflow will use the project's default service account. Modifying this field for an existing workflow results in a new workflow revision.

Link copied to clipboard
val sourceContents: Output<String>? = null

Workflow code to be executed. The size limit is 32KB.

Functions

Link copied to clipboard
open override fun toJava(): WorkflowArgs