New to Kestra?
Use blueprints to kickstart your first workflows.
Enforce droplet governance on DigitalOcean with Kestra. Detect every new droplet within minutes, power off machines that violate naming policy, and alert Slack.
Catch shadow infrastructure minutes after it appears. This blueprint uses the DigitalOcean droplet trigger to fire one execution for every new droplet detected on the account, then applies a simple governance rule: droplet names must start with an approved environment prefix such as web-, db-, worker-, or staging-. Machines that pass are logged for audit; machines that fail are powered off, not deleted, and reported to Slack so a human decides whether to rename and revive them or remove them. Powering off instead of deleting keeps the guard safe to run even when the policy has false positives.
on_new_droplet (io.kestra.plugin.digitalocean.droplet.Trigger) polls the account every 5 minutes and starts an execution per droplet it has not seen before, exposing trigger.id, trigger.name, trigger.region, trigger.status, and trigger.createdAt.evaluate_naming_policy (io.kestra.plugin.core.flow.If) extracts the first hyphen-separated segment of the droplet name and checks it against the approved prefix list.power_off_rogue (io.kestra.plugin.digitalocean.droplet.Action) sends a POWER_OFF action, containing the machine while preserving its disk, and alert_security posts the droplet's full identity to Slack with instructions for the reviewer.log_compliant writes an audit log line, so the execution history doubles as a record of every droplet that ever joined the account.errors block raises a distinct alert when the guard itself breaks, because a silently failing guard is worse than none.DigitalOcean has no native policy engine: nothing in the platform reacts when a droplet is created, and account-level alerts cover billing thresholds, not resource creation. Kestra turns the public API into an event source with the droplet trigger, keeps the detection state between polls, and gives the response, power off plus notify, retries, logging, and a full audit trail. The same pattern extends to any rule you can express over the trigger's outputs, from naming to region allowlists.
DIGITALOCEAN_TOKEN: DigitalOcean personal access token.SLACK_WEBHOOK_URL: Slack incoming webhook URL.evaluate_naming_policy to match your naming convention.trigger.region in the If condition.droplet.Delete for high-security accounts once the policy has proven itself without false positives.droplet.Get after detection to fetch the droplet's public IP and feed it into a firewall or VPN blocklist.io.kestra.plugin.core.flow.Pause, letting a human approve deletion directly from the Kestra UI.