Attach ecs service to nlb?

Is it possible to attach an ECS service to an existing NLB similar to the ability to specify an ALB in the ecs-module? I’ve been looking through the module but don’t see much.

I saw the docker-fargate-service-with-ecs example but that isn’t quite what I’m looking for.

Any advice or tips on getting this working?


While we don’t have an explicit example or module for using NLBs, NLBs and ALBs share a common API. As such, you can use the corresponding resources of the NLB (security group, target group, etc) in place of the ALB versions, using the docker-service-with-alb example as a reference.


Is this the example you had in mind?

Something along the lines of reusing the alb variables that exposed by the module and just pointing them at the NLB I have created instead?

Yup that is correct!