Sample code supporting the AWS Research Cloud initiative.
This is a CloudFormation template that deploys a Lambda function which, when triggered, looks through every region and stops (or, in the case of instance-backed instances, terminates) EC2 instances that don't have a KeepRunning tag set.
Budget Safety Switch - README.md
Budget Safety Switch - CloudFormation Template
For more information, please refer to the AWS Research Cloud Program documentation.