Autoscaling support for specifying a Lambda as a custom termination policy

I’m in the process of developing a Lambda for use as an Autoscaling custom termination policy to improve how ECS scales down ASG’s (with minimal service disruption). Now that I’m testing the code I discovered that the Autoscaling module in the AWS Terraform provider doesn’t appear to support Lambda’s as custom termination policies.

So my first question is whether that’s incorrect? :slight_smile: I’d be happy to be wrong about that, even if it means upgrading the release of Terraform or the AWS providers we’re using.

And if that function is too new to be supported yet, what’s the best way to suggest that it be added and then track progress (assuming it’s added to a roadmap at some point)?

Update… A co-worker who didn’t read the Terraform docs first, tried just adding as Lambda as a custom termination policy and it worked. So this appears to be a case where the online docs aren’t completely up to date.

1 Like

@jjones Which terraform version did they use?

Confirmed. I’ve passed the ARN of the Lambda as a “custom termination policy” in the aws_autoscaling_group and it worked. I’m using Terraform 1.1.4