How to Clean Up Expired Resources
A resource can be tagged with an expiration tag that instructs Resoto to clean it up at a defined time. This can serve as a safety net for when a CI job fails or the IaC tool aborts halfway through its run, or even as the primary means of managing resource lifecycles.
> config edit resoto.worker
Enable cleanup by modifying the
resotoworkersection of the configuration as follows:
# Enable cleanup of resources
# Do not actually cleanup resources, just create log messages
# How many cleanup threads to run in parallel
When cleanup is enabled, marked resources will be deleted as a part of the
collect_and_cleanupworkflow, which runs each hour by default.tip
trueto simulate cleanup without actually deleting resources.
Finally, update the
plugin_cleanup_expiredsection, setting the
true:cleanup_expired plugin configuration
# Enable plugin?
The plugin will now run each time Resoto emits the
post_cleanup_plan event. The
post_cleanup_plan event is a part of the
collect_and_cleanup workflow and emitted after resource planning is complete but before the cleanup is performed.