New to Kestra?
Use blueprints to kickstart your first workflows.
Provision Google Cloud VMs with Terraform and Kestra. Generate standardized hostnames, reserve IPs from IPAM, apply with Terraform, and notify Slack.
Provision Google Cloud Compute Engine virtual machines on demand with an Infrastructure as Code workflow that turns a self-service form into a fully governed VM. This blueprint generates a standardized hostname, reserves an IP address from an external IPAM, applies a Terraform configuration to create the instance, and posts the results to Slack. It solves the messy reality of cloud VM provisioning, where naming drifts, IP conflicts happen, and nobody knows a machine exists until someone asks.
generateCustomHostname runs an io.kestra.plugin.scripts.python.Script task that builds a hostname from the cloud provider, environment, OS, and VM type inputs, plus a numeric index pulled from Kestra KV (kv('getVMIndex')).getIPAddress runs another io.kestra.plugin.scripts.python.Script task that calls your external IPAM API to reserve the first free IP in the selected subnet.createVM uses io.kestra.plugin.terraform.cli.TerraformCLI with inline main.tf to run terraform init, plan, and apply -auto-approve, creating a google_compute_instance and writing the external IP to an output file.notifyChannel sends an io.kestra.plugin.slack.notifications.SlackIncomingWebhook message with the hostname, external IP, default user, and full machine configuration.incrementindex uses io.kestra.plugin.core.kv.Set to bump the VM index so the next provisioning run gets a unique name.init, plan, and apply in one task.Terraform applies infrastructure, but it has no scheduler, no event triggers, and no built-in way to chain a hostname generator, an IPAM lookup, and a Slack notification around an apply. Kestra wraps the apply in a declarative YAML flow with retries, full execution lineage, and an input form that non-experts can drive. The KV store keeps stateful naming between runs, something a bare terraform apply cannot do on its own.
ipamAddress KV).GCP_SVC_ACCOUNT: service account JSON used by Terraform as GOOGLE_APPLICATION_CREDENTIALS.SSH_PUB_KEY: public key injected into the VM metadata.SLACK_WEBHOOK (in the system namespace): incoming webhook URL for notifications.SSH_VM_USER: default user reported in the Slack message.ipamAddress KV (and optionally getVMIndex) for your environment.main.tf inputs and select lists to match your project, networks, and machine types.terraform destroy for teardown.apply.