New to Kestra?
Use blueprints to kickstart your first workflows.
Self-service GCP VM ordering with Kestra. Slack notifies approvers, the run pauses for approval, Terraform provisions the VM, and inventory is updated.
Turn VM requests into a governed self-service workflow. A requester picks the account, zone, image, and size from dropdown inputs, an approver is pinged in Slack, and the execution pauses until someone explicitly approves. Only then does Terraform provision the Google Cloud instance, after which the VM is registered in a KV-backed inventory and the channel is notified with the external IP. Rejections fail the run with the recorded reason, so every decision is auditable.
SELECT inputs (billingAccount, region, zone, osFlavor, vmSize, env, vmType) present a controlled order form; zone uses dependsOn so only zones in the chosen region appear.requestApproval task (io.kestra.plugin.notifications.slack.SlackIncomingWebhook) posts the order summary and execution id to Slack.waitForApproval task (io.kestra.plugin.core.flow.Pause) suspends the run; on resume the approver provides approved (BOOL) and reason (STRING) via onResume inputs.proceedIfApproved task (io.kestra.plugin.core.flow.If) fails the execution with the rejection reason, or continues.generateHostname task (io.kestra.plugin.scripts.python.Script) builds a standardized hostname such as gcpdevlnxapp42 and a candidate IP; swap the stub for your CMDB or IPAM lookup.createVM task (io.kestra.plugin.terraform.cli.TerraformCLI) runs terraform init, plan, and apply against an inlined main.tf, authenticating with a service account key injected via inputFiles, then exports external_ip.txt.updateInventory task (io.kestra.plugin.core.kv.Set) stores the full VM record as JSON in the KV store, and notifyChannel posts the result back to Slack.Terraform alone cannot pause for a human decision, render an order form, or notify approvers. Kestra adds typed inputs with dependsOn cascading, a first-class Pause task with onResume inputs that capture who decided what and why, secrets management for the service account key, and full execution history linking the request, the approval, and the applied infrastructure.
GCP_SERVICE_ACCOUNT_JSON: full JSON key of the GCP service account used by Terraform.SLACK_WEBHOOK_URL: Slack incoming webhook used for approval requests and confirmations.SELECT input values to your real accounts, regions, networks, and sizes.approved: true.main.tf so a decommissioning flow can terraform destroy from the same state.io.kestra.plugin.core.trigger.Flow trigger on SUCCESS.waitForApproval in runIf: {{ inputs.env != 'dev' }}.io.kestra.plugin.ee.assets.VM).