- Newest
- Most votes
- Most comments
The error you're encountering suggests that there's an issue with the connection between your ECS Fargate task set and the Application Load Balancer (ALB) listener. This could be due to a few reasons:
-
Listener Rule Configuration: The ALB listener rule might not be correctly configured to route traffic to your new task set. You may need to update the listener rule to ensure it's directing traffic to the correct target group associated with your new task set.
-
Health Check Issues: The new task set might be failing health checks, preventing it from receiving traffic. This could be due to misconfigured health check settings or issues with the application itself.
-
Network Configuration: There might be network-related problems preventing the ALB from communicating with the Fargate tasks. This could include issues with security groups, subnets, or VPC configuration.
To resolve this issue, you can try the following steps:
-
Review your ALB listener rules and ensure they're correctly configured to route traffic to your new task set.
-
Check the health status of your tasks in the ECS console. Look for any failed health checks or other issues preventing the tasks from becoming healthy.
-
Verify that your VPC, subnet, and security group configurations allow proper communication between the ALB and your Fargate tasks.
-
If you're using blue/green deployment, make sure the new task set is properly registered with the target group and that the listener rules are updated accordingly.
-
Review your Terraform configuration to ensure all necessary resources and permissions are correctly defined for the ECS service, tasks, and ALB integration.
If the issue persists after these checks, you may need to investigate your application logs or CloudWatch metrics for more detailed information about why the task set is not serving production traffic as expected.
Sources
Fargate deployment can not pull from ECR | AWS re:Post
errorECS Deployment Circuit Breaker was triggered | AWS re:Post
answered a year ago
Relevant content
asked a year ago
asked a month ago
asked 3 years ago

still this error The ELB could not be updated due to the following error: Primary taskset target group must be behind listener arn:aws:elasticloadbalancing:ap-southeast-1:791367083955:listener/app/ecs-dev-alb/72bfebe10b8ad3d2/8d5a7b137855163b. i have alb.tf resource "aws_lb" "ecs_alb" { name = "ecs-dev-alb" internal = false load_balancer_type = "application" security_groups = [aws_security_group.alb_sg.id] subnets = var.subnets }
Define the green target group (active target group).
resource "aws_lb_target_group" "green" { name = "ecs-green-tg" port = 3000 protocol = "HTTP" target_type = "ip" vpc_id = var.vpc_id
health_check { path = "/healthcheck" interval = 30 matcher = "200-399" timeout = 5 healthy_threshold = 2 unhealthy_threshold = 2 } }
Declare the blue target group for reference purposes.
Although required by cicd.tf, this TG is not referenced in any listener rules.
resource "aws_lb_target_group" "blue" { name = "ecs-blue-tg" port = 3000 protocol = "HTTP" target_type = "ip" vpc_id = var.vpc_id
health_check { path = "/healthcheck" interval = 30 matcher = "200-399" timeout = 5 healthy_threshold = 2 unhealthy_threshold = 2 } }
HTTPS listener: forward exclusively to the green target group.
res
plz have a look on config and share fix