Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-ecs-autoscaler

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-ecs-autoscaler

[![Build Status](https://img.shields.io/travis/JeffDownie/aws-ecs-autoscaler/master.svg)](https://travis-ci.org/JeffDownie/aws-ecs-autoscaler?branch=master) [![Coverage Status](https://img.shields.io/coveralls/JeffDownie/aws-ecs-autoscaler/master.svg)](ht

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

AWS ECS Autoscaler

Build Status Coverage Status Npm Version

The AWS ECS Autoscaler keeps track of the cpu and memory requirements of the services running in an ECS cluster, and adjusts the desired capacity of the underlying AWS autoscaling group to minimize wastage. It can be run as a task in the ECS cluster itself, or on a separate management server.

Usage

In a cloudformation template, on the ECS cluster:

  Service:
    Properties:
      Cluster: my-cluster-name
      DesiredCount: 2
      TaskDefinition: !Ref AutoscalingTaskDefinition
    Type: AWS::ECS::Service

  AutoscalingTaskDefinition:
    Properties:
      ContainerDefinitions:
      - Environment:
        - Name: AS_GROUP_NAME
          Value: MY_AUSTOSCALING_GROUP_NAME
        - Name: CLUSTER_NAME
          Value: MY_CLUSTER_NAME
        - Name: AWS_REGION
          Value: !Ref "AWS::Region"
        Essential: true
        Image: !Sub trinitymirror/aws-ecs-autoscaler:${AutoscalingVersion}
        Memory: 200
        Cpu: 100
        Name: Autoscaler
    Type: AWS::ECS::TaskDefinition

And it would require the following permissions attached to the Austoscaling group's launch configuration iam role to run:

- Action:
  - autoscaling:DescribeAutoScalingGroups
  - autoscaling:SetDesiredCapacity
  - autoscaling:TerminateInstanceInAutoScalingGroup
  Effect: Allow
  Resource: '*'
- Action:
  - ecs:DescribeContainerInstances
  - ecs:DescribeServices
  - ecs:DescribeTaskDefinition
  - ecs:DescribeTasks
  - ecs:ListContainerInstances
  - ecs:ListServices
  - ecs:ListTasks
  Effect: Allow
  Resource: '*'
- Action:
  - ec2:DescribeInstances
  Effect: Allow
  Resource: '*'

Note that the autoscaling actions do require access to all resources, and cannot be limited to just your autoscaling group - this is a limitation of AWS autoscaling groups

Optional environment variables and their defaults:

DRY_RUN=false - When true, causes the container to not actually run any changes, just print to stdout what it would do. Default is false. INTERVAL=20000 - The interval that the container checks for changes to the cluster, in milliseconds. Default is 20000. MAX_LOOPS=20 - Maximum number of intervals to run before exiting, to avoid a memory leak in the AWS SDK. Default is 20.

FAQs

Package last updated on 24 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc