New to Kestra?
Use blueprints to kickstart your first workflows.
Select a VM from the Kestra Assets catalog, destroy it with Terraform using the original provisioning state, and mark the asset deleted.
Close the loop on VM lifecycle management. Instead of asking operators to remember instance names, zones, and projects, this blueprint presents a dropdown populated live from the Kestra Assets catalog. Selecting a VM pulls its full metadata (name, size, zone, project, network) from the asset record, Terraform destroys the instance against the same remote state that created it, and the asset is updated to state: deleted so the catalog reflects reality.
vmAssetId input uses a dynamic expression with the assets() function to list every asset of type io.kestra.plugin.ee.assets.VM, so the operator picks from real, tracked machines.vmMetadata task (io.kestra.plugin.core.output.OutputValues) fetches the selected asset and exposes its metadata JSON.destroyVM task (io.kestra.plugin.terraform.cli.TerraformCLI) reconstructs the original configuration from the asset metadata via fromJson(...), runs terraform init against the shared GCS backend with the VM name as the state prefix, then terraform destroy -auto-approve -json.assets block declares the asset as an input (lineage) and writes it back with state: deleted, keeping the catalog authoritative.Terraform state alone does not tell you which VMs exist, who created them, or when they were removed. Kestra's asset catalog does: the dropdown is generated from live asset data, the destroy consumes the exact metadata recorded at provisioning time, and the resulting state change is written back with full execution lineage. Add a Pause task and you have a complete, auditable decommissioning process.
io.kestra.plugin.ee.assets.VM assets with metadata fields vmName, vmSize, zone, billingAccount, osFlavor, network, subnet.GCP_SERVICE_ACCOUNT_JSON: JSON key of the GCP service account allowed to delete instances and read the state bucket.backend.tf bucket with your real Terraform state bucket and align main.tf with your provisioning configuration.state: deleted.io.kestra.plugin.core.flow.Pause approval gate before destroyVM for production assets.io.kestra.plugin.notifications.slack.SlackIncomingWebhook after teardown.io.kestra.plugin.ansible.cli.AnsibleCLI to remove A and PTR records.