telia-oss / terraform-aws-ecs-fargate

Terraform module which creates Fargate ECS resources on AWS.
https://registry.terraform.io/modules/telia-oss/ecs-fargate/aws
MIT License
82 stars 75 forks source link

Feat: register service to multiple target groups #70

Closed mhd999 closed 2 years ago

mhd999 commented 2 years ago

There are some cases where a single ECS service task exposes multiple ports that, should be accessible from the same ALB.

To achieve that we need multiple target groups attached to the ALB listeners and then register the single ECS service to multiple target groups.

For example, the requirement for a task exposing ports 80 and 3000 has IP 128.164.1.1 :

1 ALB

2 listener:

2 target groups: