From 39f8ac79276ef2a2d9b969d2b14345a685136f84 Mon Sep 17 00:00:00 2001 From: John Ajera <37360952+jajera@users.noreply.github.com> Date: Thu, 11 Sep 2025 06:59:55 +0000 Subject: [PATCH] fix: handle invalid attribute combination ensures that when target type is lambda the protocol is null --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index e316961..e9b10c7 100644 --- a/main.tf +++ b/main.tf @@ -64,7 +64,7 @@ resource "aws_lb_target_group" "http" { name = "${local.base_name}-http" port = var.target_type == "lambda" ? null : var.target_http_port - protocol = var.target_type == "lambda" ? "HTTP" : "HTTP" + protocol = var.target_type == "lambda" ? null : "HTTP" target_type = var.target_type vpc_id = var.target_type == "lambda" ? null : var.vpc_id @@ -91,7 +91,7 @@ resource "aws_lb_target_group" "https" { count = var.enable_https ? 1 : 0 name = "${local.base_name}-https" port = var.target_type == "lambda" ? null : var.target_http_port - protocol = var.target_type == "lambda" ? "HTTP" : "HTTPS" + protocol = var.target_type == "lambda" ? null : "HTTPS" target_type = var.target_type vpc_id = var.target_type == "lambda" ? null : var.vpc_id