From 2639ca91b1f05e6f1d5d2c66b4382d490f16c6ca Mon Sep 17 00:00:00 2001 From: Wictor Zhao Date: Wed, 3 Apr 2024 11:56:12 +0200 Subject: [PATCH] Fix bug with provisioned concurrency required to be defined --- main.tf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 3ae6855..9e3b8b8 100644 --- a/main.tf +++ b/main.tf @@ -185,10 +185,9 @@ resource "aws_appautoscaling_policy" "this" { } resource "aws_appautoscaling_scheduled_action" "this" { - for_each = { + for_each = var.provisioned_concurrency != null ? { for v in var.provisioned_concurrency.schedules : v.schedule => v - if var.provisioned_concurrency != null - } + } : {} name = "${var.name}-lambda-scheduled-scaling" resource_id = aws_appautoscaling_target.this[0].resource_id