Skip to main content

Staging operating hours and manual Kafka cleanup

ยท One min read
Atlas Infra

The Atlas Infra staging environment now has scheduled start and stop automation managed through Terraform.

  • start runs on weekdays at 08:00 in America/Fortaleza
  • stop runs every day at 20:00 in America/Fortaleza
  • Kafka cleanup remains available as a dedicated Lambda, but it is now invoked manually instead of through EventBridge

This change reduces the amount of always-on runtime in staging while keeping a manual recovery path for Kafka topic cleanup when operators actually need to reclaim space.

The Kafka cleanup Lambda:

  • discovers topics by the prefixes declared in msk_cleanup_topic_name_prefixes
  • deletes and recreates the matching topics
  • keeps explicit topic definitions from msk_cleanup_topics available after cleanup

The cleanup flow is intentionally manual because Kafka topic deletion can take long enough that running it on a fixed schedule was not a good cost tradeoff.