6

I have service in AWS ECS and service discovery maintains domain records like web.local that points to tasks in that service.

I would like Network Load Balancer to point at domain web.local instead of IP or Instance.

I know when I create service I specify Load Balancer and it magically setups everything for me. I can't find where web.local is specified or service discovery.

I checked target group, etc.

Max Fry
  • 409
  • 3
  • 8

1 Answers1

2

There is an option to use service discovery, If you want to enable it you may do it while you are creating the ECS service.

enter image description here

The namespace name is the keyword after the dot(.), in our case it will be .local.

There is also an option to add the Service discovery name* this is the keyword before the dot(.).

Ref: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html

Update: You don't need it to point it to NLB if you are using service discovery option of ECS. There will be absolutely no role of the target group with it. ECS service will directly point a DNS name to your containers. If you want to use Load balancer bases service discovery then it's a different story altogether, Then you have to create a private hosted zone yourself and point it to your load balancer. But in the end, you can only choose one.

mohit
  • 2,325
  • 23
  • 48
  • Yes. I create namespace like that. But is there way to point Network Load Balancer at that service? Or make service discovery update Target Group? It happens only when I create service. I ask how can I change that later. – Max Fry Sep 03 '19 at 20:16