Git Product home page Git Product logo

ecs_number_controller's Introduction

ecs_number_controller

This Cloud Formation template is designed to increase and decrease the number of ECS Services. The motivation is to reduce the cost of ECS Service by reducing the number of ECS Service during the night. If you stop your Fargate(1 vCPU, 2.00 GB) on half of day (meaning out of working time), you can reduce about 22.18 USD per month due to AWS Pricing Calculator🤩īŧ

This template is effective in these cases

  • You are running Fargate in a test or staging environment.
  • Your application is not a 24 hour service.
  • The traffic is not so high during the night. (But this can be solved by using AWS Auto Scaling)

Architecture

How it works

  1. EventBridge triggers the Step Functions at a specified time.
  2. The Step Functions then execute the UpdateService Lambda function, updating the number of ECS services.
  3. If the previous step is successful, the Step Functions execute the WaitForStable Lambda function to wait for the ECS Service to stabilize.

Usage

You can give it a try by under quick-create links.

https://ap-northeast-1.console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/create/review?templateURL=https://cf-okamos-ecs-number-controller.s3.ap-northeast-3.amazonaws.com/main.yaml&stackName=ECSNumberController

Parameters

Parameter Description Default
ClusterName The name of the ECS cluster you need to manage.
ServiceName The name of the ECS service for which you want to update the number.
ECSRegion The region of the ECS service. ap-northeast-1
DayCount The number of ECS service needed during the day. 1
NightCount The number of ECS service needed during the night. 0
DayStartTime The time(UTC) to start ECS service during the day. 8
NightStartTime The time(UTC) to stop ECS service during the night. 21

License

MIT

ecs_number_controller's People

Contributors

iisyos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.