From 4b4100742755832d5f9e21396aef307d19e2d95f Mon Sep 17 00:00:00 2001 From: Sean Phuphanich <61524746+seaphu@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:45:04 -0500 Subject: [PATCH] fix : actions to use weighted_forward syntax ## Why This Fixes the Error The ALB module expects actions to be structured with the action type as a nested object (like `weighted_forward`, `forward`, `redirect`, etc.) rather than using a separate `type` field. The module code checks for these nested objects to determine which action configuration to apply. When you had `type = "weighted-forward"`, the module couldn't find any of the expected action objects (`authenticate_cognito`, `authenticate_oidc`, `fixed_response`, `forward`, `weighted_forward`, or `redirect`), which caused the "Insufficient action blocks" error. Terraform configuration should now apply successfully without the action block error. ###before: actions = [ { type = "weighted-forward" target_groups = [...] } ] ###after: actions = [ { weighted_forward = { target_groups = [...] } } ] ---- Testing Notes - deployed on AWS and manually verified with code changes. --- examples/fargate/main.tf | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/examples/fargate/main.tf b/examples/fargate/main.tf index f3931b5..6786cf6 100644 --- a/examples/fargate/main.tf +++ b/examples/fargate/main.tf @@ -325,17 +325,18 @@ module "alb" { priority = 1 actions = [ { - type = "weighted-forward" - target_groups = [ - { - target_group_key = "ex_ecs" - weight = 100 - }, - { - target_group_key = "ex_ecs_alternate" - weight = 0 - } - ] + weighted_forward = { + target_groups = [ + { + target_group_key = "ex_ecs" + weight = 100 + }, + { + target_group_key = "ex_ecs_alternate" + weight = 0 + } + ] + } } ] conditions = [ @@ -350,13 +351,14 @@ module "alb" { priority = 2 actions = [ { - type = "weighted-forward" - target_groups = [ - { - target_group_key = "ex_ecs_alternate" - weight = 100 - } - ] + weighted_forward = { + target_groups = [ + { + target_group_key = "ex_ecs_alternate" + weight = 100 + } + ] + } } ] conditions = [