0

I have setup an AWS Network Load Balancer no problem and I have a number of different services running on their assigned ports. This all works perfectly.

Then I was asked to host a number of different node apps on their own ports and are accessed via their own domains. After I realised I couldn't get this to work correctly on NLB I looked to Application Load Balancer and use Host-Based Routing rules.

  • app1.example.com
  • app2.example.com

What I did

I setup the application load balancer listener on https :443 and a Host-Based Routing rule that forwards app1.example.com traffic to a target group to watch 443 and send the traffic to the correct instance on port 3000. The security group is also setup to with port 3000 open.

So I thought.... all I had to do was add the load balancer IP to the subdomain A Records on the external domain registrar.... but I can't find the IP anywhere! I'm missing something fundamental here and AWS docs are killing me.

The above steps aren't too different from setting up a Network Load Balancer without the Host-Based Routing rules.

Could anyone point out where I can find the ALB IP or where am I'm going off track?

3
  • 2
    AWS ELB/ALB IP addresses may change. Don't use it. This is wrong regardless: add the load balancer IP to the subdomain A Records on the external domain registrar add an A record ALIAS to your app domain pointing to the ELB's DNS name. Commented Feb 11, 2019 at 16:25
  • Thanks for commenting: I didn't think of that, I'm testing with a CNAME right now. Commented Feb 11, 2019 at 16:36
  • dig reports the CNAME is active but I'm missing something in my target group.Or AWS is blocking my ALIAS. Commented Feb 11, 2019 at 17:06

1 Answer 1

1

The Ip might change so better use an other option such as CNAME or A-record + Alias (the latter might save you some money, if I remember correctly).

Aws ELB A record + Alias (Route 53 setup)

Sign up to request clarification or add additional context in comments.

6 Comments

I added a CNAME to the DNS of my Application Load Balancer and when I tried host app1.example.com on the subdomain I received not found (nxdomain). I understand the roaming IP so I'll avoid that.
Have a look at the image I added - CNAME entries might take some time to propagate because of the DNS
I'm using an external registrar not Route 53. Do you think this might be my blocker?
As I said it takes time for DNS entries to propagate - maybe you just have to wait
Hi +ohlr, yes it does work and I intend to add a complete break down of what I did here so that other's can benefit from my work..... one task finished and another 10 appear :)
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.