- Newest
- Most votes
- Most comments
Yes, you can schedule an automatic shutdown for your EC2 instance every night at midnight to save costs on your development instance. AWS offers several built-in methods to accomplish this:
- AWS Systems Manager Resource Scheduler (Quick Setup):
- Open the AWS Systems Manager console
- Navigate to Quick Setup
- Select the Resource Scheduler card and choose Create
- Specify the tag key and value for your EC2 instance
- Configure the schedule to stop your instance at midnight
- Amazon EventBridge with AWS Lambda:
- Create a Lambda function that stops EC2 instances
- Set up an EventBridge schedule with a cron expression (e.g., "0 0 * * ? *" for midnight every day)
- Configure the Lambda function as the target for the EventBridge schedule
- AWS Instance Scheduler:
- This solution automates start and stop actions based on predefined schedules
- You can configure rules to apply to specific instances using tags
- Set up a schedule to shut down your development instance at midnight
These methods help eliminate wasteful spending on idle resources during off-hours. For your development instance that doesn't need to run 24/7, implementing an automatic shutdown at midnight can significantly reduce your EC2 costs.
Sources
Stop and start EC2 instances automatically on a schedule using Quick Setup - AWS Systems Manager
Reduce IT costs by implementing automatic shutdown for Amazon EC2 instances | AWS Public Sector Blog
Community | EC2 cost optimization:15 ways to save on Amazon EC2
AWS Managed Services Resource Scheduler - AMS Advanced User Guide
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago