recon_gen.common.cleanup

Cleanup orphaned QuickSight resources managed by recon-gen.

Lists every resource in the configured account+region that carries the ManagedBy: recon-gen tag and is NOT present in the current generate output directory, prints them, and (after a single y/n confirmation) deletes them.

Functions

run_cleanup(cfg, out_dir, *[, dry_run, ...])

Entrypoint for the cleanup CLI command.

recon_gen.common.cleanup.run_cleanup(cfg, out_dir, *, dry_run=False, skip_confirm=False, purge_all=False)[source]

Entrypoint for the cleanup CLI command.

By default, out_dir is the carve-out: anything currently emitted there stays, everything else matching the cfg’s tag/prefix scope is stale.

With purge_all=True (v8.6.13 --all flag), out_dir is ignored entirely — every resource matching the scope is treated as stale, including the live deploy. Use to nuke everything we own from a QS account (e.g. tearing down a CI run, decommissioning an L2 instance).

Return type:

int

Parameters:
  • cfg (Config)

  • out_dir (Path)

  • dry_run (bool)

  • skip_confirm (bool)

  • purge_all (bool)