Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terraform-community-modules/tf_aws_ecs_instance_draining_on_scale_in
Deploys resources necessary to implement ECS instance draining and protection for running tasks during ASG scale-in events.
https://github.com/terraform-community-modules/tf_aws_ecs_instance_draining_on_scale_in
aws-ecs terraform
Last synced: 3 months ago
JSON representation
Deploys resources necessary to implement ECS instance draining and protection for running tasks during ASG scale-in events.
- Host: GitHub
- URL: https://github.com/terraform-community-modules/tf_aws_ecs_instance_draining_on_scale_in
- Owner: terraform-community-modules
- Created: 2017-02-23T12:54:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-24T16:58:29.000Z (almost 2 years ago)
- Last Synced: 2024-05-08T00:30:01.683Z (6 months ago)
- Topics: aws-ecs, terraform
- Language: HCL
- Homepage:
- Size: 5.79 MB
- Stars: 20
- Watchers: 7
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ECS Instance Draining on Scale In
===================================Heavily inspired by this AWS [blog post](https://aws.amazon.com/blogs/compute/how-to-automate-container-instance-draining-in-amazon-ecs/), 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](http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html) is available.
![alt tag](https://s3.amazonaws.com/chrisb/Architecture.png)
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
-----```js
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](https://github.com/sclausson)