diodonfrost/terraform-aws-lambda-scheduler-stop-start

Add function to terminate EC2 instances

ItaloChagas opened this issue · 2 comments

SUMMARY

In an EKS cluster environment is very common to use spot instances as worker nodes since applications are ephemeral same as the worker nodes(spot/on-demand instances). In order to save costs on development and non-productive environments shutdown/terminate instances that were created by Karpenter/ClusterAutoScaler/ASG nightly and on weekends is very handy since that just stop instances might include .

ISSUE TYPE
  • Create a function to implement "terminate_instances()" boto3 method instead of "stop_instances", that way both options are available to the final user.

As a workaround I forked the repo and edited the function from "stop_instances()" to "terminate_instances()".

Just released a new version including redshift scheduler.

Now, you have the option to terminate autoscaling instances instead of merely stopping them. To do this, set the Terraform variable 'autoscaling_terminate_instances' to 'true'."