From f17bdf83fd3336079f3cf7b926ad757df6c6743d Mon Sep 17 00:00:00 2001 From: Shayne Clausson Date: Fri, 1 Mar 2019 19:05:52 +0100 Subject: [PATCH] Limit lambda function name to 64 chars --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a552490..9c704bf 100644 --- a/main.tf +++ b/main.tf @@ -112,7 +112,7 @@ data "archive_file" "index" { resource "aws_lambda_function" "lambda" { runtime = "python2.7" filename = "${path.module}/files/index.zip" - function_name = "${var.autoscaling_group_name}-ecs-instance-draining-on-scale-in" + function_name = "${substr(var.autoscaling_group_name,0,min(64, length(var.autoscaling_group_name)))}" role = "${aws_iam_role.lambda.arn}" handler = "index.lambda_handler"