The challenge
Temporary EC2 instances in non-production environments could remain running after engineers finished testing, leading to avoidable cloud spend.
My contribution
- Designed an AWS Lambda automation to identify eligible instances across platform development and test accounts.
- Used an opt-out tagging convention to distinguish resources that should be retained from clean-up candidates.
- Implemented checks around stale instances and a seven-day clean-up window.
Automation workflow
01Engineers tag instances that require exclusion from automated clean-up.
02A scheduled Lambda identifies eligible untagged candidates and assesses age/activity policy.
03Eligible instances are removed according to the agreed retention rules.
Outcome & impact
The solution is estimated to save approximately £20,000 annually. This is a forecast/estimate, not a confirmed realised saving.
Public case study: implementation details have been generalised to avoid disclosing private employer systems, source code, account identifiers or infrastructure configuration.