By default, Cloud Custodian caches resource data for 15 minutes in ~/.cache/cloud-custodian.cache
.
This lets you run multiple policies or filters against the same resource data without having to hit
cloud provider APIs each time.
Have you ever wanted to look inside that cache? You can!
The cache is a SQLite database, where keys and values are pickle-encoded blobs. We can use VisiData to deserialize those pickled blobs and expand them into a human-readable tabular view. c7n_cache.vdj is a sample replay file that executes a predefined set of commands. This should work for environments using Cloud Custodian's default cache settings, and can be run with:
vd -p /path/to/c7n_cache.vdj --replay-wait=2
(Where --replay-wait
defines a number of seconds to wait between steps - you don't have to wait so
long!)