Log icon

Create a VM Bound to a License Asset

Provision a VM whose license is selected from the Kestra asset catalog at runtime, registering both the VM asset and its license dependency for lineage.

Categories
Infrastructure

License management is where infrastructure automation usually goes untracked: a VM gets built against a Windows or database license and nobody records the link. This blueprint provisions a virtual machine and binds it to an existing io.kestra.plugin.ee.assets.VM.License asset chosen at execution time. The license shows up as an input asset and the VM as an output asset, so the catalog knows exactly which machines consume which licenses, and cleanup flows can later find every VM that depends on a revoked license.

How it works

  1. The vm_name input names the machine to create.
  2. The license input is a dynamic SELECT: its expression calls the assets() Pebble function with type = 'io.kestra.plugin.ee.assets.VM.License' and extracts the ids with jq('.[].id'). The operator picks a real license from the catalog, not a free-text string.
  3. The gcp_create_instance task simulates provisioning with io.kestra.plugin.core.log.Log. It declares the chosen license as an assets.inputs entry and registers the new machine as an assets.outputs entry of type io.kestra.plugin.ee.assets.VM with os, region, status, and name metadata.
  4. The catalog now holds a lineage edge from license to VM that any audit or cleanup flow can traverse.

What you get

  • A VM asset whose lineage points back to the exact license it consumes.
  • A dropdown of real licenses at execution time, populated live from the asset catalog.
  • The data foundation for license compliance flows, for example purging VMs when a license is deleted.
  • A copyable pattern for typed, dynamic SELECT inputs driven by assets().

Who it's for

  • IT asset managers who must prove which machines run against which licenses.
  • Platform engineers automating VM provisioning with governance requirements.
  • Compliance teams preparing for software license audits.

Why orchestrate this with Kestra

Provisioning tools create machines; they do not maintain a queryable link between machines and the licenses, certificates, or IPs they consume. Kestra Assets record those relationships automatically as flows execute, and the assets() function makes the catalog available inside inputs and tasks. Add triggers, retries, RBAC, and full execution history, and license-aware provisioning becomes a governed workflow instead of tribal knowledge.

Prerequisites

  • A Kestra Enterprise Edition instance (Assets are an EE feature).
  • At least one io.kestra.plugin.ee.assets.VM.License asset already registered, otherwise the license dropdown is empty. A simple flow with an assets.outputs entry of that type creates one.

Secrets

  • None required by the stub. Add your cloud credentials as secrets when you replace the Log task with a real provisioning call.

Quick start

  1. Register at least one VM.License asset in your instance.
  2. Import this blueprint and execute it, picking a license from the dropdown.
  3. Open the Assets view and inspect the new VM asset and its lineage edge to the license.
  4. Pair with asset-cleanup-license-vms to automatically purge VMs when a license is removed.

How to extend

  • Replace the Log stub with io.kestra.plugin.gcp.cli.GCloudCLI or io.kestra.plugin.aws.cli.AwsCLI to actually create the instance.
  • Copy the license id into the VM metadata (for example licenseId) so metadata queries can find dependent VMs without walking lineage.
  • Add a validation task that fails the run when the selected license has expired metadata.
  • Trigger from a webhook to let a self-service portal request licensed VMs.

Links

Tasks
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.