Skip to main content

How to Find Expired Resources

A resource can be tagged with an expiration tag that instructs Fix Inventory 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.

Fix Inventory calculates the expiration time of a resource based on its expiration tag and stores the result as the value of the metadata.expires property.

Prerequisites​

This guide assumes that you have already installed and configured Fix Inventory to collect your cloud resources.

Directions​

Execute the following search in Fix Inventory Shell to list all expired resources:

> search /metadata.expires < "@utc@"
note

This search finds all resources that have an expires property that is less than the current time. Fix Inventory automatically expands @utc@ to the current date and time. See help placeholders for more information on placeholder strings.

Further Reading​