Giter Club home page Giter Club logo

tf_aws_ecs_instance_draining_on_scale_in's Introduction

ECS Instance Draining on Scale In

===================================

Heavily inspired by this AWS blog post, this module deploys resources and code to support ECS Instance Draning and ASG lifecycle hook to ensure that running tasks are not obliterated by ASG scale-in events.

Further details about AutoScaling Lifecyle Hooks is available.

alt tag

Module Input Variables

  • region - The AWS Region where the resources reside.
  • autoscaling_group_name - The Name of the AutoScaling Group used by the ECS Cluster.
  • cluster_name - The Name of the ECS Cluster to target
  • function_sleep_time - Number of seconds the Lambda function should sleep before checking ECS Instance Task Count again. Defaults to 15 seconds.
  • hook_heartbeat_timeout - Amount of time, in seconds, the lifecycle hook should wait before giving up and moving onto the default result. Defaults to 900 (15 mins).
  • hook_default_result - Can be one of either ABANDON or CONTINUE. ABANDON stops any remaining actions, such as other lifecycle hooks, while CONTINUE allows any other lifecycle hooks to complete. Default is ABANDON
  • enabled - boolean expression. If false, the Lifecycle Hook is removed from the AutoScaling Group. Defaults to true.

Usage

resource "aws_autoscaling_group" "ecs" {
  #properties omitted
}

module "ecs_instance_draining_on_scale_in" {
  source = "github.com/terraform-community-modules/tf_aws_ecs_instance_draining_on_scale_in"

  region = "eu-west-1"
  autoscaling_group_name = "${aws_autoscaling_group.ecs.asg_name}"
  cluster-name = "my-cluster"
  hook_heartbeat_timeout = 1800
  hook_default_result    = "ABANDON"
}

Author

Created and maintained by Shayne Clausson

tf_aws_ecs_instance_draining_on_scale_in's People

Contributors

antonbabenko avatar sclausson 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.