From c4f111e20fbe2b09e490fa6fc73baf25c0f00815 Mon Sep 17 00:00:00 2001 From: Rahul-4480 Date: Wed, 24 Jul 2024 13:50:02 +0530 Subject: [PATCH] update: remove instance target group from ECS module --- modules/ecs/autoscaling.tf | 1 - modules/ecs/load-balancer.tf | 16 ---------------- modules/ecs/locals.tf | 1 - 3 files changed, 18 deletions(-) diff --git a/modules/ecs/autoscaling.tf b/modules/ecs/autoscaling.tf index 9a7686d..492a448 100644 --- a/modules/ecs/autoscaling.tf +++ b/modules/ecs/autoscaling.tf @@ -9,7 +9,6 @@ resource "aws_autoscaling_group" "this" { version = "$Latest" } - target_group_arns = [aws_lb_target_group.instance_target[0].arn] protect_from_scale_in = true tag { diff --git a/modules/ecs/load-balancer.tf b/modules/ecs/load-balancer.tf index d9308d7..9f490c6 100644 --- a/modules/ecs/load-balancer.tf +++ b/modules/ecs/load-balancer.tf @@ -1,19 +1,3 @@ -resource "aws_lb_target_group" "instance_target" { - count = var.endpoint_details != null ? 1 : 0 - name = format("%s-%s-instance", var.service_name, terraform.workspace) - port = local.main_container_port - protocol = "HTTP" - vpc_id = var.vpc_id - target_type = local.alb_instance_target_type - - health_check { - protocol = "HTTP" - interval = 10 - unhealthy_threshold = 6 - matcher = "200,301-399" - } -} - resource "aws_lb_target_group" "ip_target" { count = var.endpoint_details != null ? 1 : 0 name = format("%s-%s-ip", var.service_name, terraform.workspace) diff --git a/modules/ecs/locals.tf b/modules/ecs/locals.tf index 2b497c3..53ae2ab 100644 --- a/modules/ecs/locals.tf +++ b/modules/ecs/locals.tf @@ -29,7 +29,6 @@ locals { iam_instance_role_name_prefix = "ecs-instance-role" iam_instance_profile_name_prefix = "ecs-instance-profile" task_definition_network_mode = "awsvpc" - alb_instance_target_type = "instance" alb_ip_target_type = "ip" authenticate_oidc_issuer = "https://accounts.google.com" authenticate_oidc_user_info_endpoint = "https://openidconnect.googleapis.com/v1/userinfo"