Amazon EventBridge Scheduler to start and stop EC2 instances

Schedule → Amazon EC2

Simple pattern that starts and stops given EC2 instances based on time of day, timezone and days of week

Creates a schedule that turns on instances at 7:00am and turns them off at 18:00pm Monday to Friday using Europe/London timezone.
Example uses universal targets with EventBridge Scheduler to talk to the EC2 directly.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-schedule-to-ec2-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

David Boyne

David Boyne

Helping people learn about event-driven architectures and serverless

Follow on LinkedIn