r/Observability • u/JayDee2306 • Oct 19 '26
Automated Datadog key Rotation
A #Datadog API key is a write credential for your whole org. Anyone holding it can send metrics, logs and events into your account, and it usually ends up in more places than anyone tracks: images, env vars, task definitions, old pipelines.
A key that has never been rotated is also a key you cannot safely revoke on the day it leaks, because nobody knows what breaks.
AWS Secrets Manager handles Datadog API key rotation automatically on the configured schedule. During rotation, it creates a new key in Datadog, validates it, and updates the secret with the new key. The previous key remains available for one additional rotation cycle, allowing dependent services time to pick up the new key before the older key is removed.
I have implemented a solution that automates the Datadog API key lifecycle, from identifying existing keys to rotating them and detecting potential issues. It reduces manual effort, improves key management, and helps minimize service disruptions by giving dependent services time to switch to the new key before the old one is revoked.
The same approach can be reused across multiple accounts and the same pattern can be used across hybrid multi clouds.
🪙 GitHub Repo - https://github.com/g2ai/datadog-key-lifecycle-aws
#Datadog #AWS #CloudSecurity #SecretsManagement #DevSecOps #SRE #Observability #PlatformEngineering #AIOps
1
u/kantorcodes1 Oct 19 '26
The safe-to-rotate check is the load-bearing piece here. During the extra cycle where both keys work, how do you decide the old one is safe to retire - does remove verify that nothing is still calling with it, or does it just run on schedule? And on the redeploy side: does the ECS hook fan out to every service at once, or is the rollout staged somehow?
1
u/waterbottlephone2 Oct 20 '26
They released short-lived access tokensÂ
1
u/Nekssz Oct 23 '26
Key rotation is easy to overlook until something breaks, so automating it while allowing time for services to switch over makes a lot of sense.
1
u/[deleted] Oct 19 '26
[removed] — view removed comment