Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I point ELB to domain defined by service discovery

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.

like image 381
Zeta Doop Avatar asked Sep 03 '19 12:09

Zeta Doop


People also ask

How do I point my domain to ELB?

To route domain traffic to an ELB load balancer, use Amazon Route 53 to create an alias record that points to your load balancer. An alias record is a Route 53 extension to DNS.

What is ELB DNS name?

This DNS name includes the name of the AWS Region in which the load balancer is created. For example, if you create a load balancer named my-loadbalancer in the US West (Oregon) Region, your load balancer receives a DNS name such as my-loadbalancer-1234567890.us-west-2.elb.amazonaws.com .


1 Answers

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.

like image 148
mohit Avatar answered Nov 14 '22 06:11

mohit