aws-solutions / instance-scheduler-on-aws

A cross-account and cross-region solution that allows customers to automatically start and stop EC2 and RDS Instances
https://aws.amazon.com/solutions/implementations/instance-scheduler-on-aws/
Apache License 2.0
557 stars 279 forks source link

Fargate scaling support #582

Open villelahdenvuo opened 3 weeks ago

villelahdenvuo commented 3 weeks ago

Instance scheduler now supports ECS via ASG scaling, however it does not work for Fargate services as they do not use EC2/ASGs and have their own task scaling system.

Describe the feature you'd like

Add support for Fargate task scaling to instance scheduler, similar to how ASGs work.

Additional context

The workaround is to maintain your own scaling rules for Fargate services, but the idea of having a centralized instance scheduler is nice.

Example with CDK ```ts /** Set up office hours scaling to save money on development environments. */ private setupOfficeHours(scalableTarget: cdk.aws_ecs.ScalableTaskCount) { scalableTarget.scaleOnSchedule('OfficeHoursIn', { schedule: appscaling.Schedule.cron(OFFICE_HOURS.in), minCapacity: this.env.minCapacity ?? 1, maxCapacity: this.env.maxCapacity ?? 2, }); scalableTarget.scaleOnSchedule('OfficeHoursOut', { schedule: appscaling.Schedule.cron(OFFICE_HOURS.out), minCapacity: 0, maxCapacity: 0, }); } ```
CrypticCabub commented 3 weeks ago

Thanks for creating the feature request. If anybody else would like to see Fargate scheduling support prioritized, please upvote this issue.

bientavu commented 1 week ago

It is indeed a really cool feature to add! This instance scheduler project is perfect, only ECS Fargate scheduling is missing (and we use it a lot)