From 1fd222d51815ef1ee74184d2bbab98a5662a545a Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Thu, 25 Jul 2024 22:28:02 +0000 Subject: [PATCH] Update lb tg to use target type to ip --- infrastructure/cloud/modules/container/ecs.tf | 2 +- infrastructure/cloud/modules/networking/elb.tf | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/infrastructure/cloud/modules/container/ecs.tf b/infrastructure/cloud/modules/container/ecs.tf index 6f282119..ecc478b5 100644 --- a/infrastructure/cloud/modules/container/ecs.tf +++ b/infrastructure/cloud/modules/container/ecs.tf @@ -39,7 +39,7 @@ resource "aws_ecs_service" "ecs_service" { desired_count = 1 network_configuration { - subnets = var.subnet_id + subnets = [var.subnet_id] security_groups = [var.ecs_sg_id] assign_public_ip = false } diff --git a/infrastructure/cloud/modules/networking/elb.tf b/infrastructure/cloud/modules/networking/elb.tf index 437860f9..6049f44e 100644 --- a/infrastructure/cloud/modules/networking/elb.tf +++ b/infrastructure/cloud/modules/networking/elb.tf @@ -14,10 +14,11 @@ resource "aws_lb" "lb" { resource "aws_lb_target_group" "lb_target_group" { - name = "${var.app_name}-tg-${var.environment}" - port = 80 - protocol = "HTTP" - vpc_id = aws_vpc.vpc.id + name = "${var.app_name}-tg-${var.environment}" + port = 80 + protocol = "HTTP" + vpc_id = aws_vpc.vpc.id + target_type = "ip" } resource "aws_lb_listener" "lb_listener" {